2.2. Managing Traffic Types and Networks

2.2.1. Creating Traffic Types

2.2.1.1. Syntax

usage: vinfra cluster traffic-type create [-h] [-f {json,table,value,yaml}]
                                          [-c COLUMN] --port <port>
                                          <traffic-type-name>

Create a new traffic type.

positional arguments:
  <traffic-type-name>   Traffic type name

optional arguments:
  -h, --help            show this help message and exit
  --port <port>         Traffic type port
...

2.2.1.2. Sample Output

This command creates a custom traffic type MyTrafficType on port 6900.

# vinfra cluster traffic-type create "MyTrafficType" --port 6900
+-----------+-----------------+
| Field     | Value           |
+-----------+-----------------+
| exclusive | False           |
| name      | MyTrafficType   |
| port      | 6900            |
| type      | custom          |
+-----------+-----------------+

2.2.2. Listing Traffic Types

2.2.2.1. Syntax

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

List available traffic types.
...

2.2.2.2. Sample Output

This command lists all traffic types in Virtuozzo Infrastructure Platform.

# vinfra cluster traffic-type list
+---------------------+------------+-----------+------+
| name                | type       | exclusive | port |
+---------------------+------------+-----------+------+
| Storage             | predefined | True      |      |
| Internal management | predefined | True      |      |
| OSTOR private       | predefined | True      |      |
| S3 public           | predefined | False     |      |
| iSCSI               | predefined | False     |      |
| NFS                 | predefined | False     |      |
| ABGW private        | predefined | True      |      |
| ABGW public         | predefined | False     |      |
| Admin panel         | predefined | False     |      |
| SSH                 | predefined | False     |      |
| VM public           | predefined | False     |      |
| VM private          | predefined | True      |      |
| Compute API         | predefined | True      |      |
| MyTrafficType       | custom     | False     | 6900 |
+---------------------+------------+-----------+------+

2.2.3. Showing Traffic Type Details

2.2.3.1. Syntax

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

Show details of a traffic type.

positional arguments:
  <traffic-type>        Traffic type name
...

2.2.3.2. Sample Output

This command shows the details of the traffic type Storage.

# vinfra cluster traffic-type show Storage
+-----------+------------+
| Field     | Value      |
+-----------+------------+
| exclusive | True       |
| name      | Storage    |
| port      |            |
| type      | predefined |
+-----------+------------+

2.2.4. Changing Traffic Type Parameters

2.2.4.1. Syntax

usage: vinfra cluster traffic-type set [-h] [-f {json,table,value,yaml}]
                                       [-c COLUMN] [--name <name>]
                                       [--port <port>]
                                       <traffic-type>

Modify traffic type parameters.

positional arguments:
  <traffic-type>        Traffic type name

optional arguments:
  -h, --help            show this help message and exit
  --name <name>         A new name for the traffic type
  --port <port>         A new port for the traffic type
...

2.2.4.2. Sample Output

This command renames the traffic type MyTrafficType to My other traffic type and changes its port to 6901.

# vinfra cluster traffic-type set "MyTrafficType" \
--name "My other traffic type" --port 6901
+-----------+-----------------------+
| Field     | Value                 |
+-----------+-----------------------+
| exclusive | False                 |
| name      | My other traffic type |
| port      | 6901                  |
| type      | custom                |
+-----------+-----------------------+

2.2.5. Deleting Traffic Types

2.2.5.1. Syntax

usage: vinfra cluster traffic-type delete [-h] <traffic-type>

Delete a traffic type.

positional arguments:
  <traffic-type>  Traffic type name
...

2.2.5.2. Sample Output

This command deletes the custom traffic type My other traffic type.

# vinfra cluster traffic-type delete "My other traffic type"
Operation successful

2.2.6. Creating Networks

2.2.6.1. Syntax

usage: vinfra cluster network create [-h] [-f {json,table,value,yaml}]
                                     [-c COLUMN]
                                     [--traffic-types <traffic-types>]
                                     <network-name>

Create a new network.

positional arguments:
  <network-name>        Network name

optional arguments:
  -h, --help            show this help message and exit
  --traffic-types <traffic-types>
                        A comma-separated list of traffic type IDs or names
...

2.2.6.2. Sample Output

This command creates a custom network MyNet and assigns the traffic type SSH to it.

# vinfra cluster network create MyNet --traffic-types ssh
+-------+--------------------------------------+
| Field | Value                                |
+-------+--------------------------------------+
| id    | 03d5eeb3-1833-4626-885d-dd066635f5de |
| name  | MyNet                                |
| roles | - SSH                                |
| type  | Custom                               |
+-------+--------------------------------------+

2.2.7. Listing Networks

2.2.7.1. Syntax

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

List available networks.
...

2.2.7.2. Sample Output

This command lists all networks in Virtuozzo Infrastructure Platform.

# vinfra cluster network list
+--------------------------------------+---------+-----------------------+
| id                                   | name    | roles                 |
+--------------------------------------+---------+-----------------------+
| 358bdc39-cd8b-4565-8ebf-e7c12dcd1cf7 | Public  | - ABGW public         |
|                                      |         | - iSCSI               |
|                                      |         | - NFS                 |
|                                      |         | - S3 public           |
|                                      |         | - SSH                 |
|                                      |         | - Admin Panel         |
| 6095a997-e5f1-493d-a750-41ddf277153b | Private | - ABGW private        |
|                                      |         | - Internal Management |
|                                      |         | - OSTOR private       |
|                                      |         | - SSH                 |
|                                      |         | - Storage             |
+--------------------------------------+---------+-----------------------+

