2.6. Creating and Deleting the Storage Cluster

2.6.1. vinfra cluster create

Create a storage cluster:

usage: vinfra cluster create [--disk <disk>:<role>[:<key=value,...>]]
                             [--tier-encryption {0,1,2,3}] --node <node> <cluster-name>
--disk <disk>:<role> [:<key=value,...>]

Disk configuration in the format:

  • <disk>: disk device ID or name
  • <role>: disk role (cs, mds, journal, mds-journal, mds-system, cs-system, system)
  • comma-separated key=value pairs with keys (optional):
    • tier: disk tier (0, 1, 2 or 3)
    • journal-tier: journal (cache) disk tier (0, 1, 2 or 3)
    • journal-type: journal (cache) disk type (no_cache, inner_cache or external_cache)
    • journal-disk: journal (cache) disk ID or device name
    • journal-size: journal (cache) disk size, in bytes
    • bind-address: bind IP address for the metadata service

E.g., sda:cs:tier=0,journal-type=inner_cache. This option can be used multiple times.

--tier-encryption {0,1,2,3}
Enable encryption for storage cluster tiers. Encryption is disabled by default. This option can be used multiple times.
--node <node>
Node ID or hostname
<cluster-name>
Storage cluster name

Example:

# vinfra cluster create stor1 --node 94d58604-6f30-4339-8578-adb7903b7277
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | d9ca8e1d-8ac8-4459-898b-2d803efd7bc6 |
+---------+--------------------------------------+

This command creates a task to create the storage cluster stor1 on the node with the ID 94d58604-6f30-4339-8578-adb7903b7277. As disk roles are not explicitly specified, they are assigned automatically: mds-system to the system disk, and cs to all other disks.

Task outcome:

# vinfra task show d9ca8e1d-8ac8-4459-898b-2d803efd7bc6
+---------+----------------------------------------+
| Field   | Value                                  |
+---------+----------------------------------------+
| args    | - stor1                                |
|         | - 94d58604-6f30-4339-8578-adb7903b7277 |
|         | - null                                 |
|         | - null                                 |
| kwargs  | {}                                     |
| name    | backend.tasks.cluster.CreateNewCluster |
| result  | cluster_id: 1                          |
| state   | success                                |
| task_id | d9ca8e1d-8ac8-4459-898b-2d803efd7bc6   |
+---------+----------------------------------------+

2.6.2. vinfra cluster delete

Delete the storage cluster:

usage: vinfra cluster delete

Example:

# vinfra cluster delete
Operation waiting (timeout=600s) [Elapsed Time: 0:01:09] ... |
Operation successful

This command releases all nodes from the storage cluster.