Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include systemd/network to preserve Predictable Network Interface Names #1349

Merged
merged 1 commit into from May 9, 2017

Conversation

schabrolles
Copy link
Member

@schabrolles schabrolles commented May 8, 2017

Some modern distros (like ubuntu16.04) use systemd to control inet naming.
Those information are stored in /lib/systemd/network or /usr/lib/systemd/network.

For example, my system in Ubuntu16.04 uses Predictable interface name by default : enp0s1
I'm not a big fan of Predictable interface name, but it seems to become the new standard (Fedora 25 / Ubuntu 16.04, CoreOS...)

When I boot to the rescue image, the interface is renamed eth0 => with NO IP because of name chaged.

I think we should add /lib/systemd/network or /usr/lib/systemd/network to the rescue image as we want to "replicate" network configuration from the original machine when booting on the rescue image.
If the user doesn't like the "Predictable naming", it could add net.ifnames=0 or change the configuration file /lib/systemd/network/99-default.link (which will be saved in the rescue image)

 - Some modern distros (like ubuntu16.04) use systemd to control
 inet naming. Those information are stored in /lib/systemd/network or
 /usr/lib/systemd/network.
@jsmeix
Copy link
Member

jsmeix commented May 8, 2017

@schabrolles
is plain adding /lib/systemd/network or /usr/lib/systemd/network
to the rescue image sufficient to make the recovey system somehow
"automagically just work" also in case of predictable interface names
or are there more adaptions and enhancements needed
e.g. in rescue/GNU/Linux/310_network_devices.sh
to make predictable interface names "just work"
in the ReaR recovery system?

Copy link
Member

@jsmeix jsmeix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O.k. for me from plain looking at the code.
In particular I appreciate the added
explanatory comment that tells about
why that is added to the rescue image.

@jsmeix jsmeix requested a review from gdha May 8, 2017 09:19
@jsmeix
Copy link
Member

jsmeix commented May 8, 2017

@gdha
could you also have a look here because it seems
prep/GNU/Linux/280_include_systemd.sh
is mainly your file (according to "git log -p --follow ...").

@jsmeix jsmeix added the enhancement Adaptions and new features label May 8, 2017
@jsmeix jsmeix added this to the ReaR v2.1 milestone May 8, 2017
@jsmeix jsmeix self-assigned this May 8, 2017
@schabrolles
Copy link
Member Author

schabrolles commented May 8, 2017

@jsmeix Some changes will be required in rescue/GNU/Linux/310_network_devices.sh during a migration.

  • booting rescue on the original system will work without any changes (Predictable Names comes from PCI topology (bus/port etc...))
  • booting rescue on a different system (migration) will not work because inet name should have changed (except if PCI topology is the same)...

=> There is still some work for migration.... I notice that "modern" distros doesn't seems to use udev/*persistent* anymore but use systemd network instead ... (like CoreOS: https://coreos.com/blog/intro-to-systemd-networkd.html). I don't know if it is "stable" and if all the next linux major release will embrace this when they will be all migrated to systemd, but we should start to have a look.

Copy link
Member

@gdha gdha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schabrolles @jsmeix We will test it out tomorrow or so with our Automated Test environment (only for CentOS 7 for the moment)

@gdha
Copy link
Member

gdha commented May 8, 2017

@jsmeix Do not merge it yet until Sebastien has finished his code (and tested from his side)

@jsmeix
Copy link
Member

jsmeix commented May 8, 2017

@schabrolles
but for recovery on "same" hardware (i.e. for "non-migration")
plain adding /lib/systemd/network or /usr/lib/systemd/network
to the rescue image is sufficient to make networking in the
recovey system also work for predictable interface names?

@schabrolles
Copy link
Member Author

@jsmeix for recovery on "same" hardware (i.e. for "non-migration") it works well...
Interface is created enp0s1 and IP is setup by OS during boot (/etc/network/interfaces for ubuntu).

Tested on Ubuntu 16.04

@jsmeix
Copy link
Member

jsmeix commented May 8, 2017

@gdha
from my point of view
#1349 (comment)
is sufficient to merge this one.

I hope there cannot be regressions when there are some more
systemd related files in the rescue image that make some more
systemd magic "just work" in the recovery system.
On the other hand:
Any more "systemd magic" might result anything ;-)

@jsmeix jsmeix merged commit cc80a0b into rear:master May 9, 2017
@schabrolles schabrolles deleted the systemd_network branch July 26, 2017 22:41
@gdha
Copy link
Member

gdha commented Aug 26, 2017

See also issue #1400 - I will be using Ubuntu 16.04 next week in my automated testing rounds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adaptions and new features fixed / solved / done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants