Switch to TCP mode

This commit is contained in:
Joshua Boniface 2018-06-02 16:15:37 -04:00
parent 915e592f5a
commit 6bc2bf0579
1 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ class VMInstance:
self.zk.set(self.zkey + '/state', 'migrate'.encode('ascii')) self.zk.set(self.zkey + '/state', 'migrate'.encode('ascii'))
try: try:
dest_conn = libvirt.open('qemu+ssh://%s/system' % self.hypervisor) dest_conn = libvirt.open('qemu+tcp://%s/system' % self.hypervisor)
if dest_conn == None: if dest_conn == None:
raise raise
except: except:
@ -104,6 +104,7 @@ class VMInstance:
target_dom = self.dom.migrate(dest_conn, libvirt.VIR_MIGRATE_LIVE, None, None, 0) target_dom = self.dom.migrate(dest_conn, libvirt.VIR_MIGRATE_LIVE, None, None, 0)
if target_dom == None: if target_dom == None:
raise raise
print('Migrated successfully')
except: except:
print('Could not migrate to the new domain; forcing away uncleanly') print('Could not migrate to the new domain; forcing away uncleanly')
self.stop_vm() self.stop_vm()
@ -115,7 +116,6 @@ class VMInstance:
except ValueError: except ValueError:
pass pass
print('Migrated successfully')
dest_conn.close() dest_conn.close()
# Receive the migration from another host (wait until VM is running) # Receive the migration from another host (wait until VM is running)