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:
-
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
-
Restart the network service:
systemctl restart network
-
Check that "vlan2" has been added to the list of network interfaces:
ip address
Step 2. Configure network and template in VMmanager
Network configuration
- Go to Cluster settings → Networks → Add.
- Enter any Name in VMmanager. Eg. "vmbr_vlan2".
- Check that you have selected "Network bridge" in Network type.
- Enter the name of the Bridged networking in the operating system. We recommend using the same name for Name and Bridged networking.
- Enable the option Connect interface.
- Specify "vlan2" in External interface.
Template configuration
To make virtual machines run in a separate VLAN, create a template associated with the required bridge:
- Go to Cluster settings → VM templates → Add.
- Select the Network (bridged networking) where virtual machines will run. Eg. "vmbr_vlan2".
- Enter any other parameters and click on Ok.
Step 3. Create a virtual machine
Create a new virtual machine based on the new template:
- Go to Management → Virtual machines → Add.
- 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.
- Enter any other parameters and click on Ok.