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

Support DHCP option lookup from NetworkManager #861

Merged
merged 4 commits into from
Feb 1, 2023
Merged

Support DHCP option lookup from NetworkManager #861

merged 4 commits into from
Feb 1, 2023

Conversation

bgilbert
Copy link
Contributor

Read DHCP options from NetworkManager and networkd in parallel. The NetworkManager check works with both dhclient and NM's internal DHCP client. Avoids a 30-second boot delay on Azure and AzureStack as we time out waiting for a networkd lease. Doesn't help in the initrd on RHCOS 8, since NetworkManager doesn't daemonize there.

Support zbus 2.3 because Fedora isn't shipping zbus 3 yet. The two are API-compatible for our purposes.

Tested on Azure on Flatcar and RHEL in the real root, and FCOS in the initrd. Not tested on CloudStack, except to verify that NetworkManager exposes a dhcp_server_identifier DHCP option with the expected format.

Fixes #146.

@bgilbert
Copy link
Contributor Author

zbus appears to require a newer MSRV.

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.

Looks good to me!

docs/release-notes.md Outdated Show resolved Hide resolved
Copy link
Contributor

@prestist prestist left a comment

Choose a reason for hiding this comment

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

LGTM

This will allow us to try multiple network managers in sequence.

This causes us to look up the available interfaces on every try, rather
than just once.  Interface lookup shouldn't be expensive, and recognizing
new interfaces is probably useful anyway.
Check both NetworkManager and networkd on each retry iteration.  The
NetworkManager check works with both dhclient and NM's internal DHCP
client.  Avoids a 30-second boot delay on Azure and AzureStack as we time
out waiting for a networkd lease.  Doesn't help in the initrd on RHCOS 8,
since NetworkManager doesn't daemonize there.

Support zbus 2.3 because Fedora isn't shipping zbus 3 yet.  The two are
API-compatible for our purposes.

Tested on Azure on Flatcar and RHEL in the real root, and FCOS in the
initrd.  Not tested on CloudStack, except to verify that NetworkManager
exposes a dhcp_server_identifier DHCP option with the expected format.

Fixes #146.
@bgilbert bgilbert merged commit a6f3c26 into coreos:main Feb 1, 2023
@bgilbert bgilbert deleted the dhcp branch February 1, 2023 20:06
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.

Read lease files from dhclient and NetworkManager on Azure and CloudStack
3 participants