Managing storage policies

A storage policy is a group of parameters that define how to store VM volumes: a tier, a failure domain, and a redundancy mode. A storage policy can also be used to limit the bandwidth or IOPS of the volume. These limits help customize the allocation of cluster resources between the virtual machines. It is also needed to provide predictable performance levels for virtual machine disks.

When you deploy the compute cluster, you select parameters for the default storage policy, to be automatically created together with the cluster. The default policy cannot be deleted or renamed. By default, it is applied to uploaded images and base volumes created from these images.

If the storage cluster does not have enough nodes to enable multiple replicas (not recommended), you can adjust the default storage policy once you add more nodes to the storage cluster. It will be applied to the images and base volumes that were created with the default policy.

To apply custom redundancy schemes to VM volumes, you can create, edit, or clone storage policies for them.

Limitations

  • You cannot change the redundancy type of an existing storage policy.
  • You cannot change redundancy parameters of a storage policy with the erasure coding redundancy type.
  • You cannot delete a storage policy that governs existing volumes. If you still want to delete the storage policy, first remove these volumes or select another policy for them.

Prerequisites

To create a storage policy

Admin panel

  1. On the Compute > Storage > Storage policies tab, click Create storage policy.
  2. In the Create storage policy window, specify a policy name and select redundancy settings.

  3. Enable IOPS limit or Bandwidth limit to set the corresponding limits on the volume.

  4. Click Create.

Command-line interface

Use the following command:

vinfra service compute storage-policy create --tier {0,1,2,3} (--replicas <norm>[:<min>] | --encoding <M>+<N>)
                                             --failure-domain {0,1,2,3,4}
                                             [--write-bytes-sec <limit>] [--read-bytes-sec <limit>]
                                             [--read-iops-sec <limit>] [--write-iops-sec <limit>]
                                             [--total-bytes-sec <limit>] [--total-iops-sec <limit>]
                                             <name>
--tier {0,1,2,3}
Storage tier
--encoding <M>+<N>

Storage erasure encoding mapping in the format:

  • M: number of data blocks
  • N: number of parity blocks
--failure-domain {0,1,2,3,4}
Storage failure domain
--replicas <norm>[:<min>]

Storage replication mapping in the format:

  • norm: number of replicas to maintain
  • min: minimum required number of replicas (optional)
--write-bytes-sec <limit>
Number of bytes written per second
--read-bytes-sec <limit>
Number of bytes read per second
--read-iops-sec <limit>
Number of read operations per second
--write-iops-sec <limit>
Number of write operations per second
--total-bytes-sec <bytes>
Total number of bytes per second
--total-iops-sec <iops>
Total number of I/O operations per second
<name>
Storage policy name

For example, to create a storage policy mystorpolicy with the tier 3, erasure coding 3+2 scheme, host failure domain, and the limits of 100 IOPS and 104857600 bytes per second, run:

# vinfra service compute storage-policy create mystorpolicy --tier 3 \
--encoding 3+2 --failure-domain 1 --total-bytes-sec 104857600 --total-iops-sec 100

The created storage policy will appear in the vinfra service compute storage-policy list output:

