3.8. Managing Storage Policies

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

3.8.1. Creating Storage Policies

3.8.1.1. Syntax

usage: vinfra cluster storage-policy create [-h] [-f {json,table,value,yaml}]
                                            [-c COLUMN] --tier {0,1,2,3}
                                            (--replicas <norm>[:<min>] | --encoding <M>+<N>)
                                            --failure-domain
                                            {disk,host,rack,row,room}
                                            <name>

Create a new storage policy.

positional arguments:
  <name>                Storage policy name

optional arguments:
  -h, --help            show this help message and exit
  --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
...

3.8.1.2. Sample Output

This command creates a storage policy mystorpolicy with the tier set to the fastest, redundancy scheme to 3 replicas, and failure domain set to host.

# vinfra cluster storage-policy create mystorpolicy --tier 3 \
--replication 3 --failure-domain host
+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| failure_domain | host                                 |
| id             | 2199e71e-ce8a-4ba9-81cd-75502f0344ca |
| name           | mystorpolicy                         |
| redundancy     | m: 3                                 |
|                | type: replication                    |
| tier           | 3                                    |
+----------------+--------------------------------------+

3.8.2. Listing Storage Policies

3.8.2.1. Syntax

usage: vinfra cluster storage-policy list [-h] [-f {json,table,value,yaml}]
                                          [-c COLUMN]

List existing storage policies.
...

3.8.2.2. Sample Output

This command lists storage policies available to the compute cluster.

# vinfra cluster storage-policy list
+----------------+--------------+------+-------------------+----------------+
| id             | name         | tier | redundancy        | failure_domain |
+----------------+--------------+------+-------------------+----------------+
| 2199e71e-<...> | mystorpolicy |    3 | m: 3              | host           |
|                |              |      | type: replication |                |
| 4274d6fd-<...> | default      |    0 | m: 1              | host           |
|                |              |      | type: replication |                |
+----------------+--------------+------+-------------------+----------------+

3.8.3. Showing Storage Policy Details

3.8.3.1. Syntax

usage: vinfra cluster storage-policy show [-h] [-f {json,table,value,yaml}]
                                          [-c COLUMN]
                                          <storage-policy>

Show details of a storage policy.

positional arguments:
  <storage-policy>      Storage policy ID or name
...

3.8.3.2. Sample Output

This command shows the details of the storage policy mystorpolicy.

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

3.8.4. Changing Storage Policy Parameters

3.8.4.1. Syntax

usage: vinfra cluster storage-policy set [-h] [-f {json,table,value,yaml}]
                                         [-c COLUMN] [--name <name>]
                                         [--tier {0,1,2,3}]
                                         [--replicas <norm>[:<min>] |
                                         --encoding <M>+<N>]
                                         [--failure-domain {disk,host,rack,row,room}]
                                         <storage-policy>

Modify storage policy parameters.

positional arguments:
  <storage-policy>      Storage policy ID or name

optional arguments:
  -h, --help            show this help message and exit
  --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
...

3.8.4.2. Sample Output

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

# vinfra cluster storage-policy set mystorpolicy --encoding 5+2
+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| failure_domain | host                                 |
| id             | 2199e71e-ce8a-4ba9-81cd-75502f0344ca |
| name           | mystorpolicy                         |
| redundancy     | M: 5                                 |
|                | N: 2                                 |
|                | type: encoding                       |
| tier           | 3                                    |
+----------------+--------------------------------------+

3.8.5. Deleting Storage Policies

The default policy cannot be deleted.

3.8.5.1. Syntax

usage: vinfra cluster storage-policy delete [-h] <storage-policy>

Remove an existing storage policy.

positional arguments:
  <storage-policy>  Storage policy ID or name
...

3.8.5.2. Sample Output

This command deletes the storage policy mystorpolicy.

# vinfra cluster storage-policy delete mystorpolicy
Operation successful