3.16. Managing storage policies

You can manage storage policies only after creating the compute cluster.

3.16.1. vinfra service compute storage-policy create

Create a new storage policy:

usage: vinfra service compute storage-policy create --tier {0,1,2,3}
                                            (--replicas <norm>[:<min>] |
                                            --encoding <M>+<N>) --failure-domain
                                            {disk,host,rack,row,room}
                                            [--total-bytes-sec <bytes>]
                                            [--total-iops-sec <iops>]
                                            <name>
--tier {0,1,2,3}
Storage tier
--replicas <norm>[:<min>]

Storage replication mapping in the format:

  • norm: the number of replicas to maintain
  • min: the minimum required number of replicas (optional)
--encoding <M>+<N>

Storage erasure encoding mapping in the format:

  • M: the number of data blocks
  • N: the number of parity blocks
--failure-domain {disk,host,rack,row,room}
Storage failure domain
--total-bytes-sec <bytes>
Total bytes per second
--total-iops-sec <iops>
Total iops
<name>
Storage policy name

Example:

# vinfra service compute storage-policy create mystorpolicy --tier 3 \
--encoding 3+2 --failure-domain host --total-bytes-sec \
104857600 --total-iops-sec 100
+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| available      | False                                |
| failure_domain | host                                 |
| id             | 2199e71e-ce8a-4ba9-81cd-75502f0344ca |
| name           | mystorpolicy                         |
| qos            | total_bytes_sec: 104857600           |
|                | total_iops_sec: 100                  |
| redundancy     | encoding=3+2                         |
| tier           | 3                                    |
+----------------+--------------------------------------+

This command creates a storage policy mystorpolicy with the tier set to 3, redundancy scheme to erasure coding 3+2, and failure domain set to host. It also sets the limits of 100 iops and 104857600 bytes per second.

3.16.2. vinfra service compute storage-policy list

List existing storage policies:

usage: vinfra service compute storage-policy list [--long]
--long
Enable access and listing of all fields of objects.

Example:

# vinfra service compute storage-policy list
+----------------+--------------+------+--------------+----------------+---------------------+
| id             | name         | tier | redundancy   | failure_domain | qos                 |
+----------------+--------------+------+--------------+----------------+---------------------+
| 2199e71e-<...> | mystorpolicy |    3 | encoding=3+2 | host           | total_bytes_sec:    |
|                |              |      |              |                | 104857600           |
|                |              |      |              |                | total_iops_sec: 100 |
| 4274d6fd-<...> | default      |    0 | replicas=3   | host           | total_bytes_sec: -1 |
|                |              |      |              |                | total_iops_sec: -1  |
+----------------+--------------+------+--------------+----------------+---------------------+

This command lists storage policies available to the compute cluster.

3.16.3. vinfra service compute storage-policy show

Show details of a storage policy:

usage: vinfra service compute storage-policy show <storage-policy>
<storage-policy>
Storage policy ID or name

Example:

# vinfra service compute storage-policy show mystorpolicy
+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| available      | False                                |
| failure_domain | host                                 |
| id             | 2199e71e-ce8a-4ba9-81cd-75502f0344ca |
| name           | mystorpolicy                         |
| qos            | total_bytes_sec: 104857600           |
|                | total_iops_sec: 100                  |
| redundancy     | encoding=3+2                         |
| tier           | 3                                    |
+----------------+--------------------------------------+

This command shows the details of the storage policy mystorpolicy.

3.16.4. vinfra service compute storage-policy set

Modify storage policy parameters:

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

Storage replication mapping in the format:

  • norm: the number of replicas to maintain
  • min: the minimum required number of replicas (optional)
--encoding <M>+<N>

Storage erasure encoding mapping in the format:

  • M: the number of data blocks
  • N: the number of parity blocks
--failure-domain {disk,host,rack,row,room}
Storage failure domain
--total-bytes-sec <bytes>
Total bytes per second
--total-iops-sec <iops>
Total iops
<storage-policy>
Storage policy ID or name

Example:

# vinfra service compute storage-policy set mystorpolicy --encoding 5+2
+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| available      | False                                |
| failure_domain | host                                 |
| id             | 2199e71e-ce8a-4ba9-81cd-75502f0344ca |
| name           | mystorpolicy                         |
| qos            | total_bytes_sec: 104857600           |
|                | total_iops_sec: 100                  |
| redundancy     | encoding=5+2                         |
| tier           | 3                                    |
+----------------+--------------------------------------+

This command changes the redundancy type for the storage policy mystorpolicy from erasure coding 3+2 to 5+2.

3.16.5. vinfra service compute storage-policy delete

The default policy cannot be deleted.

Remove an existing storage policy:

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

Example:

# vinfra service compute storage-policy delete mystorpolicy
Operation successful

This command deletes the storage policy mystorpolicy.