mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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>
This commit is contained in:
parent
28e70c0a2a
commit
1bfb2f9fb1
@ -1993,15 +1993,22 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for hotadd settings
|
// Check for hotadd settings
|
||||||
vmConfigSpec.setMemoryHotAddEnabled(vmMo.isMemoryHotAddSupported(guestOsId));
|
vmConfigSpec.setMemoryHotAddEnabled(vmMo.isMemoryHotAddSupported(guestOsId) && vmSpec.isEnableDynamicallyScaleVm());
|
||||||
|
|
||||||
String hostApiVersion = ((HostMO) hyperHost).getHostAboutInfo().getApiVersion();
|
String hostApiVersion = ((HostMO) hyperHost).getHostAboutInfo().getApiVersion();
|
||||||
if (numCoresPerSocket > 1 && hostApiVersion.compareTo("5.0") < 0) {
|
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"
|
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);
|
+ " enabled for Virtual Machine: " + vmInternalCSName);
|
||||||
vmConfigSpec.setCpuHotAddEnabled(false);
|
vmConfigSpec.setCpuHotAddEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
vmConfigSpec.setCpuHotAddEnabled(vmMo.isCpuHotAddSupported(guestOsId));
|
vmConfigSpec.setCpuHotAddEnabled(vmMo.isCpuHotAddSupported(guestOsId) && vmSpec.isEnableDynamicallyScaleVm());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!vmMo.isMemoryHotAddSupported(guestOsId) && vmSpec.isEnableDynamicallyScaleVm()){
|
||||||
|
s_logger.warn("hotadd of memory is not supported, dynamic scaling feature can not be applied to vm: " + vmInternalCSName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!vmMo.isCpuHotAddSupported(guestOsId) && vmSpec.isEnableDynamicallyScaleVm()){
|
||||||
|
s_logger.warn("hotadd of cpu is not supported, dynamic scaling feature can not be applied to vm: " + vmInternalCSName);
|
||||||
}
|
}
|
||||||
|
|
||||||
configNestedHVSupport(vmMo, vmSpec, vmConfigSpec);
|
configNestedHVSupport(vmMo, vmSpec, vmConfigSpec);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user