diff --git a/VMInstance.py b/VMInstance.py index 796a6ceb..6f499674 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -213,6 +213,10 @@ class VMInstance: if running == libvirt.VIR_DOMAIN_RUNNING and self.state == "stop" and self.hypervisor == self.thishypervisor.name and self.instop == False: self.stop_vm() + # We got no state, so the VM is deleted and should be stopped + elif running == libvirt.VIR_DOMAIN_NOSTATE: + self.stop_vm() + # VM should be shut down elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "shutdown" and self.hypervisor == self.thishypervisor.name and self.inshutdown == False: self.shutdown_vm()