def finish_migration(self, context, migration, instance, disk_info, network_info, image_meta, resize_instance, block_device_info=None, power_on=True):
    LOG.debug('Starting finish_migration', instance=instance)
    disk_info = jsonutils.loads(disk_info)
    for info in disk_info:
        size = self._disk_size_from_instance(instance, info)
        self._disk_resize(info, size)
    disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type, instance, block_device_info, image_meta)
    self._create_image(context, instance, disk_mapping=disk_info['mapping'], network_info=network_info, block_device_info=None, inject_files=False)
    xml = self._get_guest_xml(context, instance, network_info, disk_info, block_device_info=block_device_info, write_to_disk=True)
    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_migration(self, context, migration, instance, disk_info, network_info, image_meta, resize_instance, block_device_info=None, power_on=True):
    LOG.debug('Starting finish_migration', instance=instance)
    disk_info = jsonutils.loads(disk_info)
    for info in disk_info:
        size = self._disk_size_from_instance(instance, info)
        self._disk_resize(info, size)
    disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type, instance, block_device_info, image_meta)
    self._create_image(context, instance, disk_mapping=disk_info['mapping'], network_info=network_info, block_device_info=None, inject_files=False)
    xml = self._get_guest_xml(context, instance, network_info, disk_info, block_device_info=block_device_info, write_to_disk=True)
    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()