[openstack-dev] [Openstack-baremetal] why does the baremetal driver override the physical MAC address?

Robert Collins robertc at robertcollins.net
Tue Nov 13 02:59:13 UTC 2012


On Mon, Oct 29, 2012 at 9:08 PM, Robert Collins
<robertc at robertcollins.net> wrote:
> On Mon, Oct 29, 2012 at 3:15 PM, VTJ NOTSU Arata <notsu at virtualtech.jp> wrote:
>> Hi,
>>
>> vm instances use MAC generated by nova, as you know. I think bare-metal
>> instances
>> should be similar to vm ones, so override physical MACs by nova-generated
>> ones.
>> But the overriding has no actual meaning at present. We should disable the
>> overriding
>> if it disturbs more important things, for example supporting other OSs.
>
> +1. Also, the reason VM ones are generated by nova is because there is
> no hardware to use :) So I don't see the need.
>
> -Rob

Just got to the bottom of an issue we were having with cloud-init in
baremetal nodes.

Take a machine with two NICs.
baremetal deploy a cloud-init containing instance onto it, and it will
generate a /etc/udev/rules.d/70-persistent-net.rules file containing
all the NIC's it found, labelleing them for the next boot as eth0,
eth1 etc. This is done by Ubuntu to prevent hardware changes leading
to unstable NIC names.

However, the 'hwaddress ether xxx' in /etc/network/interfaces means
that the code that enumerates devices during early boot, and the code
that assigns devices to names, see different mac addresses!

For instance, this is the rule generated (in a test VM for speed):
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="52:54:00:97:71:c4", ATTR{dev_id}=="0x0",
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="52:54:00:97:71:c3", ATTR{dev_id}=="0x0",
ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

The two MAC addresses there are the ones that are registered with nova
baremetal, but this:

2: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 52:54:00:97:71:c3 brd ff:ff:ff:ff:ff:ff
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP qlen 1000
    link/ether fa:16:3e:05:8a:57 brd ff:ff:ff:ff:ff:ff

is what the system thinks its running. Rebooting the machine at this
point will cause the next boot up to have *no* eth0: eth0 is reserved
for 52:54:00:97:71:c4, 52:54:00:97:71:c3 will still be eth1, and the
/etc/network/interfaces stanza will fail entirely.

I'll put forward a patch to remove this now :)

-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Cloud Services



More information about the OpenStack-dev mailing list