openstack.block_storage.v2.volume

The Volume Class

The Volume class inherits from Resource.

class openstack.block_storage.v2.volume.Volume(_synchronized=False, connection=None, **attrs)

The base resource

Parameters
  • _synchronized (bool) – This is not intended to be used directly. See new() and existing().

  • connection (openstack.connection.Connection) – Reference to the Connection being used. Defaults to None to allow Resource objects to be used without an active Connection, such as in unit tests. Use of self._connection in Resource code should protect itself with a check for None.

attachments

TODO(briancurtin): This is currently undocumented in the API.

availability_zone

The availability zone.

consistency_group_id

ID of the consistency group.

created_at

The timestamp of this volume creation.

updated_at

The date and time when the resource was updated.

description

The volume description.

extended_replication_status

Extended replication status on this volume.

host

The volume’s current back-end.

image_id

The ID of the image from which you want to create the volume. Required to create a bootable volume.

is_bootable

Enables or disables the bootable attribute. You can boot an instance from a bootable volume. Type: bool

is_encrypted

True if this volume is encrypted, False if not. Type: bool

migration_id

The volume ID that this volume’s name on the back-end is based on.

migration_status

The status of this volume’s migration (None means that a migration is not currently in progress).

project_id

The project ID associated with current back-end.

replication_driver_data

Data set by the replication driver

replication_status

Status of replication on this volume.

scheduler_hints

Scheduler hints for the volume

size

The size of the volume, in GBs. Type: int

snapshot_id

To create a volume from an existing snapshot, specify the ID of the existing volume snapshot. If specified, the volume is created in same availability zone and with same size of the snapshot.

source_volume_id

To create a volume from an existing volume, specify the ID of the existing volume. If specified, the volume is created with same size of the source volume.

status

One of the following values: creating, available, attaching, in-use deleting, error, error_deleting, backing-up, restoring-backup, error_restoring. For details on these statuses, see the Block Storage API documentation.

user_id

The user ID associated with the volume

volume_image_metadata

One or more metadata key and value pairs about image

volume_type

The name of the associated volume type.

extend(session, size)

Extend a volume size.

set_bootable_status(session, bootable=True)

Set volume bootable status flag

reset_status(session, status, attach_status, migration_status)

Reset volume statuses (admin operation)

attach(session, mountpoint, instance)

Attach volume to server

detach(session, attachment, force=False)

Detach volume from server

unmanage(session)

Unmanage volume

retype(session, new_type, migration_policy=None)

Change volume type

migrate(session, host=None, force_host_copy=False, lock_volume=False)

Migrate volume

complete_migration(session, new_volume_id, error=False)

Complete volume migration

force_delete(session)

Force volume deletion