Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions agent/conf/agent.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -4502,6 +4506,11 @@ public boolean isSecureMode(String bootMode) {
}

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) {
Expand Down