|
109 | 109 | import com.cloud.agent.api.to.NicTO; |
110 | 110 | import com.cloud.agent.api.to.VirtualMachineTO; |
111 | 111 | import com.cloud.agent.dao.impl.PropertiesStorage; |
| 112 | +import com.cloud.agent.properties.AgentProperties; |
| 113 | +import com.cloud.agent.properties.AgentPropertiesFileHandler; |
112 | 114 | import com.cloud.agent.resource.virtualnetwork.VRScripts; |
113 | 115 | import com.cloud.agent.resource.virtualnetwork.VirtualRouterDeployer; |
114 | 116 | import com.cloud.agent.resource.virtualnetwork.VirtualRoutingResource; |
@@ -411,6 +413,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv |
411 | 413 | protected MemStat _memStat = new MemStat(_dom0MinMem, _dom0OvercommitMem); |
412 | 414 | private final LibvirtUtilitiesHelper libvirtUtilitiesHelper = new LibvirtUtilitiesHelper(); |
413 | 415 |
|
| 416 | + protected Boolean enableManuallySettingCpuTopologyOnKvmVm = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.ENABLE_MANUALLY_SETTING_CPU_TOPOLOGY_ON_KVM_VM); |
| 417 | + |
414 | 418 | protected long getHypervisorLibvirtVersion() { |
415 | 419 | return _hypervisorLibvirtVersion; |
416 | 420 | } |
@@ -4502,6 +4506,11 @@ public boolean isSecureMode(String bootMode) { |
4502 | 4506 | } |
4503 | 4507 |
|
4504 | 4508 | private void setCpuTopology(CpuModeDef cmd, int vcpus, Map<String, String> details) { |
| 4509 | + if (!enableManuallySettingCpuTopologyOnKvmVm) { |
| 4510 | + s_logger.debug(String.format("Skipping manually setting CPU topology on VM's XML due to it is disabled in agent.properties {\"property\": \"%s\", \"value\": %s}.", |
| 4511 | + AgentProperties.ENABLE_MANUALLY_SETTING_CPU_TOPOLOGY_ON_KVM_VM.getName(), enableManuallySettingCpuTopologyOnKvmVm)); |
| 4512 | + return; |
| 4513 | + } |
4505 | 4514 | // multi cores per socket, for larger core configs |
4506 | 4515 | int numCoresPerSocket = -1; |
4507 | 4516 | if (details != null) { |
|
0 commit comments