Skip to content
This repository has been archived by the owner on Aug 6, 2020. It is now read-only.

recover vm (on virtualbox) uses biosdevnames for LAN interfaces #5

Open
gdha opened this issue Sep 28, 2016 · 9 comments
Open

recover vm (on virtualbox) uses biosdevnames for LAN interfaces #5

gdha opened this issue Sep 28, 2016 · 9 comments
Assignees

Comments

@gdha
Copy link
Member

gdha commented Sep 28, 2016

the client and server vm are both using eth0 and eth1 as LAN interface names. However, with virtualbox (not with libvirt) the LAN interfaces are the biosdevnames enp0s3 and enp0s8 on the recover vm

Therefore, we need manual to edit /etc/scripts/system-setup.d/60-network-devices.sh script and change the eth0 with enp0s3 and eth1 with enp0s8 and then run the script (with bash). With the libvirt vm we do not have this problem. Reason unkown?

@gdha
Copy link
Member Author

gdha commented Dec 16, 2016

See URL: https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
and especially section I don't like this, how do I disable this?

@gdha
Copy link
Member Author

gdha commented Dec 30, 2016

Adding KERNEL_CMDLINE="$KERNEL_CMDLINE net.ifnames=0" to /etc/rear/local.conf configuration file fixes this as the recover vm is then using eth0 and eth1

@gdha gdha added the wontfix label Mar 18, 2017
@schabrolles
Copy link
Member

@gdha I got the same issue, but in the other way ...

My original system (ubuntu 16.04) got interfaces named enp0s1, but when I boot on the rescue media, I got eth0 and no IP (because /etc/scripts/system-setup.d/60-network-devices.sh look for enp0s1).

I try to force net.ifnames=1 or biosdevname=1 as KERNEL parameters but still having eth0 in recovery.

I think there some systemd files missing into the recovery or may be not called during boot.
But I don't know which one.

It is a libvirt VM on KVM ppc64le

@gdha
Copy link
Member Author

gdha commented Aug 24, 2017

@schabrolles I believe ReaR issue rear/rear#1400 could be an advantage to have and https://github.com/gdha/rear-automated-testing/blob/master/templates/BAREOS-with-ISO-biosdevnames.conf#L38 hack could be added automatically...

@schabrolles
Copy link
Member

@gdha I have solve my issue here: (#1349)
As I said in this PR, there is still some work to do for migration .... But forcing net.ifnames=1 or biosdevname=1 won't be enough.

  • those KERNEL parameters are overwritten by /lib/systemd/network/99-default.link on ubuntu16.04 ... and I predict that other Linux will follow when moving to latest systemd version.
  • We should improve the way we set IP in recovery and re-work the network migration. Some new Linux distro (rhel7 / ubuntu) removed udev/70-presistent rules...

@gdha
Copy link
Member Author

gdha commented Sep 4, 2017

See also https://coreos.com/blog/intro-to-systemd-networkd.html

root@client:/lib/systemd/network# cat 99-default.link 
[Link]
NamePolicy=kernel database onboard slot path
MACAddressPolicy=persistent

@schabrolles
Copy link
Member

schabrolles commented Sep 4, 2017

Interesting, thanks for the link @gdha
Here is another one from Redhat explaining why they move to biosdevname vs 70-persistent-net.rules https://access.redhat.com/solutions/1554703

I'm still working on my Free time to improve the network part. I'm close to have something functional; but as you said: No Rush. I don't want to push it for the next 2.3 version but for Future ReaR.

  • detecting if Kernel of the Source system use net.ifnames parameter => automatically adding it to KERNEL_CMDLINE (as you suggest)
  • Using more robust way to have IP always set to the good interface (even if this one as a different name).
  • Keep udev rules files as default for inet migration. (for compatibility)
  • Adding migration of interface is this one is not included in udev rules files.
  • Adding migration of Debian/Ubuntu network configuration files (currently only Fedora/Suse ifcfg-* files)

There is stilI some bugs and l also need additional test for vlan / bonding.

@schlomo
Copy link
Member

schlomo commented Sep 4, 2017

@schabrolles can you cross-post (or summarize) the RH argumentation, they require an account to read the full article.

@schabrolles
Copy link
Member

schabrolles commented Sep 4, 2017

It is a very (very) "light" explanation .... (which did not convince me by the way); but because they choose this way (as ubuntu, debian and other) we will have to update the way we are dealing with network migration (currently only based on udev persistent rules) ... here it is:


Environment

Red Hat Enterprise Linux (RHEL) 7

Issue

Why is there a new persistent naming scheme in Red Hat Enterprise Linux (RHEL) 7?
Why can I no longer use the 70-persistent-net.rules file to force persistent ethX names like I could in earlier versions of Red Hat Enterprise Linux?

Resolution

The new rules for persistent network device naming were done because the previous method of using the 70-persistent-net.rules file caused a lot of problems. These included requiring a writable root directory, issues when a MAC address changes for any reason (the address is still reserved in udev so an ethX interface without a matching MAC address will be skipped over) and race conditions with the kernel, which also uses ethX for assigning interfaces.

Because of the above issues, the upstream developers of systemd/udev have removed the 70-persistent-net.rules functionality and replaced it with the default naming scheme present in Red Hat Enterprise Linux 7.

For more detailed information, please visit the upstream URL explaining the full rationale for the naming change at http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants