cinder.volume.rpcapi module

class VolumeAPI

Bases: RPCAPI

Client side of the volume rpc API.

API version history:

1.0 - Initial version.
1.1 - Adds clone volume option to create_volume.
1.2 - Add publish_service_capabilities() method.
1.3 - Pass all image metadata (not just ID) in copy_volume_to_image.
1.4 - Add request_spec, filter_properties and
      allow_reschedule arguments to create_volume().
1.5 - Add accept_transfer.
1.6 - Add extend_volume.
1.7 - Adds host_name parameter to attach_volume()
      to allow attaching to host rather than instance.
1.8 - Add migrate_volume, rename_volume.
1.9 - Add new_user and new_project to accept_transfer.
1.10 - Add migrate_volume_completion, remove rename_volume.
1.11 - Adds mode parameter to attach_volume()
       to support volume read-only attaching.
1.12 - Adds retype.
1.13 - Adds create_export.
1.14 - Adds reservation parameter to extend_volume().
1.15 - Adds manage_existing and unmanage_only flag to delete_volume.
1.16 - Removes create_export.
1.17 - Add replica option to create_volume, promote_replica and
       sync_replica.
1.18 - Adds create_consistencygroup, delete_consistencygroup,
       create_cgsnapshot, and delete_cgsnapshot. Also adds
       the consistencygroup_id parameter in create_volume.
1.19 - Adds update_migrated_volume
1.20 - Adds support for sending objects over RPC in create_snapshot()
       and delete_snapshot()
1.21 - Adds update_consistencygroup.
1.22 - Adds create_consistencygroup_from_src.
1.23 - Adds attachment_id to detach_volume.
1.24 - Removed duplicated parameters: snapshot_id, image_id,
       source_volid, source_replicaid, consistencygroup_id and
       cgsnapshot_id from create_volume. All off them are already
       passed either in request_spec or available in the DB.
1.25 - Add source_cg to create_consistencygroup_from_src.
1.26 - Adds support for sending objects over RPC in
       create_consistencygroup(), create_consistencygroup_from_src(),
       update_consistencygroup() and delete_consistencygroup().
1.27 - Adds support for replication V2
1.28 - Adds manage_existing_snapshot
1.29 - Adds get_capabilities.
1.30 - Adds remove_export
1.31 - Updated: create_consistencygroup_from_src(), create_cgsnapshot()
       and delete_cgsnapshot() to cast method only with necessary
       args. Forwarding CGSnapshot object instead of CGSnapshot_id.
1.32 - Adds support for sending objects over RPC in create_volume().
1.33 - Adds support for sending objects over RPC in delete_volume().
1.34 - Adds support for sending objects over RPC in retype().
1.35 - Adds support for sending objects over RPC in extend_volume().
1.36 - Adds support for sending objects over RPC in migrate_volume(),
       migrate_volume_completion(), and update_migrated_volume().
1.37 - Adds old_reservations parameter to retype to support quota
       checks in the API.
1.38 - Scaling backup service, add get_backup_device() and
       secure_file_operations_enabled()
1.39 - Update replication methods to reflect new backend rep strategy
1.40 - Add cascade option to delete_volume().

... Mitaka supports messaging version 1.40. Any changes to existing
methods in 1.x after that point should be done so that they can handle
the version_cap being set to 1.40.

2.0  - Remove 1.x compatibility
2.1  - Add get_manageable_volumes() and get_manageable_snapshots().
2.2  - Adds support for sending objects over RPC in manage_existing().
2.3  - Adds support for sending objects over RPC in
       initialize_connection().
2.4  - Sends request_spec as object in create_volume().
2.5  - Adds create_group, delete_group, and update_group
2.6  - Adds create_group_snapshot, delete_group_snapshot, and
       create_group_from_src().

... Newton supports messaging version 2.6. Any changes to existing
methods in 2.x after that point should be done so that they can handle
the version_cap being set to 2.6.

3.0  - Drop 2.x compatibility
3.1  - Remove promote_replica and reenable_replication. This is
       non-backward compatible, but the user-facing API was removed
       back in Mitaka when introducing cheesecake replication.
3.2  - Adds support for sending objects over RPC in
       get_backup_device().
3.3  - Adds support for sending objects over RPC in attach_volume().
3.4  - Adds support for sending objects over RPC in detach_volume().
3.5  - Adds support for cluster in retype and migrate_volume
3.6  - Switch to use oslo.messaging topics to indicate backends instead
       of @backend suffixes in server names.