2.2.8. Showing Network Details

2.2.8.1. Syntax

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

Show details of a network.

positional arguments:
  <network>             Network ID or name
...

2.2.8.2. Sample Output

This command shows the details of the custom network MyNet.

# vinfra cluster network show MyNet
+-------+--------------------------------------+
| Field | Value                                |
+-------+--------------------------------------+
| id    | 03d5eeb3-1833-4626-885d-dd066635f5de |
| name  | MyNet                                |
| roles | - SSH                                |
| type  | Custom                               |
+-------+--------------------------------------+

2.2.9. Changing Network Parameters

2.2.9.1. Syntax

usage: vinfra cluster network set [-h] [-f {json,table,value,yaml}]
                                  [-c COLUMN] [--wait] [--timeout <seconds>]
                                  [--name <network-name>]
                                  [--traffic-types <traffic-types> | --add-traffic-types <traffic-types> | --del-traffic-types <traffic-types>]
                                  <network>

Modify network parameters.

positional arguments:
  <network>             Network ID or name

optional arguments:
  -h, --help            show this help message and exit
  --name <network-name>
                        Network name
  --traffic-types <traffic-types>
                        A comma-separated list of traffic type names
                        (overwrites network's current traffic types)
  --add-traffic-types <traffic-types>
                        A comma-separated list of traffic type names (adds the
                        specified traffic types to the network)
  --del-traffic-types <traffic-types>
                        A comma-separated list of traffic type names (removes
                        the specified traffic types from the network)
...

2.2.9.2. Sample Output

This command creates a task to rename the network MyNet to MyOtherNet and assign to it the traffic types iSCSI and NFS.

# vinfra cluster network set MyNet --name MyOtherNet --add-traffic-types iscsi,nfs
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | b29f6f66-37d7-47de-b02e-9f4087ad932b |
+---------+--------------------------------------+

Task outcome:

# vinfra task show b29f6f66-37d7-47de-b02e-9f4087ad932b
+---------+-------------------------------------------------------------+
| Field   | Value                                                       |
+---------+-------------------------------------------------------------+
| args    | - 03d5eeb3-1833-4626-885d-dd066635f5de                      |
| kwargs  | name: MyOtherNet                                            |
|         | roles:                                                      |
|         | - ssh                                                       |
|         | - iscsi                                                     |
|         | - nfs                                                       |
| name    | backend.presentation.network.roles.tasks.RolesSetChangeTask |
| result  | id: 03d5eeb3-1833-4626-885d-dd066635f5de                    |
|         | name: MyOtherNet                                            |
|         | roles:                                                      |
|         | - iSCSI                                                     |
|         | - NFS                                                       |
|         | - SSH                                                       |
|         | type: Custom                                                |
| state   | success                                                     |
| task_id | b29f6f66-37d7-47de-b02e-9f4087ad932b                        |
+---------+-------------------------------------------------------------+

2.2.10. Changing Parameters of Multiple Networks

2.2.10.1. Syntax

usage: vinfra cluster network set-bulk [-h] [-f {json,table,value,yaml}]
                                       [-c COLUMN] [--wait]
                                       [--timeout <seconds>] --network
                                       <network>:<traffic-types>

Modify traffic types of multiple networks.

optional arguments:
  -h, --help            show this help message and exit
  --network <network>:<traffic-types>
                        Network configuration in the format:
                        network: network ID or name;
                        traffic-types: a comma-separated list of traffic type
                        names;
                        (this option can be used multiple times).
...

2.2.10.2. Sample Output

This command creates a task to change the traffic type set of the network MyNet1 to SNMP and that of MyNet2 to SSH and SNMP.

# vinfra cluster network set-bulk --network MyNet1:snmp --network MyNet2:ssh,snmp
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | c774f55d-c45b-42cd-ac9e-16fc196e9283 |
+---------+--------------------------------------+

Task outcome:

# vinfra task show c774f55d-c45b-42cd-ac9e-16fc196e9283
+---------+-----------------------------------------------------------------+
| Field   | Value                                                           |
+---------+-----------------------------------------------------------------+
| details |                                                                 |
| name    | backend.presentation.network.roles.tasks.RolesSetBulkChangeTask |
| result  | - id: adf49487-9deb-4180-bb0c-08a906257981                      |
|         |   name: MyNet1                                                  |
|         |   roles:                                                        |
|         |   - SNMP                                                        |
|         |   type: Custom                                                  |
|         | - id: 3f6ff4a3-31bc-440b-a36f-d755c80d5932                      |
|         |   name: MyNet2                                                  |
|         |   roles:                                                        |
|         |   - SNMP                                                        |
|         |   - SSH                                                         |
|         |   type: Custom                                                  |
| state   | success                                                         |
| task_id | c774f55d-c45b-42cd-ac9e-16fc196e9283                            |
+---------+-----------------------------------------------------------------+

2.2.11. Deleting Networks

2.2.11.1. Syntax

usage: vinfra cluster network delete [-h] <network>

Delete a network.

positional arguments:
  <network>   Network ID or name
...

2.2.11.2. Sample Output

This command deletes the network MyOtherNet.

# vinfra cluster network delete MyOtherNet
Operation successful