Commit 268c2e46 authored by Anael Beutot's avatar Anael Beutot Committed by Antoine Millet
Browse files

Add autostart for hot migration

parent b9ad9725
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -60,6 +60,8 @@ class HotMigrationJob(BaseJob):
            self.logger.info('Job-%s: Locks acquired', self['id'])
            self.checkpoint()

            before_clone_autostart = vm['autostart'].lower() == 'yes'

            if not self._check_status(vm_id, 'running'):
                raise JobCancelError('vm is not started')

@@ -130,6 +132,10 @@ class HotMigrationJob(BaseJob):

                source.proxy.vol_delete(pool, name)

            # Setup autostart as it was before the migration
            dest.proxy.vm_set_autostart(self['vm_name'],
                                        before_clone_autostart)

            self.logger.info('Job-%s: Migration completed with success', self['id'])