I’m using Open vSwitch to handle vlans (with fake bridges) to lxd containers. This leaves old veth devices in the vSwitch database on reboots. If, when the veth is created, you pass the option “other_config:transient=true”, then vSwitch can delete the old veth on reboots (for example see: https://developers.redhat.com/blog/2017/12/01/open-vswitch-without-stale-ports/).
Is there a way lxd can currently be configured to pass this option. If not, is this something that can be added to the roadmap.
Serge Hallyn mentions a few non-clean solutions… I am not sure how to implement any of the ideas, can anyone share an example? Or know how to pass the option “other_config:transient=true” as John suggests above?
One option to delete all existing bridges should be set in the config file /etc/default/openvswitch-switch to start with an empty openvswitch config.
OVS_CTL_OPTS='--delete-bridges'
So on boot it deletes bridge(s) which deletes the ports/veths along with them. Then your config in /etc/net/interfaces builds the bridge and vlans, etc fresh.
This works for my system but still the problem of just stopping a lxd container and then restarting the container leaves an abandoned veth behind that open v switch doesn’t know what to do with.