def rescue(self, context, instance, network_info, image_meta, rescue_password):
    'Loads a VM using rescue images.\n\n        A rescue is normally performed when something goes wrong with the\n        primary images and data needs to be corrected/recovered. Rescuing\n        should not edit or over-ride the original image, only allow for\n        data recovery.\n\n        '
    instance_dir = libvirt_utils.get_instance_path(instance)
    unrescue_xml = self._get_existing_domain_xml(instance, network_info)
    unrescue_xml_path = os.path.join(instance_dir, 'unrescue.xml')
    libvirt_utils.write_to_file(unrescue_xml_path, unrescue_xml)
    if (image_meta is not None):
        rescue_image_id = image_meta.get('id')
    else:
        rescue_image_id = None
    rescue_images = {'image_id': (rescue_image_id or CONF.libvirt.rescue_image_id or instance.image_ref), 'kernel_id': (CONF.libvirt.rescue_kernel_id or instance.kernel_id), 'ramdisk_id': (CONF.libvirt.rescue_ramdisk_id or instance.ramdisk_id)}
    disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type, instance, None, image_meta, rescue=True)
    self._create_image(context, instance, disk_info['mapping'], '.rescue', rescue_images, network_info=network_info, admin_pass=rescue_password)
    xml = self._get_guest_xml(context, instance, network_info, disk_info, image_meta, rescue=rescue_images, write_to_disk=True)
    self._destroy(instance)
    self._create_domain(xml)
Loads a VM using rescue images.

A rescue is normally performed when something goes wrong with the
primary images and data needs to be corrected/recovered. Rescuing
should not edit or over-ride the original image, only allow for
data recovery.
def rescue(self, context, instance, network_info, image_meta, rescue_password):
    'Loads a VM using rescue images.\n\n        A rescue is normally performed when something goes wrong with the\n        primary images and data needs to be corrected/recovered. Rescuing\n        should not edit or over-ride the original image, only allow for\n        data recovery.\n\n        '
    instance_dir = libvirt_utils.get_instance_path(instance)
    unrescue_xml = self._get_existing_domain_xml(instance, network_info)
    unrescue_xml_path = os.path.join(instance_dir, 'unrescue.xml')
    libvirt_utils.write_to_file(unrescue_xml_path, unrescue_xml)
    if (image_meta is not None):
        rescue_image_id = image_meta.get('id')
    else:
        rescue_image_id = None
    rescue_images = {'image_id': (rescue_image_id or CONF.libvirt.rescue_image_id or instance.image_ref), 'kernel_id': (CONF.libvirt.rescue_kernel_id or instance.kernel_id), 'ramdisk_id': (CONF.libvirt.rescue_ramdisk_id or instance.ramdisk_id)}
    disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type, instance, None, image_meta, rescue=True)
    self._create_image(context, instance, disk_info['mapping'], '.rescue', rescue_images, network_info=network_info, admin_pass=rescue_password)
    xml = self._get_guest_xml(context, instance, network_info, disk_info, image_meta, rescue=rescue_images, write_to_disk=True)
    self._destroy(instance)
    self._create_domain(xml)