Block Storage v1, v2
Create new volume
openstack volume create
[--size <size>]
[--type <volume-type>]
[--image <image> | --snapshot <snapshot> | --source <volume> ]
[--description <description>]
[--availability-zone <availability-zone>]
[--consistency-group <consistency-group>]
[--property <key=value> [...] ]
[--hint <key=value> [...] ]
[--bootable | --non-bootable]
[--read-only | --read-write]
<name>
Volume size in GB (Required unless –snapshot or –source is specified)
Set the type of volume
Select <volume-type>
from the available types as shown
by volume type list
.
Use <image>
as source of volume (name or ID)
This is commonly used to create a boot volume for a server.
Use <snapshot>
as source of volume (name or ID)
Volume to clone (name or ID)
Volume description
Create volume in <availability-zone>
Consistency group where the new volume belongs to
Set a property on this volume (repeat option to set multiple properties)
Arbitrary scheduler hint key-value pairs to help boot an instance (repeat option to set multiple hints)
Mark volume as bootable
Mark volume as non-bootable (default)
Set volume to read-only access mode
Set volume to read-write access mode (default)
Volume name
Delete volume(s)
openstack volume delete
[--force | --purge]
<volume> [<volume> ...]
Attempt forced removal of volume(s), regardless of state (defaults to False)
Remove any snapshots along with volume(s) (defaults to False)
Volume version 2 only
Volume(s) to delete (name or ID)
List volumes
openstack volume list
[--project <project> [--project-domain <project-domain>]]
[--user <user> [--user-domain <user-domain>]]
[--name <name>]
[--status <status>]
[--all-projects]
[--long]
[--limit <num-volumes>]
[--marker <volume>]
Filter results by <project>
(name or ID) (admin only)
Volume version 2 only
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
Volume version 2 only
Filter results by <user>
(name or ID) (admin only)
Volume version 2 only
Domain the user belongs to (name or ID).
This can be used in case collisions between user names exist.
Volume version 2 only
Filter results by volume name
Filter results by status
Include all projects (admin only)
List additional fields in output
Maximum number of volumes to display
The last volume ID of the previous page
Volume version 2 only
Migrate volume to a new host
openstack volume migrate
--host <host>
[--force-host-copy]
[--lock-volume]
<volume>
Destination host (takes the form: host@backend-name#pool) (required)
Enable generic host-based force-migration, which bypasses driver optimizations
If specified, the volume state will be locked and will not allow a migration to be aborted (possibly by another operation)
Volume version 2 only
Volume to migrate (name or ID)
Set volume properties
openstack volume set
[--name <name>]
[--size <size>]
[--description <description>]
[--no-property]
[--property <key=value> [...] ]
[--image-property <key=value> [...] ]
[--state <state>]
[--attached | --detached ]
[--type <volume-type>]
[--retype-policy <retype-policy>]
[--bootable | --non-bootable]
[--read-only | --read-write]
<volume>
New volume name
Extend volume size in GB
New volume description
Remove all properties from <volume>
(specify both --no-property
and --property
to
remove the current properties before setting new properties.)
Set a property on this volume (repeat option to set multiple properties)
New volume type (name or ID)
Volume version 2 only
Migration policy while re-typing volume
(“never” or “on-demand”, default is “never” )
(available only when --type
option is specified)
Volume version 2 only
Mark volume as bootable
Mark volume as non-bootable
Set volume to read-only access mode
Set volume to read-write access mode
Set an image property on this volume (repeat option to set multiple image properties)
Image properties are copied along with the image when creating a volume
using --image
. Note that these properties are immutable on the image
itself, this option updates the copy attached to this volume.
Volume version 2 only
New volume state (“available”, “error”, “creating”, “deleting”, “in-use”, “attaching”, “detaching”, “error_deleting” or “maintenance”) (admin only) (This option simply changes the state of the volume in the database with no regard to actual status, exercise caution when using)
Volume version 2 only
Set volume attachment status to “attached” (admin only) (This option simply changes the state of the volume in the database with no regard to actual status, exercise caution when using)
Volume version 2 only
Set volume attachment status to “detached” (admin only) (This option simply changes the state of the volume in the database with no regard to actual status, exercise caution when using)
Volume version 2 only
Volume to modify (name or ID)
Show volume details
openstack volume show
<volume>
Volume to display (name or ID)
Unset volume properties
openstack volume unset
[--property <key>]
[--image-property <key>]
<volume>
Remove a property from volume (repeat option to remove multiple properties)
Remove an image property from volume (repeat option to remove multiple image properties)
Volume version 2 only
Volume to modify (name or ID)
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.