CS-12972 : cap is per domain/VM

This commit is contained in:
anthony 2012-06-14 17:50:05 -07:00
parent 22a5cd1d84
commit a8e7d7b110
1 changed files with 3 additions and 3 deletions

View File

@ -822,7 +822,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
if (speed != null) {
int cpuWeight = _maxWeight; //cpu_weight
int utilization = 0; // max CPU cap, default is unlimited
long utilization = 0; // max CPU cap, default is unlimited
// weight based allocation
cpuWeight = (int)((speed*0.99) / _host.speed * _maxWeight);
@ -831,11 +831,11 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
}
if (vmSpec.getLimitCpuUse()) {
utilization = (int)((speed*0.99) / _host.speed * 100);
utilization = (((long)speed * vmSpec.getCpus() * 100 ) / _host.speed);
}
vcpuParams.put("weight", Integer.toString(cpuWeight));
vcpuParams.put("cap", Integer.toString(utilization));
vcpuParams.put("cap", Long.toString(utilization));
}