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

fedora-coreos-base: use NetworkManager for networking in the initramfs #310

Merged
merged 2 commits into from
Mar 24, 2020

Conversation

dustymabe
Copy link
Member

Moving to NetworkManager in the initrd should help us solve some
problems we've been having with Networking. For what we want to
do in Fedora CoreOS doing this right requires the network to be
torn down in the initrd and also possibly propagated forward.

Requires: coreos/ignition-dracut#159
Fixes: coreos/fedora-coreos-tracker#394

@dustymabe
Copy link
Member Author

dustymabe commented Mar 19, 2020

this worked in some early testing. I've still got more testing to do and maybe we can automate some of it and put it in CI. I just rebased on top of latest master so respinning everything locall too.

Also one issue that came up is how NM processes the dracut commandline args for networking: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/391 We'll see what they think about the behavior.

Comment on lines 21 to 23
# Networking is NetworkManager
- --omit=systemd-networkd network-legacy
- --add=network-manager
Copy link
Member

Choose a reason for hiding this comment

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

Question: do we actually want to be explicit about this? A big part of FCOS is following Fedora defaults where possible, and previously we were actively working to avoid the default of NM-in-initrd. If we just drop that part (the nm-initrd-generator bit), we essentially get the same thing, right? My personal opinion is this would be cleaner, but don't feel strongly about this though.

Copy link
Member Author

Choose a reason for hiding this comment

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

IOW don't be explicit here and it should revert to the default of NM in the initrd because we are no longer deleting the nm-initrd-generator binary?

Copy link
Member

Choose a reason for hiding this comment

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

Right, exactly.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, initramfs args is one place where default vs explicit propagates to the user now that rpm-ostree knows to re-use the same base args when regenerating the initrd (coreos/rpm-ostree#1997). In the default case, one can override it with rpm-ostree initramfs --add=network-legacy. In the explicit case, I think one would have to do --omit=network-manager --add=network-legacy. (Not saying one would want to do this, but it demonstrates the difference well.)

Copy link
Member Author

Choose a reason for hiding this comment

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

ok I pushed up a rebase that removes the dracut args. Tests look like it still works with nm in the initrd.

Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

It'd be good to have someone besides Dusty play with this before we land it I think.

@jlebon
Copy link
Member

jlebon commented Mar 24, 2020

Yup, sanity checking this on top of coreos/ignition-dracut#159 right now!

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Dusty tested this on top of a bunch of combinations around bonding, teaming, bridging, and static networking. I tested it on top of various DHCPv4 and v6 configurations. All seems to be working well! (And any regression I think we can work with the NM team to get fixed as follow-ups.)

Thanks a lot for this!

@cgwalters
Copy link
Member

BTW you could probably create a new test like #305 that maybe uses e.g. journalctl to scrape out some bits from NetworkManager to verify it ran in the initramfs or so.

@dustymabe
Copy link
Member Author

BTW you could probably create a new test like #305 that maybe uses e.g. journalctl to scrape out some bits from NetworkManager to verify it ran in the initramfs or so.

yeah I don't see a good string in the journal logs that indicate NM is running in the initramfs (vs in the real root) other than things like

NetworkManager[525]: <info>  [1585084135.2919] auth[0x5651fccfaca0]: create auth-manager: D-Bus connection not available.

Maybe I can look at the strings from the teardown service:

info: propagating initramfs networking config to the real root

If I add it I'll add it in a follow up since I'd like to get this out today.

Moving to NetworkManager in the initrd should help us solve some
problems we've been having with Networking. For what we want to
do in Fedora CoreOS doing this right requires the network to be
torn down in the initrd and also possibly propagated forward.

We effectively move *to* NetworkManager in the initrd (the default
in Fedora 31+) by putting back in the nm-initrd-generator, which
we were previously removing.

Requires: coreos/ignition-dracut#159
Fixes: coreos/fedora-coreos-tracker#394
Needed for appropriately implementing NetworkManager support
in the initramfs. See coreos/ignition-dracut#159
@dustymabe dustymabe marked this pull request as ready for review March 24, 2020 22:04
@dustymabe
Copy link
Member Author

ok I added a second commit that adds an override for the ignition rpm to get the latest bits that have coreos/ignition-dracut#159. Will merge this after tests pass.

dustymabe added a commit to dustymabe/fedora-coreos-config that referenced this pull request Mar 24, 2020
This is how I've been doing network testing for the NM in
the initrd PR (coreos#310).
One day I'd like to convert this into some more sophisticated
test that can be run in our CI but AFAIU right now that's not
possibly because our CI is limited to qemu unprivileged networking.

For now let's put this $somewhere so that we can pull it out
at least when we suspect problems.
@dustymabe
Copy link
Member Author

ok I've been testing this using an ugly script for now (better than hand testing at least 😄). It goes through and makes sure variations of initrd passed networking config and ignition passed networking config works. See #316

dustymabe added a commit to dustymabe/fedora-coreos-config that referenced this pull request Mar 24, 2020
This is how I've been doing network testing for the NM in
the initrd PR (coreos#310).
One day I'd like to convert this into some more sophisticated
test that can be run in our CI but AFAIU right now that's not
possibly because our CI is limited to qemu unprivileged networking.

For now let's put this $somewhere so that we can pull it out
at least when we suspect problems.
dustymabe added a commit to dustymabe/fedora-coreos-config that referenced this pull request Mar 24, 2020
This is how I've been doing network testing for the NM in
the initrd PR (coreos#310).
One day I'd like to convert this into some more sophisticated
test that can be run in our CI but AFAIU right now that's not
possibly because our CI is limited to qemu unprivileged networking.

For now let's put this $somewhere so that we can pull it out
at least when we suspect problems.
dustymabe added a commit to dustymabe/fedora-coreos-config that referenced this pull request Mar 24, 2020
This is how I've been doing network testing for the NM in
the initrd PR (coreos#310).
One day I'd like to convert this into some more sophisticated
test that can be run in our CI but AFAIU right now that's not
possibly because our CI is limited to qemu unprivileged networking.

For now let's put this $somewhere so that we can pull it out
at least when we suspect problems.
@dustymabe
Copy link
Member Author

tests passed!

@dustymabe dustymabe merged commit 07a1be3 into coreos:testing-devel Mar 24, 2020
@dustymabe dustymabe deleted the dusty-nm branch March 26, 2020 13:11
cgwalters pushed a commit that referenced this pull request Mar 30, 2020
This is how I've been doing network testing for the NM in
the initrd PR (#310).
One day I'd like to convert this into some more sophisticated
test that can be run in our CI but AFAIU right now that's not
possibly because our CI is limited to qemu unprivileged networking.

For now let's put this $somewhere so that we can pull it out
at least when we suspect problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using NetworkManager in the initramfs
3 participants