Volumes
Volume interface (1.1 extension).
-
class novaclient.v1_1.volumes.Volume(manager, info, loaded=False)
Bases: novaclient.openstack.common.apiclient.base.Resource
A volume is an extra block level storage to the OpenStack instances.
-
Volume.NAME_ATTR = 'display_name'
-
Volume.delete()
Delete this volume.
-
class novaclient.v1_1.volumes.VolumeManager(api)
Bases: novaclient.base.ManagerWithFind
Manage Volume resources.
-
VolumeManager.create(size, snapshot_id=None, display_name=None, display_description=None, volume_type=None, availability_zone=None, imageRef=None)
Create a volume.
Parameters: |
- size – Size of volume in GB
- snapshot_id – ID of the snapshot
- display_name – Name of the volume
- display_description – Description of the volume
- volume_type – Type of volume
- availability_zone – Availability Zone for volume
- imageRef – reference to an image stored in glance
|
Return type: | Volume
|
-
VolumeManager.create_server_volume(server_id, volume_id, device)
Attach a volume identified by the volume ID to the given server ID
Parameters: |
- server_id – The ID of the server
- volume_id – The ID of the volume to attach.
- device – The device name
|
Return type: | Volume
|
-
VolumeManager.delete(volume)
Delete a volume.
Parameters: | volume – The Volume to delete. |
-
VolumeManager.delete_server_volume(server_id, attachment_id)
Detach a volume identified by the attachment ID from the given server
Parameters: |
- server_id – The ID of the server
- attachment_id – The ID of the attachment
|
-
VolumeManager.get(volume_id)
Get a volume.
Parameters: | volume_id – The ID of the volume to delete. |
Return type: | Volume |
-
VolumeManager.get_server_volume(server_id, attachment_id)
Get the volume identified by the attachment ID, that is attached to
the given server ID
Parameters: |
- server_id – The ID of the server
- attachment_id – The ID of the attachment
|
Return type: | Volume
|
-
VolumeManager.get_server_volumes(server_id)
Get a list of all the attached volumes for the given server ID
Parameters: | server_id – The ID of the server |
Return type: | list of Volume |
-
VolumeManager.list(detailed=True, search_opts=None)
Get a list of all volumes.
Return type: | list of Volume |
-
VolumeManager.resource_class
alias of Volume
-
VolumeManager.update_server_volume(server_id, attachment_id, new_volume_id)
Update the volume identified by the attachment ID, that is attached to
the given server ID
Parameters: |
- server_id – The ID of the server
- attachment_id – The ID of the attachment
- new_volume_id – The ID of the new volume to attach
|
Return type: | Volume
|