Applying Netplan with OVS other-config Failing

Bug #1918197 reported by Dave Heinz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
New
Undecided
Unassigned

Bug Description

I have a link which is an OVS bridge that has the other-config:hwaddr applied. When applying this the first time, all works as expected.

However, when running "Netplan apply" the second time, a "remove" command is attempted on the old configuration and ovs-vsctl errors on the command.

This is the YAML file for the port:

network:
    version: 2
    renderer: networkd
    ethernets:
        ens3: {}
    bridges:
        wan1:
            dhcp4: true
            dhcp4-overrides:
                    route-metric: 10
            interfaces: [ens3]
            mtu: 1450
            openvswitch:
                    other-config:
                            hwaddr: fa:16:3e:4b:19:3a

This is seen in syslog when attempting to run it again when new configuration for other ports are added:

Mar 8 20:55:59 pod-focal-1 ovs-vsctl: ovs|00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl remove Bridge wan1 other-config hwaddr fa:16:3e:4b:19:3a
Mar 8 20:55:59 pod-focal-1 ovs-vsctl: ovs|00002|db_ctl_base|ERR|fa:16:3e:4b:19:3a: unexpected ":" parsing set of 1 or more strings

root@pod-focal-1:~# netplan apply
ovs-vsctl: fa:16:3e:4b:19:3a: unexpected ":" parsing set of 1 or more strings
Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
    netplan.main()
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 257, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 55, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 257, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 154, in command_apply
    NetplanApply.process_ovs_cleanup(config_manager, old_files_ovs, restart_ovs, exit_on_error)
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 315, in process_ovs_cleanup
    apply_ovs_cleanup(config_manager, ovs_old, ovs_current)
  File "/usr/share/netplan/netplan/cli/ovs.py", line 168, in apply_ovs_cleanup
    clear_setting(t, iface, setting, val)
  File "/usr/share/netplan/netplan/cli/ovs.py", line 94, in clear_setting
    _del_dict(type, iface, split[1], split[2], value)
  File "/usr/share/netplan/netplan/cli/ovs.py", line 52, in _del_dict
    subprocess.check_call([OPENVSWITCH_OVS_VSCTL, 'remove', type, iface, column, key, value])
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/ovs-vsctl', 'remove', 'Bridge', 'wan1', 'other-config', 'hwaddr', 'fa:16:3e:4b:19:3a']' returned non-zero exit status 1.

OVS:
root@pod-focal-1:~# ovs-vsctl --version
ovs-vsctl (Open vSwitch) 2.14.2
DB Schema 8.2.0

Ubuntu 20.04:
root@pod-focal-1:~# netplan info
netplan.io:
  features:
  - generate-just-in-time
  - generated-supplicant
  - dbus-config
  - auth-phase2
  - dhcp-use-domains
  - ipv6-mtu
  - modems
  - sriov
  - openvswitch
  website: https://netplan.io/

root@pod-focal-1:~# dpkg -l | grep netplan
ii libnetplan0:amd64 0.101-0ubuntu3~20.04.2 amd64 YAML network configuration abstraction runtime library
ii netplan.io 0.101-0ubuntu3~20.04.2 amd64 YAML network configuration abstraction for various backends
root@pod-focal-1:~# uname -a
Linux pod-focal-1 5.8.0-44-generic #50~20.04.1-Ubuntu SMP Wed Feb 10 21:07:30 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Dave Heinz (disirk74) wrote :

This appears to be a duplicate of "1913906" ...

Revision history for this message
Dave Heinz (disirk74) wrote :

For my use case, I changed Line 52 in /usr/share/netplan/netplan/cli/ovs.py from:

subprocess.check_call([OPENVSWITCH_OVS_VSCTL, 'remove', type, iface, column, key, value])

to:

subprocess.check_call([OPENVSWITCH_OVS_VSCTL, 'remove', type, iface, column, key])

It now works for MY scenario, but not sure it would work for all.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.