mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Externalize config to enable manually setting CPU topology on KVM VM (#5273)
* Externalize config to enable manually setting CPU topology on KVM VM * Change log level Co-authored-by: GutoVeronezi <daniel@scclouds.com.br>
This commit is contained in:
parent
2215cd7ee3
commit
349120f7c5
@ -270,3 +270,6 @@ iscsi.session.cleanup.enabled=false
|
||||
# This parameter specifies the heartbeat update timeout in ms; The default value is 60000ms (1 min).
|
||||
# Depending on the use case, this timeout might need increasing/decreasing.
|
||||
# heartbeat.update.timeout=60000
|
||||
|
||||
# Enable manually setting CPU's topology on KVM's VM.
|
||||
# enable.manually.setting.cpu.topology.on.kvm.vm=true
|
||||
|
||||
@ -32,6 +32,13 @@ public class AgentProperties{
|
||||
*/
|
||||
public static final Property<Integer> HEARTBEAT_UPDATE_TIMEOUT = new Property<Integer>("heartbeat.update.timeout", 60000);
|
||||
|
||||
/**
|
||||
* Enable manually setting CPU's topology on KVM's VM. <br>
|
||||
* Data type: boolean.<br>
|
||||
* Default value: true.
|
||||
*/
|
||||
public static final Property<Boolean> ENABLE_MANUALLY_SETTING_CPU_TOPOLOGY_ON_KVM_VM = new Property<Boolean>("enable.manually.setting.cpu.topology.on.kvm.vm", true);
|
||||
|
||||
public static class Property <T>{
|
||||
private final String name;
|
||||
private final T defaultValue;
|
||||
|
||||
@ -109,6 +109,8 @@ import com.cloud.agent.api.to.NfsTO;
|
||||
import com.cloud.agent.api.to.NicTO;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
import com.cloud.agent.dao.impl.PropertiesStorage;
|
||||
import com.cloud.agent.properties.AgentProperties;
|
||||
import com.cloud.agent.properties.AgentPropertiesFileHandler;
|
||||
import com.cloud.agent.resource.virtualnetwork.VRScripts;
|
||||
import com.cloud.agent.resource.virtualnetwork.VirtualRouterDeployer;
|
||||
import com.cloud.agent.resource.virtualnetwork.VirtualRoutingResource;
|
||||
@ -411,6 +413,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
protected MemStat _memStat = new MemStat(_dom0MinMem, _dom0OvercommitMem);
|
||||
private final LibvirtUtilitiesHelper libvirtUtilitiesHelper = new LibvirtUtilitiesHelper();
|
||||
|
||||
protected Boolean enableManuallySettingCpuTopologyOnKvmVm = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.ENABLE_MANUALLY_SETTING_CPU_TOPOLOGY_ON_KVM_VM);
|
||||
|
||||
protected long getHypervisorLibvirtVersion() {
|
||||
return _hypervisorLibvirtVersion;
|
||||
}
|
||||
@ -4502,6 +4506,11 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
}
|
||||
|
||||
private void setCpuTopology(CpuModeDef cmd, int vcpus, Map<String, String> details) {
|
||||
if (!enableManuallySettingCpuTopologyOnKvmVm) {
|
||||
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}.",
|
||||
AgentProperties.ENABLE_MANUALLY_SETTING_CPU_TOPOLOGY_ON_KVM_VM.getName(), enableManuallySettingCpuTopologyOnKvmVm));
|
||||
return;
|
||||
}
|
||||
// multi cores per socket, for larger core configs
|
||||
int numCoresPerSocket = -1;
|
||||
if (details != null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user