3.4. Managing Compute Nodes

3.4.1. Adding Nodes to Compute Cluster

3.4.1.1. Syntax

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

Add a node to the compute cluster.

optional arguments:
  -h, --help            show this help message and exit
  --nodes <nodes>       A comma-separated list of node IDs or hostnames
  --force               Skip checks for minimal hardware requirements.
...

3.4.1.2. Sample Output

This command creates a task to add the node with the ID 827a1f4e-56e5-404f-9113-88748c18f0c2 to the compute cluster.

# vinfra service compute node add --node 827a1f4e-56e5-404f-9113-88748c18f0c2
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 4c58e63c-31b6-406a-8070-9197445ec794 |
+---------+--------------------------------------+

Task outcome:

# vinfra task show 4c58e63c-31b6-406a-8070-9197445ec794
+----------+---------------------------------------------------------------+
| Field    | Value                                                         |
+----------+---------------------------------------------------------------+
| args     | []                                                            |
| kwargs   | nodes:                                                        |
|          | - 827a1f4e-56e5-404f-9113-88748c18f0c2                        |
| name     | backend.presentation.compute.tasks.ComputeClusterAddNodesTask |
| progress | 100                                                           |
| state    | success                                                       |
| task_id  | 4c58e63c-31b6-406a-8070-9197445ec794                          |
+----------+---------------------------------------------------------------+

3.4.2. Listing Nodes in Compute Cluster

3.4.2.1. Syntax

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

List compute nodes.
...

3.4.2.2. Sample Output

This command lists nodes in the compute cluster.

# vinfra service compute node list
+--------------------------------------+-----------------------------------+-------+-----+
| id                                   | hypervisor_hostname               | state | vms |
+--------------------------------------+-----------------------------------+-------+-----+
| 7ffa9540-5a20-41d1-b203-e3f349d62565 | stor-1.example.com.vstoragedomain | up    |   1 |
| 6e8afc28-7f71-4848-bdbe-7c5de64c5013 | stor-3.example.com.vstoragedomain | up    |   1 |
| 02ff64ae-5800-4090-b958-18b1fe8f5060 | stor-2.example.com.vstoragedomain | up    |   1 |
| 827a1f4e-56e5-404f-9113-88748c18f0c2 | stor-5.example.com.vstoragedomain | up    |   0 |
| 37c70bfb-c289-4794-8be4-b7a40c2b6d95 | stor-4.example.com.vstoragedomain | up    |   1 |
+--------------------------------------+-----------------------------------+-------+-----+

3.4.3. Showing Compute Node Details

3.4.3.1. Syntax

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

Display compute node details.

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

3.4.3.2. Sample Output

This command shows the details of the compute node with the ID 7ffa9540-5a20-41d1-b203-e3f349d62565.

# vinfra service compute node show 7ffa9540-5a20-41d1-b203-e3f349d62565
+---------------------+----------------------------------------------+
| Field               | Value                                        |
+---------------------+----------------------------------------------+
| host_ip             | 10.37.130.101                                |
| hypervisor_hostname | stor-1.example.com.vstoragedomain            |
| hypervisor_id       | 1                                            |
| id                  | 7ffa9540-5a20-41d1-b203-e3f349d62565         |
| state               | up                                           |
| statistics          | compute:                                     |
|                     |   block_capacity: 0                          |
|                     |   block_usage: 0                             |
|                     |   cpu_usage: 0                               |
|                     |   mem_total: 0                               |
|                     |   mem_usage: 0                               |
|                     |   vcpus: 0                                   |
|                     | datetime: '2018-09-11T16:39:15.290999+00:00' |
|                     | physical:                                    |
|                     |   cpu_cores: 2                               |
|                     |   mem_free: 414105600                        |
|                     |   mem_total: 8201244672                      |
|                     | reserved:                                    |
|                     |   cpus: 1                                    |
|                     |   memory: 5773                               |
| vms                 | 0                                            |
+---------------------+----------------------------------------------+

3.4.4. Fencing Compute Nodes

3.4.4.1. Syntax

usage: vinfra service compute node fence [-h] <node>

Fence a compute node.

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

3.4.4.2. Sample Output

This command fences the node with the ID e6255aed-d6e7-41b2-ba90-86164c1cd9a6.

# vinfra service compute node fence e6255aed-d6e7-41b2-ba90-86164c1cd9a6
Operation successful

3.4.5. Unfencing Compute Nodes

usage: vinfra service compute node unfence [-h] <node>

Unfence a compute node.

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

3.4.5.1. Sample Output

This command unfences the node with the ID e6255aed-d6e7-41b2-ba90-86164c1cd9a6.

# vinfra service compute node unfence e6255aed-d6e7-41b2-ba90-86164c1cd9a6
Operation successful

3.4.6. Releasing Nodes from Compute Cluster

3.4.6.1. Syntax

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

Release a node from the compute cluster.

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

3.4.6.2. Sample Output

This command creates a task to release the node with the ID 827a1f4e-56e5-404f-9113-88748c18f0c2 from the compute cluster.

# vinfra service compute node release --node 827a1f4e-56e5-404f-9113-88748c18f0c2
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 3b39738c-80a6-40a6-a50d-c3c8118ed212 |
+---------+--------------------------------------+

Task outcome:

# vinfra task show 3b39738c-80a6-40a6-a50d-c3c8118ed212
+---------+------------------------------------------------------------------+
| Field   | Value                                                            |
+---------+------------------------------------------------------------------+
| args    | []                                                               |
| kwargs  | nodes:                                                           |
|         | - 827a1f4e-56e5-404f-9113-88748c18f0c2                           |
| name    | backend.presentation.compute.tasks.ComputeClusterDeleteNodesTask |
| state   | success                                                          |
| task_id | 3b39738c-80a6-40a6-a50d-c3c8118ed212                             |
+---------+------------------------------------------------------------------+