3.7  - Adds do_cleanup method to do volume cleanups from other nodes
       that we were doing in init_host.
3.8  - Make failover_host cluster aware and add failover_completed.
3.9  - Adds new attach/detach methods
3.10 - Returning objects instead of raw dictionaries in
       get_manageable_volumes & get_manageable_snapshots
3.11 - Removes create_consistencygroup, delete_consistencygroup,
       create_cgsnapshot, delete_cgsnapshot, update_consistencygroup,
       and create_consistencygroup_from_src.
3.12 - Adds set_log_levels and get_log_levels
3.13 - Add initialize_connection_snapshot,
       terminate_connection_snapshot, and remove_export_snapshot.
3.14 - Adds enable_replication, disable_replication,
       failover_replication, and list_replication_targets.
3.15 - Add revert_to_snapshot method
3.16 - Add no_snapshots to accept_transfer method
3.17 - Make get_backup_device a cast (async)
3.18 - Add reimage method
3.19 - Add extend_volume_completion method
BINARY = 'cinder-volume'
RPC_API_VERSION = '3.19'
RPC_DEFAULT_VERSION = '3.0'
TOPIC = 'cinder-volume'
accept_transfer(ctxt, volume, new_user, new_project, no_snapshots=False)
attach_volume(ctxt, volume, instance_uuid, host_name, mountpoint, mode)
attachment_delete(ctxt, attachment_id, vref)
attachment_update(ctxt, vref, connector, attachment_id)
copy_volume_to_image(ctxt, volume, image_meta)
create_group(ctxt: RequestContext, group: Group) None
create_group_from_src(ctxt, group, group_snapshot=None, source_group=None)
create_group_snapshot(ctxt, group_snapshot)
create_snapshot(ctxt: RequestContext, volume: Volume, snapshot: Snapshot) None
create_volume(ctxt: RequestContext, volume: Volume, request_spec: dict | None, filter_properties: dict | None, allow_reschedule: bool = True) None
delete_group(ctxt, group)
delete_group_snapshot(ctxt, group_snapshot)
delete_snapshot(ctxt, snapshot, unmanage_only=False)
delete_volume(ctxt: RequestContext, volume: Volume, unmanage_only: bool = False, cascade: bool = False) None
detach_volume(ctxt, volume, attachment_id)
disable_replication(ctxt, group)
do_cleanup(ctxt, cleanup_request)

Perform this service/cluster resource cleanup as requested.

enable_replication(ctxt, group)
extend_volume(ctxt, volume, new_size, reservations)
extend_volume_completion(ctxt, volume, new_size, reservations, error)
failover(ctxt, service, secondary_backend_id=None)

Failover host to the specified backend_id (secondary).

failover_completed(ctxt, service, updates)

Complete failover on all services of the cluster.

failover_replication(ctxt, group, allow_attached_volume=False, secondary_backend_id=None)
freeze_host(ctxt, service)

Set backend host to frozen.

get_backup_device(ctxt, backup, volume)
get_capabilities(ctxt, backend_id, discover)
get_log_levels(context, service, log_request)
get_manageable_snapshots(ctxt, service, marker, limit, offset, sort_keys, sort_dirs)
get_manageable_volumes(ctxt, service, marker, limit, offset, sort_keys, sort_dirs)
initialize_connection(ctxt, volume, connector)
initialize_connection_snapshot(ctxt, snapshot, connector)
list_replication_targets(ctxt, group)
manage_existing(ctxt, volume, ref)
manage_existing_snapshot(ctxt, snapshot, ref, backend)
migrate_volume(ctxt, volume, dest_backend, force_host_copy)
migrate_volume_completion(ctxt, volume, new_volume, error)
publish_service_capabilities(ctxt)
reimage(ctxt, volume, image_meta)
remove_export(ctxt, volume, sync=False)
remove_export_snapshot(ctxt, snapshot, sync=False)
retype(ctxt, volume, new_type_id, dest_backend, migration_policy='never', reservations=None, old_reservations=None)
revert_to_snapshot(ctxt, volume, snapshot)
secure_file_operations_enabled(ctxt, volume)
set_log_levels(context, service, log_request)
terminate_connection(ctxt, volume, connector, force=False)
terminate_connection_snapshot(ctxt, snapshot, connector, force=False)
thaw_host(ctxt, service)

Clear the frozen setting on a backend host.

update_group(ctxt, group, add_volumes=None, remove_volumes=None)
update_migrated_volume(ctxt, volume, new_volume, original_volume_status)