The nova.volume.manager Module

Volume manager manages creating, attaching, detaching, and persistent storage.

Persistant 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: volume).
volume_manager:The module name of a class derived from manager.Manager (default: nova.volume.manager.Manager).
storage_availability_zone:
 Defaults to nova.
volume_driver:Used by Manager. Defaults to nova.volume.driver.ISCSIDriver.
volume_group:Name of the group that will contain exported volumes (default: nova-volumes)
num_shell_tries:
 Number of times to attempt to run commands (default: 3)
class VolumeManager(volume_driver=None, *args, **kwargs)

Bases: nova.manager.SchedulerDependentManager

Manages attachable block storage devices.

attach_volume(context, volume_id, instance_uuid, mountpoint)

Updates db to show volume is attached

check_for_export(context, instance_id)

Make sure whether volume is exported.

create_snapshot(context, volume_id, snapshot_id)

Creates and exports the snapshot.

create_volume(context, volume_id, snapshot_id=None, reservations=None)

Creates and exports the volume.

delete_snapshot(context, snapshot_id)

Deletes and unexports snapshot.

delete_volume(context, volume_id)

Deletes and unexports volume.

detach_volume(context, volume_id)

Updates db to show volume is detached

init_host()

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

initialize_connection(context, volume_id, connector)

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.
notification(context, event)
terminate_connection(context, volume_id, connector)

Cleanup connection from host represented by connector.

The format of connector is the same as for initialize_connection.

Previous topic

The nova.volume.iscsi Module

Next topic

The nova.volume.netapp Module

This Page