-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
nixos/boot: rename network interfaces already in stage 1 #39329
Conversation
Nice. LGTM in principle, but in practice enabling this will break a lot of configs. E.g. I use initrd networking it a bunch of NixOS configs and applying this would break those configs silently until the next reboot, which would fail to boot. I think NixOS at the very least needs |
Yes, this might break initrd networking if you have custom stage 1 code containing hard coded references to `eth0` etc.
Definitely an issue for 18.03. But I think we can make this change on master even without `configVersion`. Unstable means that things may break, and for 18.09 we would document it in the release notes.
There's also an alternative (ugly) solution that leaves stage 1 unchanged: issue an extra `udevadm trigger -s; udevadm settle` restricted to net subsystem at the start of stage 2 before starting `systemd`. Would work but we don't really want to call udev 3 times in 2 boot stages...
Edit: Making `systemd-networkd.service` require and wait for `systemd-udev-settle.service` will do and is less ugly.
|
Yes, this might break initrd networking if you have custom stage 1 code containing hard coded references to `eth0` etc.
It could break it even without anything custom because nix has no way of knowing which interfaces exist on a booted system, hence it can't check/warn about anything. Including "ip" kernel parameter `initrd.network` asks you to use.
breaking master
Well, I'm ok with breaking master if no trivial change can fix it, but `configVersion` is a fairly trivial patchset and using it here would fix everything.
|
Ok, so let's first mplement the ugly alternative I mentioned (it's better for 18.03 anyway) and save this for later.
We should definitely get this done in 18.09. Having interface names change between initrd and full boot doesn't make sense.
|
Non-breaking interim fix in #39340. Marked this as [WIP] until we can safely get it into 18.09. |
I would like to get this ready now - shouldn't take long, mainly adapt to systemd 239 and test. Before proceeding we still need to address concerns about breaking existing configs, see discussion above. In the worst case, servers using initrd networking could become unreachable after update. I see two options:
How should be proceed here? |
In both cases we need to document this in the release notes. The choice is now:
As this realistically could break boot, without resort (hey, it's been a week of uptime, I nix-collect-garbage -d already my older boot options), I think gating behind At least the change isn't too invasive, and if one would like to keep |
Made the change conditional on |
We could go a step further and dump our old non-standard |
for changed behavior when stateVersion >= 18.09
- test new implementation with system.stateVersion = 18.09 - enable initrd networking to see interface names in logs
not necessary if stateVersion >= 18.09 as devices are already renamed in stage 1
if networking.usePredictableInterfaceNames=true and system.stateVersion >= 18.09
because now interfaces are already renamed in stage 1
Timed out, unknown build status on aarch64-linux (full log) Attempted: tests.initrd-network-ssh.predictable Partial log (click to expand)
|
Running on the aarch64 community box I am seeing issues, and they seem consistent. Partial output of nix-build nixos/tests/initrd-network-ssh/default.nix -A predictable
I got a "complete" output here, though unsurprisingly it matches with ofborg's output (and IIRC they do run on the same hardware). So it's not strictly because of ofborg, but either the configuration of the specific machine or some random luck factor? |
I'm speculating, but this may be caused by older versions of NixOS/nix/qemu on different builders. I will try to make the The |
This should not depend on |
@edolstra then what mechanism do you suggest for preventing breakage of existing configs? |
@edolstra other than Though, maybe in the end there are no risks? Would the system collect the currently booted configuration? There should be references still existing keeping it alive, right? Still annoying to have a broken boot though. |
This isn't ready yet, the tests still needs a little fine tuning (see above discussion). I suspended working on it until there's consensus on |
Any updates on this pull request, please? |
The
cc @xeji @andir (author of the commit) @erikarvstedt (author of similar PR #47664) |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/predictable-network-interface-names-in-initrd/4055/1 |
Otherwise we run into issues that udev cannot rename the interface in stage-2 because the device is busy. See : * NixOS#39329 * https://discourse.nixos.org/t/predictable-network-interface-names-in-initrd/4055 * NixOS@1f03f6f
Otherwise we run into issues that udev cannot rename the interface in stage-2 because the device is busy. See : * NixOS#39329 * https://discourse.nixos.org/t/predictable-network-interface-names-in-initrd/4055 * NixOS@1f03f6f
Hello, I'm a bot and I thank you in the name of the community for your contributions. Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do: If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list. If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past. If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments. Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel. |
No reaction after #39329 (comment), and this is probably fixed, so closing. |
Motivation for this change
Fix #39069. When
networking.usePredictableInterfaceNames = true
, rename network interfaces already in stage 1 boot to avoid a race condition between interface renaming and configuration.This also ensures consistent interface names between stage 1 (initrd) and fully booted system.