On Openvswitch 2.13.1-0ubuntu0.20.04.1, when ovn-chassis tries to re-configure dpdk-bonds after they were first misconfigured (no matching MAC addresses on host), the following traceback is seen:
unit-ovn-chassis-dpdk-0: 19:14:44 INFO unit.ovn-chassis-dpdk/0.juju-log Creating bridge br-dpdk
unit-ovn-chassis-dpdk-0: 19:14:44 WARNING unit.ovn-chassis-dpdk/0.config-changed ovs-vsctl: "--may-exist add-bond br-dpdk dpdk-bond0 dpdk-f92ad9f dpdk-abd308d" but dpdk-bond0 actually has interface(s) dpdk-bond0
unit-ovn-chassis-dpdk-0: 19:14:44 ERROR unit.ovn-chassis-dpdk/0.juju-log Hook error:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-ovn-chassis-dpdk-0/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 74, in main
bus.dispatch(restricted=restricted_mode)
File "/var/lib/juju/agents/unit-ovn-chassis-dpdk-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 390, in dispatch
_invoke(other_handlers)
File "/var/lib/juju/agents/unit-ovn-chassis-dpdk-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke
handler.invoke()
File "/var/lib/juju/agents/unit-ovn-chassis-dpdk-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke
self._action(*args)
File "/var/lib/juju/agents/unit-ovn-chassis-dpdk-0/charm/reactive/ovn_chassis_charm_handlers.py", line 79, in configure_bridges
charm_instance.configure_bridges()
File "lib/charms/ovn_charm.py", line 600, in configure_bridges
ifdatamap)
File "/var/lib/juju/agents/unit-ovn-chassis-dpdk-0/.venv/lib/python3.6/site-packages/charmhelpers/contrib/network/ovs/__init__.py", line 323, in add_bridge_bond
subprocess.check_call(cmd)
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ovs-vsctl', '--', '--may-exist', 'add-bond', 'br-dpdk', 'dpdk-bond0', 'dpdk-f92ad9f', 'dpdk-abd308d', '--', 'set', 'port', 'dpdk-bond0', 'bond_mode=balance-slb', '--', 'set', 'port', 'dpdk-bond0', 'lacp=off', '--', 'set', 'port', 'dpdk-bond0', 'other_config:lacp-time=fast', '--', 'set', 'Interface', 'dpdk-f92ad9f', 'type=dpdk', '--', 'set', 'Interface', 'dpdk-f92ad9f', 'options:dpdk-devargs=0000:13:00.0', '--', 'set', 'Interface', 'dpdk-f92ad9f', 'external-ids:charm-ovn-chassis=br-dpdk', '--', 'set', 'Interface', 'dpdk-abd308d', 'type=dpdk', '--', 'set', 'Interface', 'dpdk-abd308d', 'options:dpdk-devargs=0000:13:00.1', '--', 'set', 'Interface', 'dpdk-abd308d', 'external-ids:charm-ovn-chassis=br-dpdk']' returned non-zero exit status 1.
A workaround seems to be "ovs-vsctl del-port br-dpdk dpdk-bond0" (or whatever dpdk bond name you've selected in dpdk-bond-mappings and then resolving the hook failure.