diff --git a/plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java b/plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java index e996f45afd27..aef8e54f0289 100644 --- a/plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java @@ -1338,7 +1338,7 @@ public VM createVmFromTemplate(final Connection conn, final VirtualMachineTO vmS vmr.VCPUsMax = (long)vmSpec.getCpus(); } else { if (vmSpec.getVcpuMaxLimit() != null) { - vmr.VCPUsMax = Math.min(vcpuMaxLimit, _host.getCpus()); + vmr.VCPUsMax = Math.min(vmSpec.getVcpuMaxLimit(), _host.getCpus()); } } } else {