Connecting virtual switches to trunk interfaces

If you plan to use a large number of VLAN-based networks for virtual machines, you can benefit from the automated procedure of VLAN-based network creation. When you create a VLAN-based network in the compute cluster, the system automatically creates an associated infrastructure network and configures VLAN network interfaces on all of the compute nodes via the distributed virtual switch.

To use the automated VLAN-based network creation, consider the following cases:

  • If a node's trunk interface is connected to a virtual switch (its name has the format br-<interface>), you can proceed to creating VLAN-based networks in the compute cluster.
  • If a node's trunk interface has no VLANs and is not connected to a virtual switch, assign the VM public traffic type to the infrastructure network connected to this trunk interface. The virtual switch will be configured automatically on the trunk interface after creating a VLAN-based network.
  • If you have existing VLANs but no virtual switch connected to a trunk interface, convert the trunk interface configuration to the virtual switch one, as described below.

If your network configuration includes only a few VLAN-based networks, you can create VLAN network interfaces separately on each compute node, as described in Creating VLAN interfaces.

Limitations

  • For VLAN-based networks, the corresponding VLAN IDs must be configured on the physical switches connected to the compute nodes.

To connect a trunk network interface to a virtual switch

  1. Check whether VLAN network interfaces connected to your network can be converted to Open vSwitch VLAN. For example:

    # vinfra cluster network conversion precheck --network mynet
    +---------------------+-------------------------------------------------+
    | Field               | Value                                           |
    +---------------------+-------------------------------------------------+
    | affected_interfaces | - interface: eth0                               |
    |                     |   node_id: 13cb6cbf-0b9b-be0f-bb56-8ed6a0e9225c |
    |                     |   vlans:                                        |
    |                     |   - eth0.1                                      |
    |                     | - interface: eth0                               |
    |                     |   node_id: 6e5d9e91-5c4e-a874-38cd-fe6f4bef10a4 |
    |                     |   vlans:                                        |
    |                     |   - eth0.1                                      |
    |                     | - interface: eth0                               |
    |                     |   node_id: 1053e85b-351c-6113-5623-e0c6c64995e7 |
    |                     |   vlans:                                        |
    |                     |   - eth0.1                                      |
    | affected_networks   | - mynet                                         |
    | physical_network    | Public                                          |
    +---------------------+-------------------------------------------------+
    
  2. Convert the VLAN network interfaces to Open vSwitch VLAN. During the conversion you may experience connection timeouts. For example:

    # vinfra cluster network conversion start --network mynet
    +---------+--------------------------------------+
    | Field   | Value                                |
    +---------+--------------------------------------+
    | task_id | 058fc247-03a8-49fa-90e1-1e073dbafec9 |
    +---------+--------------------------------------+
    

    If your trunk network interface is not assigned to any infrastructure network, specify the name of a new infrastructure network by using the --physical-network-name <name> option. The new infrastructure network will be automatically created with the given name and assigned to the trunk interface.

  3. Check the conversion status. For example:

    # vinfra cluster network conversion status 058fc247-03a8-49fa-90e1-1e073dbafec9
    +---------------------+-------------------------------------------------+
    | Field               | Value                                           |
    +---------------------+-------------------------------------------------+
    | affected_interfaces | - interface: eth0                               |
    |                     |   node_id: 13cb6cbf-0b9b-be0f-bb56-8ed6a0e9225c |
    |                     |   vlans:                                        |
    |                     |   - eth0.1                                      |
    |                     | - interface: eth0                               |
    |                     |   node_id: 6e5d9e91-5c4e-a874-38cd-fe6f4bef10a4 |
    |                     |   vlans:                                        |
    |                     |   - eth0.1                                      |
    |                     | - interface: eth0                               |
    |                     |   node_id: 1053e85b-351c-6113-5623-e0c6c64995e7 |
    |                     |   vlans:                                        |
    |                     |   - eth0.1                                      |
    | flow                | done                                            |
    | physical_network    | Public                                          |
    | state               | success                                         |
    | task_id             | 058fc247-03a8-49fa-90e1-1e073dbafec9            |
    +---------------------+-------------------------------------------------+
    

When the conversion is complete, you will be able to create more VLAN interfaces on the trunk network interface by using the simplified procedure.