weizhouapache commented on code in PR #7887:
URL: https://github.com/apache/cloudstack/pull/7887#discussion_r1307161147


##########
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 = (long)vmSpec.getVcpuMaxLimit();
+                    vmr.VCPUsMax = Math.min(vmSpec.getVcpuMaxLimit(), 
_host.getCpus());

Review Comment:
   ```suggestion
                       vmr.VCPUsMax = Math.min(vmSpec.getVcpuMaxLimit(), (long) 
_host.getCpus());
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to