Skip to content

Commit 275537e

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 1de00b6 commit 275537e

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
@@ -668,7 +668,7 @@ protected void scaleVM(Connection conn, VM vm, VirtualMachineTO vmSpec, Host hos
668668

669669
if (vmSpec.getLimitCpuUse()) {
670670
long utilization = 0; // max CPU cap, default is unlimited
671-
utilization = (int) ((speed * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
671+
utilization = (int) ((vmSpec.getMaxSpeed() * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
672672
//vm.addToVCPUsParamsLive(conn, "cap", Long.toString(utilization)); currently xenserver doesnot support Xapi to add VCPUs params live.
673673
callHostPlugin(conn, "vmops", "add_to_VCPUs_params_live", "key", "cap", "value", Long.toString(utilization), "vmname", vmSpec.getName() );
674674
}

0 commit comments

Comments
 (0)