Bases: object
Constructs image for selected backend
Instance: | Instance name. |
---|---|
Name: | Image name. |
Image_type: | Image type. Optional, is CONF.libvirt.images_type by default. |
Returns snapshot for given image
Path: | path to image |
---|---|
Image_type: | type of image |
Bases: object
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) |
Performs any cleanup actions required after calling direct_snapshot(), for graceful exception handling and the like.
This should be a no-op on any backend where it is not implemented.
Clone an image.
Note that clone operation is backend-dependent. The backend may ask the image API for a list of image “locations” and select one or more of those locations to clone an image from.
Parameters: | image_id_or_uri – The ID or URI of an image to clone. |
---|---|
Raises: | exception.ImageUnacceptable if it cannot be cloned |
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 |
Create a snapshot on the image. A noop on backends that don’t support snapshots.
Parameters: | name – name of the snapshot |
---|
Prepare a snapshot for direct reference from glance
Raises: | exception.ImageUnacceptable if it cannot be referenced directly in the specified image format |
---|---|
Returns: | URL to be given to glance |
Get the image information model
Returns: | an instance of nova.virt.image.model.Image |
---|
Import an image from local storage into this backend.
Import a local file into the store used by this image type. Note that this is a noop for stores using local disk (the local file is considered “in the store”).
If the image already exists it will be overridden by the new file
Parameters: |
|
---|
True if the backend stores images in files under instance path.
True if the backend puts images on a shared block storage.
Get LibvirtConfigGuestFilesys filled for this image.
Target: | target directory inside a container. |
---|---|
Driver_type: | filesystem driver type, can be loop nbd or ploop. |
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. |
Hypervisor_version: | |
the hypervisor version |
Remove a snapshot on the image. A noop on backends that don’t support snapshots.
Parameters: |
|
---|
Resize image to size (in bytes).
Size: | Desired size of image in bytes |
---|
Return the driver format for self.path.
First checks self.disk_info_path for an entry. If it’s not there, calls self._get_driver_format(), and then stores the result in self.disk_info_path
Rollback the image to the named snapshot. A noop on backends that don’t support snapshots.
Parameters: | name – name of the snapshot |
---|
Check that the base image is not larger than size. Since images can’t be generally shrunk, enforce this constraint taking account of virtual image size.
Bases: nova.virt.libvirt.imagebackend.Image
Bases: nova.virt.libvirt.imagebackend.Image
Bases: nova.virt.libvirt.imagebackend.Image
Bases: nova.virt.libvirt.imagebackend.Image
Bases: nova.virt.libvirt.imagebackend.Image
Unprotects and destroys the name snapshot.
With also_destroy_volume=True, it will also cleanup/destroy the parent volume. This is useful for cleaning up when the target volume fails to snapshot properly.
Creates an RBD snapshot directly.
Returns the size of the virtual disk in bytes.
The name argument is ignored since this backend already knows its name, and callers may pass a non-existent local file path.
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. |