Skip to content

Commit 0839fbc

Browse files
committed
CLOUDSTACK-6023 vcpus should not be higher then xen specifies
1 parent b3829e5 commit 0839fbc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,12 @@ protected VM createVmFromTemplate(Connection conn, VirtualMachineTO vmSpec, Host
13121312
if (guestOsTypeName.toLowerCase().contains("windows")) {
13131313
vmr.VCPUsMax = (long)vmSpec.getCpus();
13141314
} else {
1315-
vmr.VCPUsMax = 32L;
1315+
// XenServer has a documented limit of 16 vcpus per vm
1316+
vmr.VCPUsMax = 2L * vmSpec.getCpus();
1317+
if (vmr.VCPUsMax > 16)
1318+
{
1319+
vmr.VCPUsMax = 16L;
1320+
}
13161321
}
13171322

13181323
vmr.VCPUsAtStartup = (long)vmSpec.getCpus();

0 commit comments

Comments
 (0)