Skip to content

Commit 1de00b6

Browse files
committed
CLOUDSTACK-5352:
CPU cap calculated incorrectly for VMs on XenServer hosts. It should not be limited by the overprovisioning and should set the cap as service offering
1 parent b7da94f commit 1de00b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ protected VM createVmFromTemplate(Connection conn, VirtualMachineTO vmSpec, Host
13231323

13241324
if (vmSpec.getLimitCpuUse()) {
13251325
// CPU cap is per VM, so need to assign cap based on the number of vcpus
1326-
utilization = (int) ((speed * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
1326+
utilization = (int) ((vmSpec.getMaxSpeed() * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
13271327
}
13281328

13291329
vcpuParams.put("weight", Integer.toString(cpuWeight));

0 commit comments

Comments
 (0)