def finish_revert_migration(self, context, instance, network_info, block_device_info=None, power_on=True):
    LOG.debug('Starting finish_revert_migration', instance=instance)
    inst_base = libvirt_utils.get_instance_path(instance)
    inst_base_resize = (inst_base + '_resize')
    if os.path.exists(inst_base_resize):
        self._cleanup_failed_migration(inst_base)
        utils.execute('mv', inst_base_resize, inst_base)
    disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type, instance, block_device_info)
    xml = self._get_guest_xml(context, instance, network_info, disk_info, block_device_info=block_device_info)
    self._create_domain_and_network(context, xml, instance, network_info, block_device_info, power_on)
    if power_on:
        timer = loopingcall.FixedIntervalLoopingCall(self._wait_for_running, instance)
        timer.start(interval=0.5).wait()
def finish_revert_migration(self, context, instance, network_info, block_device_info=None, power_on=True):
    LOG.debug('Starting finish_revert_migration', instance=instance)
    inst_base = libvirt_utils.get_instance_path(instance)
    inst_base_resize = (inst_base + '_resize')
    if os.path.exists(inst_base_resize):
        self._cleanup_failed_migration(inst_base)
        utils.execute('mv', inst_base_resize, inst_base)
    disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type, instance, block_device_info)
    xml = self._get_guest_xml(context, instance, network_info, disk_info, block_device_info=block_device_info)
    self._create_domain_and_network(context, xml, instance, network_info, block_device_info, power_on)
    if power_on:
        timer = loopingcall.FixedIntervalLoopingCall(self._wait_for_running, instance)
        timer.start(interval=0.5).wait()