vinfra node iface create-vlan

Create a VLAN:

usage: vinfra node iface create-vlan [--ipv4 <ipv4>] [--ipv6 <ipv6>]
                                     [--gw4 <gw4>] [--gw6 <gw6>] [--mtu <mtu>]
                                     [--dhcp4 | --no-dhcp4]
                                     [--dhcp6 | --no-dhcp6]
                                     [--auto-routes-v4 | --ignore-auto-routes-v4]
                                     [--auto-routes-v6 | --ignore-auto-routes-v6]
                                     [--network <network>] [--node <node>]
                                     --iface <iface> --tag <tag>
--ipv4 <ipv4>
A comma-separated list of IPv4 addresses
--ipv6 <ipv6>
A comma-separated list of IPv6 addresses
--gw4 <gw4>
Gateway IPv4 address
--gw6 <gw6>
Gateway IPv6 address
--mtu <mtu>
MTU interface value
--dhcp4
Enable DHCPv4
--no-dhcp4
Disable DHCPv4
--dhcp6
Enable DHCPv6
--no-dhcp6
Disable DHCPv6
--auto-routes-v4
Enable automatic IPv4 routes
--ignore-auto-routes-v4
Ignore automatic IPv4 routes
--auto-routes-v6
Enable automatic IPv6 routes
--ignore-auto-routes-v6
Ignore automatic IPv6 routes
--network <network>
Network ID or name
--node <node>
Node ID or hostname (default: node001.vstoragedomain)
--iface <iface>
Interface name
--tag <tag>
VLAN tag number

Example:

# vinfra node iface create-vlan --iface eth2 --tag 100 --dhcp4 \
--node fd1e46de-6e17-4571-bf6b-1ac34ec1c225
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 0b978acd-367b-47ad-8572-4f4e6ffb8877 |
+---------+--------------------------------------+

This command creates a task to create a VLAN with the tag 100 on the network interface eth2 on the node with the ID fd1e46de-6e17-4571-bf6b-1ac34ec1c225.

Task outcome:

# vinfra task show 0b978acd-367b-47ad-8572-4f4e6ffb8877
+---------+-------------------------------------------------------------------+
| Field   | Value                                                             |
+---------+-------------------------------------------------------------------+
| args    | - fd1e46de-6e17-4571-bf6b-1ac34ec1c225                            |
| kwargs  | iface: eth2                                                       |
|         | tag: 100                                                          |
| name    | backend.presentation.network.tasks.NetworkInterfaceCreateVlanTask |
| result  | built_on: eth2                                                    |
|         | dhcp4: null                                                       |
|         | dhcp4_enabled: false                                              |
|         | dhcp6: null                                                       |
|         | dhcp6_enabled: false                                              |
|         | duplex: null                                                      |
|         | gw4: null                                                         |
|         | gw6: null                                                         |
|         | ignore_auto_routes_v4: true                                       |
|         | ignore_auto_routes_v6: true                                       |
|         | ipv4: []                                                          |
|         | ipv6:                                                             |
|         | - fe80::21c:42ff:fe81:27d0/64                                     |
|         | mac_addr: 00:1c:42:81:27:d0                                       |
|         | mtu: 1500                                                         |
|         | multicast: true                                                   |
|         | name: eth2.100                                                    |
|         | node_id: fd1e46de-6e17-4571-bf6b-1ac34ec1c225                     |
|         | plugged: true                                                     |
|         | roles_set: ''                                                     |
|         | rx_bytes: 0                                                       |
|         | rx_dropped: 0                                                     |
|         | rx_errors: 0                                                      |
|         | rx_overruns: 0                                                    |
|         | rx_packets: 0                                                     |
|         | speeds:                                                           |
|         |   current: null                                                   |
|         |   max: null                                                       |
|         | state: up                                                         |
|         | tag: 100                                                          |
|         | tx_bytes: 738                                                     |
|         | tx_dropped: 0                                                     |
|         | tx_errors: 0                                                      |
|         | tx_overruns: 0                                                    |
|         | tx_packets: 7                                                     |
|         | type: vlan                                                        |
| state   | success                                                           |
| task_id | 0b978acd-367b-47ad-8572-4f4e6ffb8877                              |
+---------+-------------------------------------------------------------------+