Remove all the remaining previous_hypervisor cruft
This commit is contained in:
parent
fab402dbbb
commit
df4f80cfb1
|
@ -135,17 +135,13 @@ class VMInstance:
|
||||||
# Migrate the VM to a target host
|
# Migrate the VM to a target host
|
||||||
def migrate_vm(self):
|
def migrate_vm(self):
|
||||||
self.inmigrate = True
|
self.inmigrate = True
|
||||||
this_hypervisor = self.thishypervisor.name
|
|
||||||
new_hypervisor = self.hypervisor
|
|
||||||
previous_hypervisor = self.zk.get(self.zkey + '/formerhypervisor')[0].decode('ascii')
|
|
||||||
|
|
||||||
print('>>> %s - Migrating VM to %s' % (self.domuuid, new_hypervisor))
|
print('>>> %s - Migrating VM to %s' % (self.domuuid, self.hypervisor))
|
||||||
migrate_ret = self.live_migrate_vm(new_hypervisor)
|
migrate_ret = self.live_migrate_vm(self.hypervisor)
|
||||||
if migrate_ret != 0:
|
if migrate_ret != 0:
|
||||||
print('>>> %s - Could not live migrate VM; forcing away uncleanly' % self.domuuid)
|
print('>>> %s - Could not live migrate VM; forcing away' % self.domuuid)
|
||||||
self.stop_vm()
|
self.shutdown_vm()
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
return
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
self.thishypervisor.domain_list.remove(self.domuuid)
|
self.thishypervisor.domain_list.remove(self.domuuid)
|
||||||
|
@ -171,11 +167,6 @@ class VMInstance:
|
||||||
if not self.domuuid in self.thishypervisor.domain_list:
|
if not self.domuuid in self.thishypervisor.domain_list:
|
||||||
self.thishypervisor.domain_list.append(self.domuuid)
|
self.thishypervisor.domain_list.append(self.domuuid)
|
||||||
|
|
||||||
# Reset the former_hypervisor key
|
|
||||||
former_hypervisor = self.zk.get(self.zkey + '/formerhypervisor')
|
|
||||||
if former_hypervisor == self.thishypervisor.name:
|
|
||||||
self.zk.set(self.zkey + '/formerhypervisor', ''.encode('ascii'))
|
|
||||||
|
|
||||||
print('>>> %s - Migrated successfully' % self.domuuid)
|
print('>>> %s - Migrated successfully' % self.domuuid)
|
||||||
self.inreceive = False
|
self.inreceive = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue