Skip to content

Commit 1bfb2f9

Browse files
DK101010DK101010sureshanaparti
authored
disable hot add memory and cpu via vm settings (#4630)
* disable hot add memory and cpu via vm settings * add alternative implementation for hot add memory and cpu * add log entry * Modify and add log entry for hotadd * Update plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com> * Update plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com> Co-authored-by: DK101010 <dirk.klahre@itelligence.de> Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>
1 parent 28e70c0 commit 1bfb2f9

File tree

1 file changed

+10
-3
lines changed
  • plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource

1 file changed

+10
-3
lines changed

plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,15 +1993,22 @@ protected StartAnswer execute(StartCommand cmd) {
19931993
}
19941994

19951995
// Check for hotadd settings
1996-
vmConfigSpec.setMemoryHotAddEnabled(vmMo.isMemoryHotAddSupported(guestOsId));
1997-
1996+
vmConfigSpec.setMemoryHotAddEnabled(vmMo.isMemoryHotAddSupported(guestOsId) && vmSpec.isEnableDynamicallyScaleVm());
19981997
String hostApiVersion = ((HostMO) hyperHost).getHostAboutInfo().getApiVersion();
19991998
if (numCoresPerSocket > 1 && hostApiVersion.compareTo("5.0") < 0) {
20001999
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"
20012000
+ " enabled for Virtual Machine: " + vmInternalCSName);
20022001
vmConfigSpec.setCpuHotAddEnabled(false);
20032002
} else {
2004-
vmConfigSpec.setCpuHotAddEnabled(vmMo.isCpuHotAddSupported(guestOsId));
2003+
vmConfigSpec.setCpuHotAddEnabled(vmMo.isCpuHotAddSupported(guestOsId) && vmSpec.isEnableDynamicallyScaleVm());
2004+
}
2005+
2006+
if(!vmMo.isMemoryHotAddSupported(guestOsId) && vmSpec.isEnableDynamicallyScaleVm()){
2007+
s_logger.warn("hotadd of memory is not supported, dynamic scaling feature can not be applied to vm: " + vmInternalCSName);
2008+
}
2009+
2010+
if(!vmMo.isCpuHotAddSupported(guestOsId) && vmSpec.isEnableDynamicallyScaleVm()){
2011+
s_logger.warn("hotadd of cpu is not supported, dynamic scaling feature can not be applied to vm: " + vmInternalCSName);
20052012
}
20062013

20072014
configNestedHVSupport(vmMo, vmSpec, vmConfigSpec);

0 commit comments

Comments
 (0)