mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
agent: Only probe running VMs for the current Hypervisor Type
Otherwise we try to probe for LXC VMs on a KVM hypervisor and vise versa.
This commit is contained in:
parent
5b902c7005
commit
322db71eed
@ -84,6 +84,11 @@ domr.scripts.dir=scripts/network/domr/kvm
|
||||
# set the hypervisor type, values are: kvm, lxc
|
||||
# hypervisor.type=kvm
|
||||
|
||||
# set the hypervisor URI. Usually there is no need for changing this
|
||||
# For KVM: qemu:///system
|
||||
# For LXC: lxc:///
|
||||
# hypervisor.uri=qemu:///system
|
||||
|
||||
# settings to enable direct networking in libvirt, should not be used
|
||||
# on hosts that run system vms, values for mode are: private, bridge, vepa
|
||||
# libvirt.vif.driver=com.cloud.hypervisor.kvm.resource.DirectVifDriver
|
||||
|
||||
@ -3943,18 +3943,22 @@ ServerResource {
|
||||
final HashMap<String, State> vmStates = new HashMap<String, State>();
|
||||
Connect conn = null;
|
||||
|
||||
try {
|
||||
conn = LibvirtConnection.getConnectionByType(HypervisorType.LXC.toString());
|
||||
vmStates.putAll(getAllVms(conn));
|
||||
} catch (LibvirtException e) {
|
||||
s_logger.debug("Failed to get connection: " + e.getMessage());
|
||||
if (_hypervisorType == HypervisorType.LXC) {
|
||||
try {
|
||||
conn = LibvirtConnection.getConnectionByType(HypervisorType.LXC.toString());
|
||||
vmStates.putAll(getAllVms(conn));
|
||||
} catch (LibvirtException e) {
|
||||
s_logger.debug("Failed to get connection: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
conn = LibvirtConnection.getConnectionByType(HypervisorType.KVM.toString());
|
||||
vmStates.putAll(getAllVms(conn));
|
||||
} catch (LibvirtException e) {
|
||||
s_logger.debug("Failed to get connection: " + e.getMessage());
|
||||
if (_hypervisorType == HypervisorType.KVM) {
|
||||
try {
|
||||
conn = LibvirtConnection.getConnectionByType(HypervisorType.KVM.toString());
|
||||
vmStates.putAll(getAllVms(conn));
|
||||
} catch (LibvirtException e) {
|
||||
s_logger.debug("Failed to get connection: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
return vmStates;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user