Changing the storage policy for volumes

If you use redundancy by replication for a compute volume, you can update the chosen redundancy scheme by changing the storage policy. With redundancy by erasure coding, however, changing the redundancy scheme applied to the volume is disabled. The storage policy can be changed for volumes attached to both running and stopped virtual machines.

Limitations

  • You cannot change the volume redundancy type. And thus, you can apply another storage policy only within the same redundancy type. For example, the storage policy with 3 replicas can only be changed to the storage policy with 2 replicas or 1 replica (no redundancy).
  • Changing the storage policy with the erasure coding redundancy type is disabled.

Prerequisites

To change the storage policy of a volume

Admin panel

  1. On the Compute > Storage > Volumes tab, click a volume.
  2. Click the pencil icon in the Storage policy field.
  3. Select a new storage policy, and then click the tick icon. You can choose only between storage policies with the replication redundancy type.

Command-line interface

Use the following command:

vinfra service compute volume set --storage-policy <storage_policy> <volume>
--storage-policy <storage_policy>
Storage policy ID or name
<volume>
Volume ID or name

For example, to change the storage policy of the volume myvolume to mystorpolicy, run:

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