I am working on a project where we create multiple vms on a host machine. There are multiple hosts of this kind. These hosts are connected to a single LAN and the VMs are created using KVM. Qemu and libvirt are used alongwith. There is a requirement where I need to create multiple VLANs such that some VMs on a host can be a part of one VLAN and the rest could be a part of another VLAN. These VLANs are also spread across multiple hosts.

I was trying to achieve this using openvswitch but failed to succeed. I have followed many solutions available online but I am left in a confused state. Please help me.

I am not clear if openvswitch creates the VLANs or we need to create the VLANs at our end and openvswitch just helps in configuring those with the VMS?

If openvswitch creates the VLANs then what is the way to go?All the configuration that I have tried gives me an error or does not behave as expected. Please point me to the right direction.

有帮助吗?

解决方案

Read the section Setting VLAN tag from libvirt.org.

According to OpenVSwitch network type, you can directly specify VLAN tags via element <vlan> to a port from an OpenVSwitch bridge, and libvirt will manage the VLAN tags for your VM network.

Steps:

  1. configure OpenVSwitch bridge for your virtual machine by following the guide How to Use Open vSwitch with Libvirt
  2. add a new element <vlan> to your virtual machine network by specifying vlan id.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top