Add option lib-virt network with single tag
Closed this issue · 1 comments
2stacks commented
I need a way to create a lib-virt network that when used by a kvm guest would add the guests vnic as an access port in a specific vlan in openvswitch. Some lib-virt integrations such as MAAS do not support adding a vnic to a specific 'portgroup'.
Ex. network created with virsh net-define
<network>
<name>maas</name>
<uuid>3f1a2ff2-8d90-4883-906b-6a818d8baabf</uuid>
<forward mode='bridge'/>
<bridge name='ovsbr0'/>
<vlan>
<tag id='193'/>
</vlan>
<virtualport type='openvswitch'/>
</network>
Adding a kvm guest to this network results in the following openvswitch output
ovs-vsctl show
a0a40804-5b4e-4133-b0a6-1b186d95e147
Bridge "ovsbr0"
Port "vnet0"
tag: 193
Interface "vnet0"
Port "ovsbr0"
Interface "ovsbr0"
type: internal
Port "enp4s0"
Interface "enp4s0"
ovs_version: "2.5.4"
2stacks commented
Here's the kvm guests network config after adding to this type of bridge.
<interface type='bridge'>
<mac address='52:54:00:0d:ea:75'/>
<source network='maas' bridge='ovsbr0'/>
<vlan>
<tag id='193'/>
</vlan>
<virtualport type='openvswitch'>
<parameters interfaceid='a9fcdcb8-8e98-4bb6-a6ac-65c81f7d4905'/>
</virtualport>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</interface>