'Snapshot an instance without downtime.'

def _live_snapshot(self, context, instance, guest, disk_path, out_path, source_format, image_format, image_meta):

    dev = guest.get_block_device(disk_path)
    xml = guest.get_xml_desc(dump_inactive=True, dump_sensitive=True)
    try:
        dev.abort_job()
    except Exception:
        pass
    src_disk_size = libvirt_utils.get_disk_size(disk_path, format=source_format)
    src_back_path = libvirt_utils.get_disk_backing_file(disk_path, format=source_format, basename=False)
    disk_delta = (out_path + '.delta')
    libvirt_utils.create_cow_image(src_back_path, disk_delta, src_disk_size)
    quiesced = False
    try:
        self._set_quiesced(context, instance, image_meta, True)
        quiesced = True
    except exception.NovaException as err:
        if self._requires_quiesce(image_meta):
            raise
        LOG.info('Skipping    quiescing    instance:    %(reason)s.', {'reason': err}, instance=instance)
    try:
        if guest.has_persistent_configuration():
            support_uefi = self._has_uefi_support()
            guest.delete_configuration(support_uefi)
        dev.rebase(disk_delta, copy=True, reuse_ext=True, shallow=True)
        while (not dev.is_job_complete()):
            time.sleep(0.5)
        dev.abort_job()
        libvirt_utils.chown(disk_delta, os.getuid())
    finally:
        self._host.write_instance_config(xml)
        if quiesced:
            self._set_quiesced(context, instance, image_meta, False)
    libvirt_utils.extract_snapshot(disk_delta, 'qcow2', out_path, image_format)