# vinfra service compute storage-policy list
+-------------+--------------+------+--------------+----------------+--------------------------------+
| id          | name         | tier | redundancy   | failure_domain | qos                            |
+-------------+--------------+------+--------------+----------------+--------------------------------+
| 97b55811<…> | mystorpolicy | 3    | encoding=3+2 | 1              | read_bytes_sec: -1             |
|             |              |      |              |                | read_bytes_sec_per_gb: -1      |
|             |              |      |              |                | read_bytes_sec_per_gb_min: -1  |
|             |              |      |              |                | read_iops_sec: -1              |
|             |              |      |              |                | read_iops_sec_per_gb: -1       |
|             |              |      |              |                | read_iops_sec_per_gb_min: -1   |
|             |              |      |              |                | total_bytes_sec: 104857600     |
|             |              |      |              |                | total_bytes_sec_per_gb: -1     |
|             |              |      |              |                | total_bytes_sec_per_gb_min: -1 |
|             |              |      |              |                | total_iops_sec: 100            |
|             |              |      |              |                | total_iops_sec_per_gb: -1      |
|             |              |      |              |                | total_iops_sec_per_gb_min: -1  |
|             |              |      |              |                | write_bytes_sec: -1            |
|             |              |      |              |                | write_bytes_sec_per_gb: -1     |
|             |              |      |              |                | write_bytes_sec_per_gb_min: -1 |
|             |              |      |              |                | write_iops_sec: -1             |
|             |              |      |              |                | write_iops_sec_per_gb: -1      |
|             |              |      |              |                | write_iops_sec_per_gb_min: -1  |
| 603bd56b<…> | default      | 0    | replicas=3   | 1              | read_bytes_sec: -1             |
|             |              |      |              |                | read_bytes_sec_per_gb: -1      |
|             |              |      |              |                | read_bytes_sec_per_gb_min: -1  |
|             |              |      |              |                | read_iops_sec: -1              |
|             |              |      |              |                | read_iops_sec_per_gb: -1       |
|             |              |      |              |                | read_iops_sec_per_gb_min: -1   |
|             |              |      |              |                | total_bytes_sec: -1            |
|             |              |      |              |                | total_bytes_sec_per_gb: -1     |
|             |              |      |              |                | total_bytes_sec_per_gb_min: -1 |
|             |              |      |              |                | total_iops_sec: -1             |
|             |              |      |              |                | total_iops_sec_per_gb: -1      |
|             |              |      |              |                | total_iops_sec_per_gb_min: -1  |
|             |              |      |              |                | write_bytes_sec: -1            |
|             |              |      |              |                | write_bytes_sec_per_gb: -1     |
|             |              |      |              |                | write_bytes_sec_per_gb_min: -1 |
|             |              |      |              |                | write_iops_sec: -1             |
|             |              |      |              |                | write_iops_sec_per_gb: -1      |
|             |              |      |              |                | write_iops_sec_per_gb_min: -1  |
+-------------+--------------+------+--------------+----------------+--------------------------------+

To edit a storage policy

Admin panel

  1. On the Compute > Storage > Storage policies tab, select a policy from the list.
  2. On the policy right pane, click Edit.
  3. Change the required parameters, and then click Save.

Keep in mind, that changes to the storage policy will affect the redundancy and performance of all the volumes covered by it.

Command-line interface

Use the following command:

vinfra service compute storage-policy set [--name <name>] [--tier {0,1,2,3}]
                                          [--replicas <norm>[:<min>] |
                                          --encoding <M>+<N>]
                                          [--failure-domain {0,1,2,3,4}]
                                          [--write-bytes-sec <limit>] [--read-bytes-sec <limit>]
                                          [--read-iops-sec <limit>] [--write-iops-sec <limit>]
                                          [--total-bytes-sec <limit>] [--total-iops-sec <limit>]
                                          <storage-policy>
--name <name>
A new name for the storage policy
--tier {0,1,2,3}
Storage tier
--encoding <M>+<N>

Storage erasure encoding mapping in the format:

  • M: number of data blocks
  • N: number of parity blocks
--failure-domain {0,1,2,3,4}
Storage failure domain
--replicas <norm>[:<min>]

Storage replication mapping in the format:

  • norm: number of replicas to maintain
  • min: minimum required number of replicas (optional)
--write-bytes-sec <limit>
Number of bytes written per second
--read-bytes-sec <limit>
Number of bytes read per second
--read-iops-sec <limit>
Number of read operations per second
--write-iops-sec <limit>
Number of write operations per second
--total-bytes-sec <bytes>
Total number of bytes per second
--total-iops-sec <iops>
Total number of I/O operations per second
<storage-policy>
Storage policy ID or name

For example, to change the redundancy type for the storage policy mystorpolicy from 2 replicas to 3 replicas, run:

# vinfra service compute storage-policy set mystorpolicy --replicas 3

To clone a storage policy

  1. On the Compute > Storage > Storage policies tab, select a policy from the list.
  2. On the policy right pane, click Clone.
  3. Modify the existing parameters or just leave them as they are, and then click Clone.

To remove a storage policy

Admin panel

  1. On the Compute > Storage > Storage policies tab, select a policy from the list.
  2. On the policy right pane, click Delete.
  3. In the confirmation window, click Delete policy.

Command-line interface

Use the following command:

vinfra service compute storage-policy delete <storage-policy>
<storage-policy>
Storage policy ID or name

For example, to delete the storage policy mystorpolicy, run:

# vinfra service compute storage-policy delete mystorpolicy