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

Set autostart after clone

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

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

            # Create storages on destination:
            old_new_disk_mapping = {} # Mapping between old and new disk names
            names = {}
@@ -120,6 +122,10 @@ class CloneJob(BaseJob):
            for disk, name in names.iteritems():
                self._copy_disk(source, dest, vm, disk, name)

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

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