Closed Bug 1268892 Opened 10 years ago Closed 10 years ago

bonded interface on hgweb[11-14] is assigned random MAC on reboot

Categories

(Infrastructure & Operations :: MOC: Problems, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gps, Unassigned)

References

Details

hgweb11.dmz.scl3 reboot unexpectedly yesterday. When it came back, it had a different MAC address. Upon further investigation, the bond0 interface was assuming the MAC of one of the slave devices (eno49 or eno50). It appeared to choose one of their MACs randomly. DHCP would then hand out a different IP address. Kernel docs (https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/networking/bonding.txt?id=refs/tags/v3.10.101) and internet sleuthing indicate that a bonded interface will assume the MAC address of the first device that is enslaved to it. Here's the catch: the physical network devices don't initialize in deterministic order so the first device enslaved is not always the same. Hence the "random" assignment of the MAC address. We had discussed several possible options in #sysadmins: a) Set MACADDR in ifcfg-bond0 to the MAC of one of the NICs b) Set BONDING_SLAVE<N> (https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/networking/bonding.txt?id=refs/tags/v3.10.101#n984) c) set IPADDR in ifcfg-bond0 d) add a sleep to the pre-up up eno50 (so eno49 is always initialized first) e) call ifenslave manually in rc.local or some other time during startup f) change the DHCP server to hand out the same IP for both MACs It's worth noting that eno49 and eno50 aren't necessarily reliable identifiers. e.g. if eno49 physically fails, the kernel won't find it and eno50 may get assigned to eno49. So unless we ensure a physical device maps to the same name (e.g. eno49), using names like "eno49" and assigning "eno49" to the first bonded slave in hopes the bond will inherit its MAC may not be deterministic! I'm a fan of "a" (setting MACADDR explicitly in ifcfg-bond0) because it seems to be the most fail proof. I'm kind of a fan of "b" (BONDING_SLAVE<N>) using device specifiers. But it isn't clear from the docs that the bond will inherit the MAC of BONDING_SLAVE<N>. (If BONDING_SLAVE1 is enslaved first, the docs say the bond gets the MAC of the first enslaved device.) Furthermore, if the device beyond BONDING_SLAVE0 fails and isn't loaded by the kernel, we don't know its MAC and the bond presumably gets the MAC of BONDING_SLAVE1! I'm not a fan of "c" because it undermines DHCP. "d" isn't reliable if eno49 disappears and eno50 gets remapped to eno49. "e" has the same problems as "d." "f" may work. But it feels a bit risky to me. If the bonded interface is removed and we get both NICs querying DHCP, we've have 2 interfaces trying to get the same IP. Hopefully our DHCP server is smart enough to not hand out the same IP to 2 MACs simultaneously :) Whatever we do, we should definitely test bond failover. We want to be sure that e.g. if we are using the MAC of eno49 on bond0 and we take eno49 down that bond0 still uses that MAC (this is the default behavior of fail_over_mac - https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/networking/bonding.txt?id=refs/tags/v3.10.101#n361).
FWIW, modern versions of systemd support configuring network devices via https://www.freedesktop.org/software/systemd/man/systemd.link.html https://www.freedesktop.org/software/systemd/man/systemd.network.html and https://www.freedesktop.org/software/systemd/man/systemd.netdev.html. Unfortunately, the CentOS 7 currently on the hg machines doesn't expose these unit types. Either systemd is too old or they've removed systemd from network management on that distro.
I think the inventory entry was configured incorrectly, ryanc setup a new adapter for the second nic so we should be good. <@nagios-scl3> Fri 17:10:24 PDT [5395] hgweb11.dmz.scl3.mozilla.com (10.22.74.161) is DOWN :PING CRITICAL - Packet loss = 100%
Looks like that was it, closing out. <@nagios-scl3> Fri 17:46:24 PDT [5419] hgweb11.dmz.scl3.mozilla.com (10.22.74.161) is UP :PING OK - Packet loss = 0%, RTA = 0.85 ms
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.