volume

volume

Block Storage v1, v2

volume create

Create new volume

openstack volume create
    [--size <size>]
    [--type <volume-type>]
    [--image <image> | --snapshot <snapshot> | --source <volume> | --source-replicated <replicated-volume>]
    [--description <description>]
    [--user <user>]
    [--project <project>]
    [--availability-zone <availability-zone>]
    [--consistency-group <consistency-group>]
    [--property <key=value> [...] ]
    [--hint <key=value> [...] ]
    [--multi-attach]
    [--bootable | --non-bootable]
    [--read-only | --read-write]
    <name>
--size <size>

Volume size in GB (Required unless –snapshot or –source or –source-replicated is specified)

--type <volume-type>

Set the type of volume

Select <volume-type> from the available types as shown by volume type list.

--image <image>

Use <image> as source of volume (name or ID)

This is commonly used to create a boot volume for a server.

--snapshot <snapshot>

Use <snapshot> as source of volume (name or ID)

--source <volume>

Volume to clone (name or ID)

--source-replicated <replicated-volume>

Replicated volume to clone (name or ID)

--description <description>

Volume description

--user <user>

Specify an alternate user (name or ID)

--project <project>

Specify an alternate project (name or ID)

--availability-zone <availability-zone>

Create volume in <availability-zone>

--consistency-group <consistency-group>

Consistency group where the new volume belongs to

--property <key=value>

Set a property on this volume (repeat option to set multiple properties)

--hint <key=value>

Arbitrary scheduler hint key-value pairs to help boot an instance (repeat option to set multiple hints)

--multi-attach

Allow volume to be attached more than once (default to False)

--bootable

Mark volume as bootable

--non-bootable

Mark volume as non-bootable (default)

--read-only

Set volume to read-only access mode

--read-write

Set volume to read-write access mode (default)

<name>

Volume name

The --project and --user options are typically only useful for admin users, but may be allowed for other users depending on the policy of the cloud and the roles granted to the user.

volume delete

Delete volume(s)

openstack volume delete
    [--force | --purge]
    <volume> [<volume> ...]
--force

Attempt forced removal of volume(s), regardless of state (defaults to False)

--purge

Remove any snapshots along with volume(s) (defaults to False)

Volume version 2 only

<volume>

Volume(s) to delete (name or ID)

volume list

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>]
--project <project>

Filter results by <project> (name or ID) (admin only)

Volume version 2 only

--project-domain <project-domain>

Domain the project belongs to (name or ID).

This can be used in case collisions between project names exist.

Volume version 2 only

--user <user>

Filter results by <user> (name or ID) (admin only)

Volume version 2 only

--user-domain <user-domain>

Domain the user belongs to (name or ID).

This can be used in case collisions between user names exist.

Volume version 2 only

--name <name>

Filter results by volume name

--status <status>

Filter results by status

--all-projects

Include all projects (admin only)

--long

List additional fields in output

--limit <num-volumes>

Maximum number of volumes to display

--marker <volume>

The last volume ID of the previous page

Volume version 2 only

volume migrate

Migrate volume to a new host

openstack volume migrate
    --host <host>
    [--force-host-copy]
    [--lock-volume | --unlock-volume]
    <volume>
--host <host>

Destination host (takes the form: host@backend-name#pool) (required)

--force-host-copy

Enable generic host-based force-migration, which bypasses driver optimizations

--lock-volume

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

--unlock-volume

If specified, the volume state will not be locked and the a migration can be aborted (default) (possibly by another operation)

Volume version 2 only

<volume>

Volume to migrate (name or ID)

volume set

Set volume properties

openstack volume set
    [--name <name>]
    [--size <size>]
    [--description <description>]
    [--no-property]
    [--property <key=value> [...] ]
    [--image-property <key=value> [...] ]
    [--state <state>]
    [--type <volume-type>]
    [--retype-policy <retype-policy>]
    [--bootable | --non-bootable]
    [--read-only | --read-write]
    <volume>
--name <name>

New volume name

--size <size>

Extend volume size in GB

--description <description>

New volume description

--no-property

Remove all properties from <volume> (specify both --no-property and --property to remove the current properties before setting new properties.)

--property <key=value>

Set a property on this volume (repeat option to set multiple properties)

--type <volume-type>

New volume type (name or ID)

Volume version 2 only

--retype-policy <retype-policy>

Migration policy while re-typing volume (“never” or “on-demand”, default is “never” ) (available only when --type option is specified)

Volume version 2 only

--bootable

Mark volume as bootable

--non-bootable

Mark volume as non-bootable

--read-only

Set volume to read-only access mode

--read-write

Set volume to read-write access mode

--image-property <key=value>

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

--state <state>

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

<volume>

Volume to modify (name or ID)

volume show

Show volume details

openstack volume show
    <volume>
<volume>

Volume to display (name or ID)

volume unset

Unset volume properties

openstack volume unset
    [--property <key>]
    [--image-property <key>]
    <volume>
--property <key>

Remove a property from volume (repeat option to remove multiple properties)

--image-property <key>

Remove an image property from volume (repeat option to remove multiple image properties)

Volume version 2 only

<volume>

Volume to modify (name or ID)

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.