mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
let KVM only report running VM to workaround the problem when KVM still keeps stopped-VM around in some cases
This commit is contained in:
parent
a8c9238d3d
commit
414b1cbb22
@ -4436,6 +4436,12 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
|||||||
|
|
||||||
s_logger.trace("VM " + dm.getName() + ": powerstate = " + ps + "; vm state=" + state.toString());
|
s_logger.trace("VM " + dm.getName() + ": powerstate = " + ps + "; vm state=" + state.toString());
|
||||||
String vmName = dm.getName();
|
String vmName = dm.getName();
|
||||||
|
|
||||||
|
// TODO : for XS/KVM (host-based resource), we require to remove
|
||||||
|
// VM completely from host, for some reason, KVM seems to still keep
|
||||||
|
// Stopped VM around, to work-around that, reporting only powered-on VM
|
||||||
|
//
|
||||||
|
if (state == PowerState.PowerOn)
|
||||||
vmStates.put(vmName, new HostVmStateReportEntry(state, conn.getHostName(), null));
|
vmStates.put(vmName, new HostVmStateReportEntry(state, conn.getHostName(), null));
|
||||||
} catch (final LibvirtException e) {
|
} catch (final LibvirtException e) {
|
||||||
s_logger.warn("Unable to get vms", e);
|
s_logger.warn("Unable to get vms", e);
|
||||||
@ -4460,6 +4466,11 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
|||||||
String vmName = dm.getName();
|
String vmName = dm.getName();
|
||||||
s_logger.trace("VM " + vmName + ": powerstate = " + ps + "; vm state=" + state.toString());
|
s_logger.trace("VM " + vmName + ": powerstate = " + ps + "; vm state=" + state.toString());
|
||||||
|
|
||||||
|
// TODO : for XS/KVM (host-based resource), we require to remove
|
||||||
|
// VM completely from host, for some reason, KVM seems to still keep
|
||||||
|
// Stopped VM around, to work-around that, reporting only powered-on VM
|
||||||
|
//
|
||||||
|
if (state == PowerState.PowerOn)
|
||||||
vmStates.put(vmName, new HostVmStateReportEntry(state, conn.getHostName(), null));
|
vmStates.put(vmName, new HostVmStateReportEntry(state, conn.getHostName(), null));
|
||||||
} catch (final LibvirtException e) {
|
} catch (final LibvirtException e) {
|
||||||
s_logger.warn("Unable to get vms", e);
|
s_logger.warn("Unable to get vms", e);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user