Skip to content

Commit fee41ba

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 19e855e commit fee41ba

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

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

0 commit comments

Comments
 (0)