Handle stopping the VM when its ZK config is deleted or it shouldn't be running
This commit is contained in:
parent
dc661a8ea8
commit
5edb5d1e77
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue