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
This commit is contained in:
Nitin Mehta 2013-12-04 14:48:41 -08:00
parent 1de00b6fce
commit 275537e928
1 changed files with 1 additions and 1 deletions

View File

@ -668,7 +668,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
if (vmSpec.getLimitCpuUse()) {
long utilization = 0; // max CPU cap, default is unlimited
utilization = (int) ((speed * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
utilization = (int) ((vmSpec.getMaxSpeed() * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
//vm.addToVCPUsParamsLive(conn, "cap", Long.toString(utilization)); currently xenserver doesnot support Xapi to add VCPUs params live.
callHostPlugin(conn, "vmops", "add_to_VCPUs_params_live", "key", "cap", "value", Long.toString(utilization), "vmname", vmSpec.getName() );
}