VMmanager Cloud Documentation

How to use different VLANs for VPS

This article describes how to configure VMmanager provided that: 

  • the network interface connected to the switch with configured trunk-port and VLAN is called "eth0";
  • you have added VLAN with ID2 for virtual machines. 

Step 1. Add VLAN to every cluster node 

To add a VLAN to the cluster node: 

  1. Create the file /etc/sysconfig/network-scripts/ifcfg-vlan2

    ONBOOT=yes
    
    TYPE=Ethernet
    
    VLAN=yes
    
    VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
    
    DEVICE=vlan2
    
    PHYSDEV=eth0
    
    VLAN_ID=2
    
    BOOTPROTO=static
    
    NM_CONTROLLED=no
  2. Restart the network service: 

    systemctl restart network
  3. Check that "vlan2" has been added to the list of network interfaces:

    ip address

Step 2. Configure network and template in VMmanager

Network configuration 

  1. Go to Cluster settings  → Networks Add.
  2. Enter any Name in VMmanager. Eg. "vmbr_vlan2". 
  3. Check that you have selected "Network bridge" in Network type
  4. Enter the name of the Bridged networking in the operating system. We recommend using the same name for Name and Bridged networking. 
  5. Enable the option Connect interface
  6. Specify "vlan2" in External interface

Template configuration 

To make virtual machines run in a separate VLAN, create a template associated with the required bridge:

  1. Go to Cluster settings → VM templates Add
  2. Select the Network (bridged networking) where virtual machines will run. Eg. "vmbr_vlan2". 
  3. Enter any other parameters and click on Ok

Step 3. Create a virtual machine

Create a new virtual machine based on the new template:

  1. Go to ManagementVirtual machinesAdd.
  2. Select a VM template associated with the required network. Eg. "VM in VLAN2" uses the network vmbr_vlan2. To make the virtual machine use this network, select "VM in VLAN2" in VM template. 
  3. Enter any other parameters and click on Ok