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



##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -1959,15 +1959,18 @@ protected StartAnswer execute(StartCommand cmd) {
             }
 
             // Check for hotadd settings
-            
vmConfigSpec.setMemoryHotAddEnabled(vmMo.isMemoryHotAddSupported(guestOsId));
-
+            
vmConfigSpec.setMemoryHotAddEnabled(vmMo.isMemoryHotAddSupported(guestOsId) && 
vmSpec.isEnableDynamicallyScaleVm());
             String hostApiVersion = ((HostMO) 
hyperHost).getHostAboutInfo().getApiVersion();
             if (numCoresPerSocket > 1 && hostApiVersion.compareTo("5.0") < 0) {
                 s_logger.warn("Dynamic scaling of CPU is not supported for 
Virtual Machines with multi-core vCPUs in case of ESXi hosts 4.1 and prior. 
Hence CpuHotAdd will not be"
                         + " enabled for Virtual Machine: " + vmInternalCSName);
                 vmConfigSpec.setCpuHotAddEnabled(false);
             } else {
-                
vmConfigSpec.setCpuHotAddEnabled(vmMo.isCpuHotAddSupported(guestOsId));
+                
vmConfigSpec.setCpuHotAddEnabled(vmMo.isCpuHotAddSupported(guestOsId) && 
vmSpec.isEnableDynamicallyScaleVm());
+            }
+
+            if(!vmMo.isMemoryHotAddSupported(guestOsId) && 
vmSpec.isEnableDynamicallyScaleVm()){
+                s_logger.warn("hotadd is not supported, dynamic scaling 
feature can not be applied " + vmInternalCSName);

Review comment:
       Thanks @DK101010 for making the changes and my apologies for coming on 
this PR this late. can you please add the reason being guest OS does not 
support hot add, something like "hotadd of memory is not supported by the guest 
OS, dynamic scaling feature can not be applied " + vmInternalCSName)".
   
   and please add another log for CPU hot add.




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