diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java b/core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java index 2927a1388b3..59c4e45a867 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java +++ b/core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java @@ -36,7 +36,7 @@ public class XenServerPoolVms { public State getState(String clusterId, String name){ HashMap> vms = getClusterVmState(clusterId); Pair pv = vms.get(name); - return pv.second(); + return pv == null ? State.Stopped : pv.second(); // if a VM is absent on the cluster, it is effectively in stopped state. } public void put(String clusterId, String hostUuid, String name, State state){