Loading ccserver/jobs.py +10 −12 Original line number Diff line number Diff line Loading @@ -414,7 +414,7 @@ class ColdMigrationJob(BaseMigrationJob): msg = 'error while copy: %s' % msg['error']['message'] raise JobCancelError(msg) else: checksums.append(msg.get('checksum')) checksums.append(msg['return'].get('checksum')) self.checkpoint() if checksums[0] != checksums[1]: Loading Loading @@ -457,20 +457,18 @@ class HotMigrationJob(BaseMigrationJob): raise JobCancelError('author have no right to migrate to this hv') # Update the VM object: try: self.manager.server.objects.update(ids=(vm_id,)) vm = self.manager.server.objects.get_by_id(vm_id).to_dict(None) except UnknownObjectError: vm = self.manager.server.db.get_by_id(vm_id) if vm is None: raise JobCancelError('Source VM not found') # Get the source and destination hv clients: try: source = self.manager.server.get_connection(self['hv_source']) source = self.manager.server.get_client(self['hv_source']) except KeyError: raise JobCancelError('source hypervisor is not connected') try: dest = self.manager.server.get_connection(self['hv_dest']) dest = self.manager.server.get_client(self['hv_dest']) except KeyError: raise JobCancelError('destination hypervisor is not connected') Loading @@ -479,7 +477,7 @@ class HotMigrationJob(BaseMigrationJob): self.report('waiting lock for source and dest hypervisors') logging.info('Job-%s: Trying to acquire locks', self['id']) with AcquiresAllOrNone(source.lock, dest.lock): with AcquiresAllOrNone(source.hvlock, dest.hvlock): logging.info('Job-%s: Locks acquired', self['id']) self.checkpoint() Loading @@ -504,7 +502,7 @@ class HotMigrationJob(BaseMigrationJob): dest.proxy.tun_destroy(tunres_dst) self.checkpoint(rb_tun_dst) source.proxy.tun_connect(tunres_src, tunres_dst, dest.get_ip()) source.proxy.tun_connect(tunres_src, tunres_dst, dest.ip) dest.proxy.tun_connect_hv(tunres_dst, migration=False) # Migration tunnel setup: Loading @@ -518,7 +516,7 @@ class HotMigrationJob(BaseMigrationJob): dest.proxy.tun_destroy(migtunres_dst) self.checkpoint(rb_migtun_dst) source.proxy.tun_connect(migtunres_src, migtunres_dst, dest.get_ip()) source.proxy.tun_connect(migtunres_src, migtunres_dst, dest.ip) dest.proxy.tun_connect_hv(migtunres_dst, migration=True) # Initiate the live migration: Loading Loading @@ -598,8 +596,8 @@ class HotMigrationJob(BaseMigrationJob): # start connection of drbd: self.report(status_msg % 'connect') source.proxy.drbd_connect(res_src, res_dst, dest.get_ip()) dest.proxy.drbd_connect(res_dst, res_src, source.get_ip()) source.proxy.drbd_connect(res_src, res_dst, dest.ip) dest.proxy.drbd_connect(res_dst, res_src, source.ip) # setup topology as primary/secondary: source.proxy.drbd_role(res_src, True) Loading Loading
ccserver/jobs.py +10 −12 Original line number Diff line number Diff line Loading @@ -414,7 +414,7 @@ class ColdMigrationJob(BaseMigrationJob): msg = 'error while copy: %s' % msg['error']['message'] raise JobCancelError(msg) else: checksums.append(msg.get('checksum')) checksums.append(msg['return'].get('checksum')) self.checkpoint() if checksums[0] != checksums[1]: Loading Loading @@ -457,20 +457,18 @@ class HotMigrationJob(BaseMigrationJob): raise JobCancelError('author have no right to migrate to this hv') # Update the VM object: try: self.manager.server.objects.update(ids=(vm_id,)) vm = self.manager.server.objects.get_by_id(vm_id).to_dict(None) except UnknownObjectError: vm = self.manager.server.db.get_by_id(vm_id) if vm is None: raise JobCancelError('Source VM not found') # Get the source and destination hv clients: try: source = self.manager.server.get_connection(self['hv_source']) source = self.manager.server.get_client(self['hv_source']) except KeyError: raise JobCancelError('source hypervisor is not connected') try: dest = self.manager.server.get_connection(self['hv_dest']) dest = self.manager.server.get_client(self['hv_dest']) except KeyError: raise JobCancelError('destination hypervisor is not connected') Loading @@ -479,7 +477,7 @@ class HotMigrationJob(BaseMigrationJob): self.report('waiting lock for source and dest hypervisors') logging.info('Job-%s: Trying to acquire locks', self['id']) with AcquiresAllOrNone(source.lock, dest.lock): with AcquiresAllOrNone(source.hvlock, dest.hvlock): logging.info('Job-%s: Locks acquired', self['id']) self.checkpoint() Loading @@ -504,7 +502,7 @@ class HotMigrationJob(BaseMigrationJob): dest.proxy.tun_destroy(tunres_dst) self.checkpoint(rb_tun_dst) source.proxy.tun_connect(tunres_src, tunres_dst, dest.get_ip()) source.proxy.tun_connect(tunres_src, tunres_dst, dest.ip) dest.proxy.tun_connect_hv(tunres_dst, migration=False) # Migration tunnel setup: Loading @@ -518,7 +516,7 @@ class HotMigrationJob(BaseMigrationJob): dest.proxy.tun_destroy(migtunres_dst) self.checkpoint(rb_migtun_dst) source.proxy.tun_connect(migtunres_src, migtunres_dst, dest.get_ip()) source.proxy.tun_connect(migtunres_src, migtunres_dst, dest.ip) dest.proxy.tun_connect_hv(migtunres_dst, migration=True) # Initiate the live migration: Loading Loading @@ -598,8 +596,8 @@ class HotMigrationJob(BaseMigrationJob): # start connection of drbd: self.report(status_msg % 'connect') source.proxy.drbd_connect(res_src, res_dst, dest.get_ip()) dest.proxy.drbd_connect(res_dst, res_src, source.get_ip()) source.proxy.drbd_connect(res_src, res_dst, dest.ip) dest.proxy.drbd_connect(res_dst, res_src, source.ip) # setup topology as primary/secondary: source.proxy.drbd_role(res_src, True) Loading