harikrishna-patnala commented on a change in pull request #4447:
URL: https://github.com/apache/cloudstack/pull/4447#discussion_r518537865



##########
File path: 
plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/XenServerGuru.java
##########
@@ -98,7 +98,12 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) {
         if (userVmVO != null) {
             HostVO host = hostDao.findById(userVmVO.getHostId());
             if (host != null) {
-                
to.setVcpuMaxLimit(MaxNumberOfVCPUSPerVM.valueIn(host.getClusterId()));
+                // Max cpu cannot be more than host capability
+                if (host.getCpus() < 
MaxNumberOfVCPUSPerVM.valueIn(host.getClusterId()))
+                    to.setVcpuMaxLimit(host.getCpus());

Review comment:
       @Spaceman1984 got it, thanks for the article and yes it seems over 
committing CPU is disabled.
   Do you think we have to also provide some global config "vcpu-unrestricted" 
to allow overcommit of CPU like xenserver does this way "xe vm-param-set 
uuid=<uuid> platform:vcpu-unrestricted=true". This gives admins to choose 
whether to overcommit or not.
   
   Otherwise If we have to go with by setting only actual pCPUs, we need to 
remove this configuration parameter "xen.vm.vcpu.max" as we dont need it now.
   




----------------------------------------------------------------
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.

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


Reply via email to