4.5. Configuring Management Node High Availability

4.5.1. Creating Management Node HA Cluster

4.5.1.1. Syntax

usage: vinfra cluster ha create [-h] [-f {json,table,value,yaml}] [-c COLUMN]
                                [--wait] [--timeout <seconds>] --virtual-ip
                                <network:ip> --nodes <nodes> [--force]

Create a HA configuration.

optional arguments:
  -h, --help            show this help message and exit
  --virtual-ip <network:ip>
                        HA configuration mapping in the format:
                        network: network to include in the HA configuration
                        (must include at least one of these traffic types:
                        Internal management, Admin panel, or Compute API);
                        ip: virtual IP address that will be used in the HA
                        configuration.
                        Specify this option multiple times to create a HA
                        configuration for multiple networks.
  --nodes <nodes>       A comma-separated list of node IDs or hostnames
  --force               Skip checks for minimal hardware requirements.
...

4.5.1.2. Sample Output

This command creates a task to create a management node HA cluster from nodes with the IDs 94d58604-6f30-4339-8578-adb7903b7277, f59dabdb-bd1c-4944-8af2-26b8fe9ff8d4, and 7d7d37b8-4c06-4f1a-b3a6-4b54257d70ce.

The command must specify the network with the traffic type Internal management as well as one with the traffic type Admin panel.

Important

After the HA cluster has been created, the admin panel will only be accessible at the provided public IP address. Log in to said address via SSH to continue managing Virtuozzo Infrastructure Platform with the vinfra CLI tool. You may also need to set the VINFRA_PASSWORD environment variable again, because you will access different HA cluster nodes on each log in where it may not have been set.

# vinfra cluster ha create --virtual-ip Private:10.37.130.200 \
--virtual-ip Public:10.94.41.244 --nodes 94d58604-6f30-4339-8578-adb7903b7277,\
f59dabdb-bd1c-4944-8af2-26b8fe9ff8d4,7d7d37b8-4c06-4f1a-b3a6-4b54257d70ce
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 80a00e55-335d-4d41-bac4-5fee4791d423 |
+---------+--------------------------------------+

Task outcome:

# vinfra task show 80a00e55-335d-4d41-bac4-5fee4791d423
+---------+--------------------------------------------------+
| Field   | Value                                            |
+---------+--------------------------------------------------+
| args    | - - - 6095a997-e5f1-493d-a750-41ddf277153b       |
|         |     - 10.37.130.200                              |
|         |   - - 358bdc39-cd8b-4565-8ebf-e7c12dcd1cf7       |
|         |     - 10.94.41.244                               |
|         | - - 94d58604-6f30-4339-8578-adb7903b7277         |
|         |   - f59dabdb-bd1c-4944-8af2-26b8fe9ff8d4         |
|         |   - 7d7d37b8-4c06-4f1a-b3a6-4b54257d70ce         |
| kwargs  | {}                                               |
| name    | backend.presentation.ha.tasks.CreateHaConfigTask |
| state   | success                                          |
| task_id | 80a00e55-335d-4d41-bac4-5fee4791d423             |
+---------+--------------------------------------------------+

4.5.2. Adding Nodes to Management Node HA Cluster

4.5.2.1. Syntax

usage: vinfra cluster ha join [-h] [-f {json,table,value,yaml}] [-c COLUMN]
                              [--wait] [--timeout <seconds>] --nodes <nodes>

Join node to the HA configuration.

optional arguments:
  -h, --help            show this help message and exit
  --nodes <nodes>       A comma-separated list of node IDs or hostnames
...

4.5.2.2. Sample Output

This command creates a task to add the node with the ID 4b83a87d-9adf-472c-91f0-782c47b2d5f1 to the management node HA cluster.

# vinfra cluster ha join --nodes 4b83a87d-9adf-472c-91f0-782c47b2d5f1
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 565e9146-254b-4f7a-a2ff-b7119c95baa9 |
+---------+--------------------------------------+

Task outcome:

# vinfra task show 565e9146-254b-4f7a-a2ff-b7119c95baa9
+---------+-----------------------------------------------+
| Field   | Value                                         |
+---------+-----------------------------------------------+
| args    | - - 4b83a87d-9adf-472c-91f0-782c47b2d5f1      |
| kwargs  | {}                                            |
| name    | backend.presentation.ha.tasks.JoinHaNodesTask |
| state   | success                                       |
| task_id | 565e9146-254b-4f7a-a2ff-b7119c95baa9          |
+---------+-----------------------------------------------+

4.5.3. Showing Management Node HA Configuration

4.5.3.1. Syntax

usage: vinfra cluster ha show [-h] [-f {json,table,value,yaml}] [-c COLUMN]

Display the HA configuration.
...

4.5.3.2. Sample Output

This command shows the management node HA cluster configuration.

# vinfra cluster ha show
+-----------------------+---------------------------------------------------+
| Field                 | Value                                             |
+-----------------------+---------------------------------------------------+
| ha_cluster_location   | https://10.37.130.200:8888                        |
| nodes                 | - id: 7d7d37b8-4c06-4f1a-b3a6-4b54257d70ce        |
|                       |   interface: xxx                                  |
|                       |   ipaddr: 10.37.130.103                           |
|                       |   is_primary: false                               |
|                       | - id: 94d58604-6f30-4339-8578-adb7903b7277        |
|                       |   interface: xxx                                  |
|                       |   ipaddr: 10.37.130.101                           |
|                       |   is_primary: true                                |
|                       | - id: f59dabdb-bd1c-4944-8af2-26b8fe9ff8d4        |
|                       |   interface: xxx                                  |
|                       |   ipaddr: 10.37.130.102                           |
|                       |   is_primary: false                               |
|                       | - id: 4b83a87d-9adf-472c-91f0-782c47b2d5f1        |
|                       |   interface: xxx                                  |
|                       |   ipaddr: 10.37.130.104                           |
|                       |   is_primary: false                               |
| primary_node_location | https://10.94.41.23:8888                          |
| virtual_ips           | - ip: 10.37.130.200                               |
|                       |   roles_set: 6095a997-e5f1-493d-a750-41ddf277153b |
|                       | - ip: 10.94.41.244                                |
|                       |   roles_set: 358bdc39-cd8b-4565-8ebf-e7c12dcd1cf7 |
+-----------------------+---------------------------------------------------+

4.5.4. Releasing Nodes from Management Node HA Cluster

4.5.4.1. Syntax

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

Relase node from the HA configuration.

optional arguments:
  -h, --help            show this help message and exit
  --nodes <nodes>       A comma-separated list of node IDs or hostnames
...

4.5.4.2. Sample Output

This command creates a task to release the node with the ID 4b83a87d-9adf-472c-91f0-782c47b2d5f1 from the management node HA cluster.

# vinfra cluster ha release --nodes 4b83a87d-9adf-472c-91f0-782c47b2d5f1
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | c1f3e9c3-0a7b-455a-96d4-cef3b7e86e62 |
+---------+--------------------------------------+

Task outcome:

# vinfra task show c1f3e9c3-0a7b-455a-96d4-cef3b7e86e62
+---------+--------------------------------------------------+
| Field   | Value                                            |
+---------+--------------------------------------------------+
| args    | - - 4b83a87d-9adf-472c-91f0-782c47b2d5f1         |
| kwargs  | {}                                               |
| name    | backend.presentation.ha.tasks.DisjoinHaNodesTask |
| state   | success                                          |
| task_id | c1f3e9c3-0a7b-455a-96d4-cef3b7e86e62             |
+---------+--------------------------------------------------+