#1312 PR merged: Renaming network interface when MAC not present in udev

Labels: enhancement, fixed / solved / done

schabrolles opened issue at 2017-04-17 14:00:

Some persistent naming udev rules can be based on pci slot and not MAC address (sles12).

here is an extract of my /etc/udev/rules.d/70-persistent-net.rules on a SUSE SLE12 VM.

# PCI device 0x1af4:0x1000 (virtio-pci)                                                                                                                                                                                                       
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="virtio-pci", ATTR{dev_id}=="0x0", KERNELS=="0000:00:01.0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

In that case, we have to allow migration of the new inet name (eth1) to the old one (eth0):
- Cleaning old device entry in udev (eth0)
- Updating new device line by renaming device name with the orignal
one. (eth1 => eth0)

schabrolles commented at 2017-04-19 09:12:

This change has been tested in a migration scenario (VM under KVM <=> LPAR in PowerVM) with the following OSes:

  • SLE12 sp2
  • SLES11 sp4
  • RHEL 7.3
  • RHEL 7.2

The principle is to keep the MAC detection by default and fall to the inet name change in case we can't find the MAC in /etc/udev/rules.d/70-persistent-net.rules

gdha commented at 2017-04-19 11:14:

@schabrolles OK I accepted the pull request - we will see tomorrow what my automated testing will say

schabrolles commented at 2017-04-19 11:23:

@gdha Thanks.
Could you tell me what your automated testing is doing ? It could be interesting for me to replicate it on POWER machines...

gdha commented at 2017-04-19 12:49:

@schabrolles A good place to start is http://www.it3.be/2017/03/28/cebit-2017/


[Export of Github issue for rear/rear.]