From f0ae3282450c2bb1bb35f22414858768f08d2653 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Tue, 12 Aug 2014 11:06:46 -0400 Subject: Set the MAC to the primary interface Adds support for a new 'primary' interface option exposed via the object model and JSON parsers which can be used to force the MAC address on a bridge. Only one interface on a given bridge (or bond) may be set as the primary interface. Also, update the ifcfg and eni providers so that they use OVS_EXTRA (or ovs_extra) to pin the mac accordingly. --- os_net_config/impl_eni.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'os_net_config/impl_eni.py') diff --git a/os_net_config/impl_eni.py b/os_net_config/impl_eni.py index c32fc82..b4a64e0 100644 --- a/os_net_config/impl_eni.py +++ b/os_net_config/impl_eni.py @@ -91,6 +91,11 @@ class ENINetConfig(os_net_config.NetConfig): data += "\n" for i in interface.members: data += " pre-up ip addr flush dev %s\n" % i.name + if interface.primary_interface_name: + mac = utils.interface_mac(interface.primary_interface_name) + data += (" ovs_extra set bridge %s " + "other-config:hwaddr=%s\n" + % (interface.name, mac)) elif interface.ovs_port: if isinstance(interface, objects.Vlan): data += "auto vlan%i\n" % interface.vlan_id -- cgit 1.2.3-korg