python-openstackclient/doc/source/command-objects/volume.rst

5.3 KiB

volume

Block Storage v1, v2

volume create

Create new volume

volume create

os volume create
    --size <size>
    [--type <volume-type>]
    [--image <image>]
    [--snapshot <snapshot>]
    [--source <volume>]
    [--description <description>]
    [--user <user>]
    [--project <project>]
    [--availability-zone <availability-zone>]
    [--property <key=value> [...] ]
    <name>

--size <size> (required)

Volume size in GB

--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 <source>

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\>

--property <key=value>

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

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)

volume delete

os 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(s) to delete (name or ID)

volume list

List volumes

volume list

os volume list
    [--project <project> [--project-domain <project-domain>]]
    [--user <user> [--user-domain <user-domain>]]
    [--name <name>]
    [--status <status>]
    [--all-projects]
    [--long]

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

volume set

Set volume properties

volume set

os volume set
    [--name <name>]
    [--size <size>]
    [--description <description>]
    [--property <key=value> [...] ]
    [--image-property <key=value> [...] ]
    [--state <state>]
    <volume>

--name <name>

New volume name

--size <size>

Extend volume size in GB

--description <description>

New volume description

--property <key=value>

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

--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")

Volume version 2 only

Volume to modify (name or ID)

volume show

Show volume details

volume show

os volume show
    <volume>




Volume to display (name or ID)

volume unset

Unset volume properties

volume unset

os 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 to modify (name or ID)