.. _Managing Storage Policies: Managing Storage Policies ------------------------- You can manage storage policies only after creating the compute cluster. .. _vinfra cluster storage-policy create: vinfra cluster storage-policy create ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Create a new storage policy: :: usage: vinfra cluster storage-policy create --tier {0,1,2,3} (--replicas [:] | --encoding +) --failure-domain {disk,host,rack,row,room} ``--tier {0,1,2,3}`` Storage tier ``--replicas [:]`` Storage replication mapping in the format: - ``norm``: the number of replicas to maintain; - ``min``: the minimum required number of replicas (optional). ``--encoding +`` 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 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. .. _vinfra cluster storage-policy list: 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. .. _vinfra cluster storage-policy show: vinfra cluster storage-policy show ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Show details of a storage policy: :: usage: vinfra cluster storage-policy show ```` 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``. .. _vinfra cluster storage-policy set: vinfra cluster storage-policy set ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Modify storage policy parameters: :: usage: vinfra cluster storage-policy set [--name ] [--tier {0,1,2,3}] [--replicas [:] | --encoding +] [--failure-domain {disk,host,rack,row,room}] ``--name `` A new name for the storage policy ``--tier {0,1,2,3}`` Storage tier ``--replicas [:]`` Storage replication mapping in the format: - ``norm``: the number of replicas to maintain; - ``min``: the minimum required number of replicas (optional). ``--encoding +`` 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 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. .. _vinfra cluster storage-policy delete: vinfra cluster storage-policy delete ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The default policy cannot be deleted. Remove an existing storage policy: :: usage: vinfra cluster storage-policy delete ```` Storage policy ID or name Example: :: # vinfra cluster storage-policy delete mystorpolicy Operation successful This command deletes the storage policy ``mystorpolicy``.