2.3. Managing Storage Nodes

2.3.1. Adding Nodes to Storage Cluster

2.3.1.1. Syntax

usage: vinfra node join [-h] [-f {json,table,value,yaml}] [-c COLUMN] [--wait]
                        [--timeout <seconds>]
                        [--disk <disk>:<role>[:<key1=value1,key2=value2...>]]
                        <node>

Join a node to the storage cluster

positional arguments:
  <node>                Node ID or hostname

optional arguments:
  -h, --help            show this help message and exit
  --disk <disk>:<role>[:<key1=value1,key2=value2...>]
                        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).
...

2.3.1.2. Sample Output

This command creates a task to add the node with the ID f59dabdb-bd1c-4944-8af2-26b8fe9ff8d4 to the storage cluster and assigns roles to disks: mds-system to sda, cs to sdb` and sdc.

# vinfra node join f59dabdb-bd1c-4944-8af2-26b8fe9ff8d4 \
--disk sda:mds-system \
--disk sdb:cs \
--disk sdc:cs
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | a2713068-9544-4ea1-8ec8-69a068cf86f2 |
+---------+--------------------------------------+

Task outcome:

# vinfra task show a2713068-9544-4ea1-8ec8-69a068cf86f2
+---------+--------------------------------------------+
| Field   | Value                                      |
+---------+--------------------------------------------+
| args    | - f59dabdb-bd1c-4944-8af2-26b8fe9ff8d4     |
|         | - 1                                        |
| kwargs  | disks:                                     |
|         | - id: 85F32403-94A9-465A-9E6C-C1A2B41294FC |
|         |   role: mds-system                         |
|         |   service_params: {}                       |
|         | - id: FE0B5876-E054-489B-B0FD-72429BEFD46A |
|         |   role: cs                                 |
|         |   service_params: {}                       |
|         | - id: D3BEF4BB-AA3B-4DB6-9376-BC7CDA636700 |
|         |   role: cs                                 |
|         |   service_params: {}                       |
| name    | backend.tasks.node.AddNodeInClusterTask    |
| result  | {}                                         |
| state   | success                                    |
| task_id | a2713068-9544-4ea1-8ec8-69a068cf86f2       |
+---------+--------------------------------------------+

2.3.2. Listing Nodes in Storage Cluster

2.3.2.1. Syntax

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

List storage nodes.
...

2.3.2.2. Sample Output

This command lists all nodes registered in Virtuozzo Infrastructure Platform (both unassigned and used in the storage cluster).

# vinfra node list
+--------------------------+---------------+------------+-----------+-------------+----------+
| id                       | host          | is_primary | is_online | is_assigned | is_in_ha |
+--------------------------+---------------+------------+-----------+-------------+----------+
| 09bb6b84-70a5-41ae-b342- | node001.<...> | True       | True      | True        | False    |
| 23e5fc7cc126             |               |            |           |             |          |
| 187edb11-38c5-487b-bd7f- | node002.<...> | False      | True      | True        | False    |
| 57b0fa4b733c             |               |            |           |             |          |
| e6255aed-d6e7-41b2-ba90- | node003.<...> | False      | True      | True        | False    |
| 86164c1cd9a6             |               |            |           |             |          |
+--------------------------+---------------+------------+-----------+-------------+----------+

2.3.3. Showing Storage Node Details

2.3.3.1. Syntax

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

Show storage node details.

positional arguments:
  <node>                Node ID or hostname
...

2.3.3.2. Sample Output

This command show the details of the node with the ID 4f96acf5-3bc8-4094-bcb6-4d1953be7b55.

# vinfra node show 4f96acf5-3bc8-4094-bcb6-4d1953be7b55
+---------------+--------------------------------------+
| Field         | Value                                |
+---------------+--------------------------------------+
| cpu_cores     | 2                                    |
| host          | stor-1.example.com.vstoragedomain.   |
| id            | 4f96acf5-3bc8-4094-bcb6-4d1953be7b55 |
| ipaddr        | stor-1.example.com.vstoragedomain.   |
| is_assigned   | False                                |
| is_in_ha      | False                                |
| is_installing | False                                |
| is_online     | True                                 |
| is_primary    | True                                 |
| is_virt       | True                                 |
| mem_total     | 8201310208                           |
| roles         | management:                          |
|               |   is_primary: true                   |
| tasks         |                                      |
+---------------+--------------------------------------+

2.3.4. Releasing Nodes from Storage Cluster

2.3.4.1. Syntax

usage: vinfra node release [-h] [-f {json,table,value,yaml}] [-c COLUMN]
                           [--wait] [--timeout <seconds>] [--force]
                           <node>

Release a node from the storage cluster. Start data migration from the node as
well as cluster replication and rebalancing to meet the configured redundancy
level.

positional arguments:
  <node>                Node ID or hostname

optional arguments:
  -h, --help            show this help message and exit
  --force               Release node without data migration.
...

2.3.4.2. Sample Output

This command creates a task to release the node with the ID f59dabdb-bd1c-4944-8af2-26b8fe9ff8d4 from the storage cluster with migration of data to maintain the set redundancy mode.

# vinfra node release f59dabdb-bd1c-4944-8af2-26b8fe9ff8d4
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | c2a653a2-8991-4b3a-8bdf-5c0872aa75b3 |
+---------+--------------------------------------+

Task outcome:

# vinfra task show c2a653a2-8991-4b3a-8bdf-5c0872aa75b3
+---------+----------------------------------------+
| Field   | Value                                  |
+---------+----------------------------------------+
| args    | - f59dabdb-bd1c-4944-8af2-26b8fe9ff8d4 |
|         | - false                                |
| kwargs  | {}                                     |
| name    | backend.tasks.node.ReleaseNodeTask     |
| state   | success                                |
| task_id | c2a653a2-8991-4b3a-8bdf-5c0872aa75b3   |
+---------+----------------------------------------+

2.3.5. Forgetting Nodes

2.3.5.1. Syntax

usage: vinfra node forget [-h] [-f {json,table,value,yaml}] [-c COLUMN]
                          [--wait] [--timeout <seconds>]
                          <node>

Remove a node from the storage cluster.

positional arguments:
  <node>                Node ID or hostname
...

2.3.5.2. Sample Output

This commands creates a task to unregister the node with the ID fd1e46de-6e17-4571-bf6b-1ac34ec1c225 from Virtuozzo Infrastructure Platform.

# vinfra node forget fd1e46de-6e17-4571-bf6b-1ac34ec1c225
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 0eac3b74-e8f5-4974-9efe-a9070187d83c |
+---------+--------------------------------------+

Task outcome:

# vinfra task show 0eac3b74-e8f5-4974-9efe-a9070187d83c
+---------+----------------------------------------+
| Field   | Value                                  |
+---------+----------------------------------------+
| args    | - fd1e46de-6e17-4571-bf6b-1ac34ec1c225 |
| kwargs  | {}                                     |
| name    | backend.tasks.node.DeleteNodeTask      |
| state   | success                                |
| task_id | 0eac3b74-e8f5-4974-9efe-a9070187d83c   |
+---------+----------------------------------------+