I'm trying to integrate openvswitch into my libvirt/qemu setup on Centos7. Everything is actually working very well aside from the fact that when I restart my network services I lose the vnet ports that were added by libvirt/qemu in my ovs switch database. The interfaces still exist if I do an ip link show
but not in the switch db. This obviously causes my VMs to lose network connectivity. I'm defining the bridge and vlan (or lack of vlan) in my domain xml files like this:
<interface type='bridge'>
<mac address='52:54:32:a6:21:98'/>
<source bridge='ovsbr0'/>
<vlan>
<tag id='46'/>
</vlan>
<virtualport type='openvswitch'>
<parameters interfaceid='dbda261c-9a17-4a85-9839-53d43509ca0f'/>
</virtualport>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
So when I start my VMs up, the ports and vlans are automatically added like this:
# ovs-vsctl show
cf9b8458-9b63-4cf1-add9-3ab5da81dc32
Bridge "ovsbr0"
Port "vnet0"
tag: 46
Interface "vnet0"
Port "ovsbr0"
Interface "ovsbr0"
type: internal
Port "vnet2"
Interface "vnet2"
Port "bond0"
Interface "bond0"
Port "vnet1"
tag: 49
Interface "vnet1"
ovs_version: "2.5.1"
But when I do a network restart I end up with this:
# ovs-vsctl show
cf9b8458-9b63-4cf1-add9-3ab5da81dc32
Bridge "ovsbr0"
Port "ovsbr0"
Interface "ovsbr0"
type: internal
Port "bond0"
Interface "bond0"
ovs_version: "2.5.1"
I have no idea how to fix this or what the correct solution is. I don't plan on doing a ton of network restarts, but if I have to I want to be assured that I won't have to manually add my ovs ports back in after I'm done. Is there a way to force libvirt or qemu to recreate these for me or anything?
Any help would be greatly appreciated! Thanks!
0 Answers