Open vSwitch and persistent MAC addresses

Normally I like to post solutions, but today’s post is about a
vexing problem to which I have not been able to find a solution.

This started as a simple attempt to set up external connectivity on
an all-in-one Icehouse install deployed on an OpenStack instance. I
wanted to add eth0 to br-ex in order to model a typical method for
providing external connectivity, but I ran into a very odd problem:
the system would boot and work fine for a few seconds, but would then
promptly lose network connectivity.

The immediate cause was that the MAC address on br-ex was changing.
I was setting the MAC explicitly in the configuration file:

But things quickly got weird. Some testing demonstrated that the MAC
address was changing when starting neutron-openvswitch-agent, but a
thorough inspection of the code didn’t yield any obvious culprits for
this behavior.

I liberally sprinkled the agent with the following (incrementing the
argument to echo each time to uniquely identify each message):