mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Prioritize hypervisor.uri configuration (#8254)
Co-authored-by: Henrique Sato <henrique.sato@scclouds.com.br>
This commit is contained in:
parent
14376ce298
commit
fdfbb4fad1
@ -1004,10 +1004,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
|||||||
rollingMaintenanceExecutor = BooleanUtils.isTrue(AgentPropertiesFileHandler.getPropertyValue(AgentProperties.ROLLING_MAINTENANCE_SERVICE_EXECUTOR_DISABLED)) ? new RollingMaintenanceAgentExecutor(hooksDir) :
|
rollingMaintenanceExecutor = BooleanUtils.isTrue(AgentPropertiesFileHandler.getPropertyValue(AgentProperties.ROLLING_MAINTENANCE_SERVICE_EXECUTOR_DISABLED)) ? new RollingMaintenanceAgentExecutor(hooksDir) :
|
||||||
new RollingMaintenanceServiceExecutor(hooksDir);
|
new RollingMaintenanceServiceExecutor(hooksDir);
|
||||||
|
|
||||||
hypervisorURI = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.HYPERVISOR_URI);
|
|
||||||
if (hypervisorURI == null) {
|
|
||||||
hypervisorURI = LibvirtConnection.getHypervisorURI(hypervisorType.toString());
|
hypervisorURI = LibvirtConnection.getHypervisorURI(hypervisorType.toString());
|
||||||
}
|
|
||||||
|
|
||||||
networkDirectSourceMode = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.NETWORK_DIRECT_SOURCE_MODE);
|
networkDirectSourceMode = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.NETWORK_DIRECT_SOURCE_MODE);
|
||||||
networkDirectDevice = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.NETWORK_DIRECT_DEVICE);
|
networkDirectDevice = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.NETWORK_DIRECT_DEVICE);
|
||||||
|
|||||||
@ -19,6 +19,8 @@ package com.cloud.hypervisor.kvm.resource;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.cloud.agent.properties.AgentProperties;
|
||||||
|
import com.cloud.agent.properties.AgentPropertiesFileHandler;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.libvirt.Connect;
|
import org.libvirt.Connect;
|
||||||
import org.libvirt.LibvirtException;
|
import org.libvirt.LibvirtException;
|
||||||
@ -88,10 +90,15 @@ public class LibvirtConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static String getHypervisorURI(String hypervisorType) {
|
static String getHypervisorURI(String hypervisorType) {
|
||||||
|
String uri = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.HYPERVISOR_URI);
|
||||||
|
if (uri != null) {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
if ("LXC".equalsIgnoreCase(hypervisorType)) {
|
if ("LXC".equalsIgnoreCase(hypervisorType)) {
|
||||||
return "lxc:///";
|
return "lxc:///";
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return "qemu:///system";
|
return "qemu:///system";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user