Todo
rework after iSCSI merge (see ‘Old Docs’) (todd or vish)
Volume manager manages creating, attaching, detaching, and persistent storage.
Persistent storage volumes keep their state independent of instances. You can attach to an instance, terminate the instance, spawn a new instance (even one from a different image) and re-attach the volume with the same data intact.
Related Flags
volume_topic: | What rpc topic to listen to (default: cinder-volume). |
---|---|
volume_manager: | The module name of a class derived from manager.Manager (default: cinder.volume.manager.Manager). |
volume_driver: | Used by Manager. Defaults to cinder.volume.drivers.lvm.LVMISCSIDriver. |
volume_group: | Name of the group that will contain exported volumes (default: cinder-volumes) |
num_shell_tries: | |
Number of times to attempt to run commands (default: 3) |
Bases: cinder.manager.SchedulerDependentManager
Manages attachable block storage devices.
Updates db to show volume is attached.
Uploads the specified volume to Glance.
image_meta is a dictionary containing the following keys: ‘id’, ‘container_format’, ‘disk_format’
Creates and exports the snapshot.
Creates the volume.
Do any initialization that needs to be run if this is a standalone service.
Prepare volume for connection from host represented by connector.
This method calls the driver initialize_connection and returns it to the caller. The connector parameter is a dictionary with information about the host that will connect to the volume in the following format:
{
'ip': ip,
'initiator': initiator,
}
ip: the ip address of the connecting machine
initiator: the iscsi initiator name of the connecting machine. This can be None if the connecting machine does not support iscsi connections.
driver is responsible for doing any necessary security setup and returning a connection_info dictionary in the following format:
{
'driver_volume_type': driver_volume_type,
'data': data,
}
Migrate the volume to the specified host (called on source host).
Collect driver status and then publish.
Cleanup connection from host represented by connector.
The format of connector is the same as for initialize_connection.
Lock decorator for snapshot operations.
Takes a named lock prior to executing the operation. The lock is named with the operation executed and the id of the snapshot. This lock can then be used by other operations to avoid operation conflicts on shared snapshots.
Example use:
If a snapshot operation uses this decorator, it will block until the named lock is free. This is used to protect concurrent operations on the same snapshot e.g. delete SnapA while create volume VolA from SnapA is in progress.
Lock decorator for volume operations.
Takes a named lock prior to executing the operation. The lock is named with the operation executed and the id of the volume. This lock can then be used by other operations to avoid operation conflicts on shared volumes.
Example use:
If a volume operation uses this decorator, it will block until the named lock is free. This is used to protect concurrent operations on the same volume e.g. delete VolA while create volume VolB from VolA is in progress.
Drivers for volumes.
Bases: cinder.volume.driver.ISCSIDriver
Logs calls instead of executing.
No setup necessary in fake mode.
Execute that simply logs the command.
Bases: cinder.volume.driver.FakeISCSIDriver
Logs calls instead of executing.
Execute that simply logs the command.
Bases: cinder.volume.driver.VolumeDriver
Executes commands relating to Fibre Channel volumes.
Initializes the connection and returns connection info.
The driver returns a driver_volume_type of ‘fibre_channel’. The target_wwn can be a single entry or a list of wwns that correspond to the list of remote wwn(s) that will export the volume. Example return values:
- {
‘driver_volume_type’: ‘fibre_channel’ ‘data’: {
‘target_discovered’: True, ‘target_lun’: 1, ‘target_wwn’: ‘1234567890123’, ‘access_mode’: ‘rw’}
}
or
- {
‘driver_volume_type’: ‘fibre_channel’ ‘data’: {
‘target_discovered’: True, ‘target_lun’: 1, ‘target_wwn’: [‘1234567890123’, ‘0987654321321’], ‘access_mode’: ‘rw’}
}
Bases: cinder.volume.driver.VolumeDriver
Executes commands relating to ISCSI volumes.
We make use of model provider properties as follows:
Get volume stats.
If ‘refresh’ is True, run update the stats first.
Initializes the connection and returns connection info.
The iscsi driver returns a driver_volume_type of ‘iscsi’. The format of the driver data is defined in _get_iscsi_properties. Example return value:
{
'driver_volume_type': 'iscsi'
'data': {
'target_discovered': True,
'target_iqn': 'iqn.2010-10.org.openstack:volume-00000001',
'target_portal': '127.0.0.0.1:3260',
'volume_id': 1,
'access_mode': 'rw'
}
}
Bases: cinder.volume.driver.ISCSIDriver
Executes commands relating to ISER volumes.
We make use of model provider properties as follows:
Initializes the connection and returns connection info.
The iser driver returns a driver_volume_type of ‘iser’. The format of the driver data is defined in _get_iser_properties. Example return value:
{
'driver_volume_type': 'iser'
'data': {
'target_discovered': True,
'target_iqn':
'iqn.2010-10.org.iser.openstack:volume-00000001',
'target_portal': '127.0.0.0.1:3260',
'volume_id': 1,
}
}
Bases: object
Executes commands relating to Volumes.
Accept the transfer of a volume for a new user/project.
Callback for volume attached to instance or host.
Create a new backup from an existing volume.
Clean up after an interrupted image copy.
Create a volume efficiently from an existing image.
image_location is a string whose format depends on the image service backend in use. The driver should use it to determine whether cloning is possible.
image_id is a string which represents id of the image. It can be used by the driver to introspect internal stores or registry to do an efficient image clone.
image_meta is a dictionary that includes ‘disk_format’ (e.g. raw, qcow2) and other image attributes that allow drivers to decide whether they can clone the image without first requiring conversion.
Returns a dict of volume properties eg. provider_location, boolean indicating whether cloning occurred
Fetch the image from image_service and write it to the volume.
Copy data from src_vol to dest_vol.
Copy the volume to the specified image.
Creates a clone of the specified volume.
Exports the volume. Can optionally return a Dictionary of changes to the volume object to be persisted.
Creates a snapshot.
Creates a volume. Can optionally return a Dictionary of changes to the volume object to be persisted.
Creates a volume from a snapshot.
Deletes a snapshot.
Deletes a volume.
Callback for volume detached.
Any initialization the volume driver does while starting.
Synchronously recreates an export for a volume.
Get the current version of this driver.
Return the current state of the volume service. If ‘refresh’ is True, run the update first.
Allow connection to connector and return connection info.
Brings an existing backend storage object under Cinder management.
existing_ref is passed straight through from the API request’s manage_existing_ref value, and it is up to the driver how this should be interpreted. It should be sufficient to identify a storage object that the driver should somehow associate with the newly-created cinder volume structure.
There are two ways to do this:
If the existing_ref doesn’t make sense, or doesn’t refer to an existing backend storage object, raise a ManageExistingInvalidReference exception.
The volume may have a volume_type, and the driver can inspect that and compare against the properties of the referenced backend storage object. If they are incompatible, raise a ManageExistingVolumeTypeMismatch, specifying a reason for the failure.
Return size of volume to be managed by manage_existing.
When calculating the size, round up to the next GB.
Migrate the volume to the specified host.
Returns a boolean indicating whether the migration occurred, as well as model_update.
Parameters: |
|
---|
Removes an export for a volume.
Restore an existing backup to a new or existing volume.
Convert the volume to be of the new type.
Returns a boolean indicating whether the retype occurred.
Parameters: |
|
---|
Disallow connection from connector
Removes the specified volume from Cinder management.
Does not delete the underlying backend storage object.
For most drivers, this will not need to do anything. However, some drivers might use this call as an opportunity to clean up any Cinder-specific configuration that they have associated with the backend storage object.
Fail if connector doesn’t contain all the data needed by driver.
Cinder uses iSCSI to export storage volumes from multiple storage nodes. These iSCSI exports are attached (using libvirt) directly to running instances.
Cinder volumes are exported over the primary system VLAN (usually VLAN 1), and not over individual VLANs.
The underlying volumes by default are LVM logical volumes, created on demand within a single large volume group.