netplan fails to remove OVS vlan interfaces

Bug #1959147 reported by Brian Turek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
netplan
Fix Committed
Undecided
Unassigned

Bug Description

netplan fails to delete OVS vlan interfaces that were previously defined but were then removed from the configuration. The underlying problem appears to be that the "ovs-vsctl iface-to-br" command used (https://github.com/canonical/netplan/blob/331ca01908b68446a9a1f395616136678e617a1a/netplan/cli/ovs.py#L147) to test whether an interface is bonded or a vlan fails on "fake bridges" (this is how OVS defines vlans) which then causes it be treated incorrectly as a bonded interface. My testing seems to indicate the "ovs-vsctl br-exists" command may be a better choice for this test.

As a bare bones reproducible:

$ cat /etc/netplan/00-test.yaml
network:
  version: 2
  renderer: networkd
  openvswitch: {}
  ethernets:
    enp0s8: {} # physical ethernet interface
  bridges:
    br0:
      interfaces: [enp0s8]
      openvswitch: {}
  vlans:
    enp0s8_999:
      id: 999
      link: br0
      openvswitch: {}

$ sudo netplan apply
$ sudo ovs-vsctl show
709aacc0-aa1d-4888-ae99-e3096a99620a
    Bridge br0
        fail_mode: standalone
        Port br0
            Interface br0
                type: internal
        Port enp0s8_999
            tag: 999
            Interface enp0s8_999
                type: internal
        Port enp0s8
            Interface enp0s8
    ovs_version: "2.16.0"

# This does not work and note the error message
$ sudo ovs-vsctl iface-to-br enp0s8_999
ovs-vsctl: no interface named enp0s8_999

# Make edits to /etc/netplan/00-test.yaml to remove the vlan interface
$ cat /etc/netplan/00-test.yaml
network:
  version: 2
  renderer: networkd
  openvswitch: {}
  ethernets:
    enp0s8: {} # physical ethernet interface
  bridges:
    br0:
      interfaces: [enp0s8]
      openvswitch: {}

# Note the below has the same error message as the example iface-to-br command
$ sudo netplan apply
ovs-vsctl: no interface named enp0s8_999

$ sudo ovs-vsctl show
709aacc0-aa1d-4888-ae99-e3096a99620a
    Bridge br0
        fail_mode: standalone
        Port br0
            Interface br0
                type: internal
        Port enp0s8_999
            tag: 999
            Interface enp0s8_999
                type: internal
        Port enp0s8
            Interface enp0s8
    ovs_version: "2.16.0"

# Interface is still defined

Revision history for this message
Brian Turek (brian-turek) wrote :

I just submitted a PR on the Github repository at https://github.com/canonical/netplan/pull/256

Lukas Märdian (slyon)
Changed in netplan:
status: New → In Progress
Lukas Märdian (slyon)
Changed in netplan:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers