The nova.virt.libvirt.imagebackend Module

class Backend(use_cow)

Bases: object

backend(image_type=None)
image(instance, disk_name, image_type=None)

Constructs image for selected backend

Instance :Instance name.
Name :Image name.
Image_type :Image type.

Optional, is CONF.libvirt_images_type by default.

snapshot(disk_path, snapshot_name, image_type=None)

Returns snapshot for given image

Path :path to image
Snapshot_name :snapshot name
Image_type :type of image
class Image(source_type, driver_format, is_block_dev=False)

Bases: object

cache(fetch_func, filename, size=None, *args, **kwargs)

Creates image from template.

Ensures that template and image not already exists. Ensures that base directory exists. Synchronizes on template fetching.

Fetch_func :Function that creates the base image Should accept target argument.
Filename :Name of the file in the image directory
Size :Size of created image in bytes (optional)
create_image(prepare_template, base, size, *args, **kwargs)

Create image from template.

Contains specific behavior for each image type.

Prepare_template :
 function, that creates template.

Should accept target argument. :base: Template name :size: Size of created image in bytes

libvirt_info(disk_bus, disk_dev, device_type, cache_mode, extra_specs)

Get LibvirtConfigGuestDisk filled for this image.

Disk_dev :Disk bus device name
Disk_bus :Disk bus type
Device_type :Device type for this image.
Cache_mode :Caching mode for this image
Extra_specs :Instance type extra specs dict.
snapshot_create()
snapshot_delete()
snapshot_extract(target, out_format)
class Lvm(instance=None, disk_name=None, path=None, snapshot_name=None)

Bases: nova.virt.libvirt.imagebackend.Image

create_image(prepare_template, base, size, *args, **kwargs)
static escape(filename)
remove_volume_on_error(*args, **kwds)
snapshot_create()
snapshot_delete()
snapshot_extract(target, out_format)
class Qcow2(instance=None, disk_name=None, path=None, snapshot_name=None)

Bases: nova.virt.libvirt.imagebackend.Image

create_image(prepare_template, base, size, *args, **kwargs)
snapshot_create()
snapshot_delete()
snapshot_extract(target, out_format)
class Raw(instance=None, disk_name=None, path=None, snapshot_name=None)

Bases: nova.virt.libvirt.imagebackend.Image

correct_format()
create_image(prepare_template, base, size, *args, **kwargs)
snapshot_create()
snapshot_delete()
snapshot_extract(target, out_format)

Previous topic

The nova.virt.libvirt.firewall Module

Next topic

The nova.virt.libvirt.imagecache Module

This Page