The cinder.volume.manager Module

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)
class VolumeManager(volume_driver=None, service_name=None, *args, **kwargs)

Bases: cinder.manager.SchedulerDependentManager

Manages attachable block storage devices.

RPC_API_VERSION = '1.11'
accept_transfer(*args, **kwargs)
attach_volume(*args, **kwargs)

Updates db to show volume is attached

copy_volume_to_image(*args, **kwargs)

Uploads the specified volume to Glance.

image_meta is a dictionary containing the following keys: ‘id’, ‘container_format’, ‘disk_format’

create_snapshot(*args, **kwargs)

Creates and exports the snapshot.

create_volume(*args, **kwargs)

Creates and exports the volume.

delete_snapshot(*args, **kwargs)

Deletes and unexports snapshot.

delete_volume(*args, **kwargs)

Deletes and unexports volume.

detach_volume(*args, **kwargs)

Updates db to show volume is detached

extend_volume(*args, **kwargs)
init_host()

Do any initialization that needs to be run if this is a standalone service.

initialize_connection(*args, **kwargs)

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,
}
driver_volume_type: a string to identify the type of volume. This
can be used by the calling code to determine the strategy for connecting to the volume. This could be ‘iscsi’, ‘rbd’, ‘sheepdog’, etc.
data: this is the data that the calling code will use to connect
to the volume. Keep in mind that this will be serialized to json in various places, so it should not contain any non-json data types.
migrate_volume(*args, **kwargs)

Migrate the volume to the specified host (called on source host).

migrate_volume_completion(ctxt, volume_id, new_volume_id, error=False)
notification(context, event)
publish_service_capabilities(context)

Collect driver status and then publish.

terminate_connection(*args, **kwargs)

Cleanup connection from host represented by connector.

The format of connector is the same as for initialize_connection.

Previous topic

The cinder.volume.flows.utils Module

Next topic

The cinder.volume.qos_specs Module

This Page