Libvirt & Openvswitch VLAN Tagging on the Fly

libvirtopenvswitchvirsh

I'm working on a project using libvirt with qemu and openvswitch on Debian 10.
I would like to be able to modify the configuration of a network card of a domain in bash with the update-device command of virsh.

For that I took an example from this article.

The initial configuration of the network interface is as follows:

<interface type='bridge'>
  <source bridge='waldorf0'/>
  <virtualport type='openvswitch'/>
  <model type='virtio'/>
</interface>

After the domain define and start, I get the mac address assigned to the interface and i product this file :

<interface type='bridge'>
   <mac address='52:54:XX:XX:XX:XX'/>
   <source bridge='waldorf0'/>
   <virtualport type='openvswitch'/>
   <model type='virtio'/>
   <vlan>
       <tag id='2'/>
   </vlan>
 </interface>

After I execute this command :

virsh update-device domain int_conf.xml --live --persistent

It returns :

error: Failed to update device from int_conf.xml
error: Operation not supported: unnable to change config on 'bridge' network type

If you have an idea to work around this problem in order to dynamically tag vlan on interfaces.
Thank you in advance

Best Answer

I solved the problem. This was because the XML file I used with the update-device command accidentally deleted parameters. I use the dumpxml command to get the exact configuration of the interface.

Related Topic