mirror of https://github.com/apache/cloudstack.git
CS-12972 : cap is per domain/VM
Conflicts: core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
This commit is contained in:
parent
52b2408c5f
commit
53f6739900
|
|
@ -955,7 +955,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);
|
||||
|
|
@ -964,12 +964,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));
|
||||
}
|
||||
|
||||
if (vcpuParams.size() > 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue