3.10. Managing Storage Policies

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

3.10.1. vinfra cluster storage-policy create

Create a new storage policy:

usage: vinfra cluster storage-policy create --tier {0,1,2,3}
                                            (--replicas <norm>[:<min>] |
                                            --encoding <M>+<N>) --failure-domain
                                            {disk,host,rack,row,room} <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
<name>
Storage policy name

Example:

# vinfra cluster storage-policy create mystorpolicy --tier 3 \
--encoding 3+2 --failure-domain host
+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| failure_domain | host                                 |
| id             | 2199e71e-ce8a-4ba9-81cd-75502f0344ca |
| name           | mystorpolicy                         |
| 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.

3.10.2. vinfra cluster storage-policy list

List existing storage policies:

usage: vinfra cluster storage-policy list

Example:

# vinfra cluster storage-policy list
+----------------+--------------+------+--------------+----------------+
| id             | name         | tier | redundancy   | failure_domain |
+----------------+--------------+------+--------------+----------------+
| 2199e71e-<...> | mystorpolicy |    3 | encoding=3+2 | host           |
| 4274d6fd-<...> | default      |    0 | replicas=3   | host           |
+----------------+--------------+------+--------------+----------------+

This command lists storage policies available to the compute cluster.

3.10.3. vinfra cluster storage-policy show

Show details of a storage policy:

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

Example:

# vinfra cluster storage-policy show mystorpolicy
+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| failure_domain | host                                 |
| id             | 2199e71e-ce8a-4ba9-81cd-75502f0344ca |
| name           | mystorpolicy                         |
| redundancy     | encoding=3+2                         |
| tier           | 3                                    |
+----------------+--------------------------------------+

This command shows the details of the storage policy mystorpolicy.

3.10.4. vinfra cluster storage-policy set

Modify storage policy parameters:

usage: vinfra cluster storage-policy set [--name <name>] [--tier {0,1,2,3}]
                                         [--replicas <norm>[:<min>] |
                                         --encoding <M>+<N>] [--failure-domain
                                         {disk,host,rack,row,room}] <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
<storage-policy>
Storage policy ID or name

Example:

# vinfra cluster storage-policy set mystorpolicy --encoding 5+2
+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| failure_domain | host                                 |
| id             | 2199e71e-ce8a-4ba9-81cd-75502f0344ca |
| name           | mystorpolicy                         |
| 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.10.5. vinfra cluster storage-policy delete

The default policy cannot be deleted.

Remove an existing storage policy:

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

Example:

# vinfra cluster storage-policy delete mystorpolicy
Operation successful

This command deletes the storage policy mystorpolicy.