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
|
# set the hypervisor type, values are: kvm, lxc
|
||||||
# hypervisor.type=kvm
|
# 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
|
# settings to enable direct networking in libvirt, should not be used
|
||||||
# on hosts that run system vms, values for mode are: private, bridge, vepa
|
# on hosts that run system vms, values for mode are: private, bridge, vepa
|
||||||
# libvirt.vif.driver=com.cloud.hypervisor.kvm.resource.DirectVifDriver
|
# libvirt.vif.driver=com.cloud.hypervisor.kvm.resource.DirectVifDriver
|
||||||
|
|||||||
@ -3943,18 +3943,22 @@ ServerResource {
|
|||||||
final HashMap<String, State> vmStates = new HashMap<String, State>();
|
final HashMap<String, State> vmStates = new HashMap<String, State>();
|
||||||
Connect conn = null;
|
Connect conn = null;
|
||||||
|
|
||||||
try {
|
if (_hypervisorType == HypervisorType.LXC) {
|
||||||
conn = LibvirtConnection.getConnectionByType(HypervisorType.LXC.toString());
|
try {
|
||||||
vmStates.putAll(getAllVms(conn));
|
conn = LibvirtConnection.getConnectionByType(HypervisorType.LXC.toString());
|
||||||
} catch (LibvirtException e) {
|
vmStates.putAll(getAllVms(conn));
|
||||||
s_logger.debug("Failed to get connection: " + e.getMessage());
|
} catch (LibvirtException e) {
|
||||||
|
s_logger.debug("Failed to get connection: " + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (_hypervisorType == HypervisorType.KVM) {
|
||||||
conn = LibvirtConnection.getConnectionByType(HypervisorType.KVM.toString());
|
try {
|
||||||
vmStates.putAll(getAllVms(conn));
|
conn = LibvirtConnection.getConnectionByType(HypervisorType.KVM.toString());
|
||||||
} catch (LibvirtException e) {
|
vmStates.putAll(getAllVms(conn));
|
||||||
s_logger.debug("Failed to get connection: " + e.getMessage());
|
} catch (LibvirtException e) {
|
||||||
|
s_logger.debug("Failed to get connection: " + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return vmStates;
|
return vmStates;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user