3.14. Managing volumes

3.14. Managing volumes

3.14.1. vinfra service compute volume create

Create a new compute volume:

usage: vinfra service compute volume create [--description <description>]
                                            [--network-install <network_install>]
                                            [--image <image>] [--snapshot <snapshot>]
                                            --storage-policy <storage_policy>
                                            --size <size-gb> <volume-name>
--description <description>
Volume description
--network-install <network_install>
Perform network installation (true or false).
--image <image>
Source compute image ID or name
--snapshot <snapshot>
Source compute volume snapshot ID or name
--storage-policy <storage_policy>
Storage policy ID or name
--size <size-gb>
Volume size, in gigabytes
<volume-name>
Volume name

Example:

# vinfra service compute volume create myvolume --storage-policy default --size 8
+--------------------------------+--------------------------------------+
| Field                          | Value                                |
+--------------------------------+--------------------------------------+
| attachments                    | []                                   |
| availability_zone              | nova                                 |
| bootable                       | False                                |
| consistencygroup_id            |                                      |
| created_at                     | 2018-09-12T12:30:12.665916           |
| description                    |                                      |
| encrypted                      | False                                |
| id                             | c9c0e9e7-ce7a-4566-99d5-d7e40f2987ab |
| imageRef                       |                                      |
| migration_status               |                                      |
| multiattach                    | False                                |
| name                           | myvolume                             |
| network_install                | False                                |
| os-vol-host-attr:host          |                                      |
| os-vol-mig-status-attr:migstat |                                      |
| os-vol-mig-status-attr:name_id |                                      |
| project_id                     | 72a5db3a033c403a86756021e601ef34     |
| replication_status             |                                      |
| size                           | 8                                    |
| snapshot_id                    |                                      |
| source_volid                   |                                      |
| status                         | creating                             |
| storage_policy_name            | default                              |
| updated_at                     |                                      |
| user_id                        | 98bf389983c24c07af9677b931783143     |
| volume_image_metadata          |                                      |
+--------------------------------+--------------------------------------+

This command creates a volume myvolume sized 8 GB and chooses the default storage policy for it.

3.14.2. vinfra service compute volume list

List compute volumes:

usage: vinfra service compute volume list [--long] [--limit <num>]
                                          [--marker <volume>] [--name <name>]
                                          [--id <id>] [--project <project>]
                                          [--status <status>] [--size <size>]
                                          [--storage-policy <host>]
--long
Enable access and listing of all fields of objects.
--limit <num>
The maximum number of volumes to list. To list all volumes, set the option to -1.
--marker <volume>
List volumes after the marker.
--name <name>
List volumes with the specified name or use a filter. Supported filter operator: contains. The filter format is <operator>:<value1>[,<value2>,...].
--id <id>
Show a volume with the specified ID or list volumes using a filter. Supported filter operator: in. The filter format is <operator>:<value1>[,<value2>,...].
--project <project>
List volumes that belong to the specified project ID. Can only be performed by system administrators.
--status <status>
List volumes with the specified status.
--size <size>
List volumes with the specified size.
--storage-policy <host>
List volumes with the specified storage policy name or ID.

Example:

# vinfra service compute volume list -c id -c name -c size -c status
+--------------------------------------+----------+------+-----------+
| id                                   | name     | size | status    |
+--------------------------------------+----------+------+-----------+
| c9c0e9e7-ce7a-4566-99d5-d7e40f2987ab | myvolume |    8 | available |
+--------------------------------------+----------+------+-----------+

This command lists volumes available to the compute cluster. (The output is abridged to fit on page.)

3.14.3. vinfra service compute volume show

Display compute volume details:

usage: vinfra service compute volume show <volume>
<volume>
Volume ID or name

Example:

# vinfra service compute volume show myvolume
+--------------------------------+------------------------------------------+
| Field                          | Value                                    |
+--------------------------------+------------------------------------------+
| attachments                    | []                                       |
| availability_zone              | nova                                     |
| bootable                       | False                                    |
| consistencygroup_id            |                                          |
| created_at                     | 2018-09-12T12:30:12.665916               |
| description                    |                                          |
| encrypted                      | False                                    |
| id                             | c9c0e9e7-ce7a-4566-99d5-d7e40f2987ab     |
| imageRef                       |                                          |
| migration_status               |                                          |
| multiattach                    | False                                    |
| name                           | myvolume                                 |
| network_install                | False                                    |
| os-vol-host-attr:host          | node001.vstoragedomain@vstorage#vstorage |
| os-vol-mig-status-attr:migstat |                                          |
| os-vol-mig-status-attr:name_id |                                          |
| project_id                     | 72a5db3a033c403a86756021e601ef34         |
| replication_status             |                                          |
| size                           | 8                                        |
| snapshot_id                    |                                          |
| source_volid                   |                                          |
| status                         | available                                |
| storage_policy_name            | default                                  |
| updated_at                     | 2018-09-12T12:30:33.167654               |
| user_id                        | 98bf389983c24c07af9677b931783143         |
| volume_image_metadata          |                                          |
+--------------------------------+------------------------------------------+

This command shows the details for the volume myvolume.

3.14.4. vinfra service compute volume set

Modify volume parameters:

usage: vinfra service compute volume set [--description <description>]
                                         [--network-install <network_install>]
                                         [--storage-policy <storage_policy>]
                                         [--bootable <bootable>]
                                         [--name <name>] <volume>
--description <description>
Volume description
--network-install <network_install>
Perform network install (true or false)
--storage-policy <storage_policy>
Storage policy ID or name
--bootable <bootable>
Make bootable (true or false)
--name <name>
A new name for the volume
<volume>
Volume ID or name

Example:

# vinfra service compute volume set myvolume --storage-policy mystorpolicy
+--------------------------------+------------------------------------------+
| Field                          | Value                                    |
+--------------------------------+------------------------------------------+
| attachments                    | []                                       |
| availability_zone              | nova                                     |
| bootable                       | False                                    |
| consistencygroup_id            |                                          |
| created_at                     | 2018-09-12T12:30:12.665916               |
| description                    |                                          |
| encrypted                      | False                                    |
| id                             | c9c0e9e7-ce7a-4566-99d5-d7e40f2987ab     |
| imageRef                       |                                          |
| migration_status               |                                          |
| multiattach                    | False                                    |
| name                           | myvolume                                 |
| network_install                | False                                    |
| os-vol-host-attr:host          | node001.vstoragedomain@vstorage#vstorage |
| os-vol-mig-status-attr:migstat |                                          |
| os-vol-mig-status-attr:name_id |                                          |
| project_id                     | 72a5db3a033c403a86756021e601ef34         |
| replication_status             |                                          |
| size                           | 8                                        |
| snapshot_id                    |                                          |
| source_volid                   |                                          |
| status                         | available                                |
| storage_policy_name            | mystorpolicy                             |
| updated_at                     | 2018-09-12T12:55:29.298717               |
| user_id                        | 98bf389983c24c07af9677b931783143         |
| volume_image_metadata          |                                          |
+--------------------------------+------------------------------------------+

This command changes the storage policy of the volume myvolume to mystorpolicy.

3.14.5. vinfra service compute volume extend

Extend a compute volume:

usage: vinfra service compute volume extend --size <size_gb> <volume>
<volume>
Volume ID or name

Example:

# vinfra service compute volume extend myvolume --size 16
Operation successful

This command extends the volume myvolume to 16 GB.

3.14.6. vinfra service compute volume delete

Delete a compute volume:

usage: vinfra service compute volume delete <volume>
<volume>
Volume ID or name

Example:

# vinfra service compute volume delete myvolume2
Operation successful

This command deletes the volume myvolume2.