Set state back to start in both migrate fail cases

This commit is contained in:
Joshua Boniface 2018-06-02 15:46:20 -04:00
parent a155eb5fab
commit 76e99b6e87
1 changed files with 3 additions and 2 deletions

View File

@ -81,8 +81,8 @@ class VMInstance:
if dest_conn == None: if dest_conn == None:
raise raise
except: except:
self.zk.set(self.zkey + '/state', 'start'.encode('ascii'))
print('Failed to open connection to qemu+ssh://%s/system' % target) print('Failed to open connection to qemu+ssh://%s/system' % target)
self.zk.set(self.zkey + '/state', 'start'.encode('ascii'))
return return
try: try:
@ -90,7 +90,8 @@ class VMInstance:
if target_dom == None: if target_dom == None:
raise raise
except: except:
print('Could not migrate to the new domain') print('Could not migrate to the new domain; forcing away uncleanly')
self.zk.set(self.zkey + '/state', 'start'.encode('ascii'))
self.stop_vm() self.stop_vm()
self.thishypervisor.domain_list.remove(self.domuuid) self.thishypervisor.domain_list.remove(self.domuuid)