mirror of https://github.com/apache/cloudstack.git
CS-12972 : cap is per domain/VM
This commit is contained in:
parent
22a5cd1d84
commit
a8e7d7b110
|
|
@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue