[ovs-discuss] Port persistence after a network.service restart

Alexander Witte alexander.witte at baicanada.com
Thu Nov 22 23:11:03 UTC 2018


Hi!

Quick question hopefully someone can help me out with!

Environment- OVS and KVM running in Fedora29 Desktop.

I’m creating my OVS ports programmatically via virt-install on VM creation.  (I’ve defined a libvirt network that associates some portgroups with the OVS).  This works fine and adds the ports to the OVS.  When I restart the network.service on the host, it wipes all the port configs in OVS.  Any tips on for what I can do to make these ports persistent?

Example of a virt-install command:

virt-install  -n wlc  --description "Wireless Lan Controller VM"  --os-type=Linux  --ram=4096  --vcpus=1 --cpu mode=host-passthrough  --disk device=cdrom,bus=sata --disk path=/var/lib/libvirt/qemu/wlc2.img,size=8,sparse=true,format=raw,bus=ide --network network:CentralNetwork,portgroup=mgmt,target=wlc-mgmt,model=virtio --network network:CentralNetwork,portgroup=wlc-trunk,target=wlc-trunk,model=virtio --graphics vnc,listen=0.0.0.0,port=5901 --boot cdrom,hd

Here’s my libvirt network:

[root at lannardemo ~]# virsh net-dumpxml CentralNetwork
<network connections='5'>
  <name>CentralNetwork</name>
  <uuid>7e2b0cf2-2d7e-4163-9fd3-599bad514a02</uuid>
  <forward mode='bridge'/>
  <bridge name='rootbridge'/>
  <virtualport type='openvswitch'/>
  <portgroup name='mgmt' default='yes'>
  </portgroup>
  <portgroup name='capwap'>
    <vlan>
      <tag id='2'/>
    </vlan>
  </portgroup>
  <portgroup name='wan'>
  </portgroup>
  <portgroup name='client'>
    <vlan>
      <tag id='101'/>
    </vlan>
  </portgroup>
  <portgroup name='wlc-trunk'>
    <vlan>
      <tag id='2'/>
    </vlan>
  </portgroup>
</network>

Here’s my OVS:

[root at lannardemo ~]# ovs-vsctl show
43553455-1708-4291-a000-cef31dc3620a
    Bridge rootbridge
        Port "enp5s0"
            Interface "enp5s0"
        Port utility-client
            tag: 101
            Interface utility-client
        Port utility-capwap
            tag: 2
            Interface utility-capwap
        Port rootbridge
            Interface rootbridge
                type: internal
        Port utility-mgmt
            Interface utility-mgmt
    ovs_version: "2.10.0"
[root at lannardemo ~]#

Thanks!!
AlexW
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20181122/e57a042a/attachment.html>


More information about the discuss mailing list