dhcp lookups depend on end-of-life dhclient

Bug #2006784 reported by Sofi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Invalid
Undecided
Unassigned

Bug Description

When using DataSourceHetzner, there is a required dhcp lookup. This digs down to a function named `maybe_perform_dhcp_discovery` which breaks when a `which dhclient` does not return a binary. This raises a `NoDHCPLeaseMissingDhclientError`.

I have only tested this under NixOS, as its one of the first distributions to have have removed `dhclient` from its the package tree following the deprecation by ISC's to the package.

DHCP lookups should be changed to support a non-deprecated dhcp library.

Cloud-provider: Hetzner

Cloud-init config:

```
system_info:
  distro: nixos
  network:
    renderers: [networkd]
users:
 - root

disable_root: false
preserve_hostname: false

cloud_init_modules:
 - set_hostname
 - update_hostname
 - update_etc_hosts
cloud_config_modules: []
cloud_final_modules: []

datasource_list:
 - DataSourceHetzner
```

Source where error is raised from:
https://github.com/canonical/cloud-init/blob/b3978cbd6c68c883f5ab02630d8d7fcb220b270c/cloudinit/net/dhcp.py#L69

End-of-life notice from ISC at 02 Jul 2021:
https://www.isc.org/blogs/dhcp-client-relay-eom/

Revision history for this message
Sofi (imsofi) wrote :

Attached a snippet around where the crash occurs to allow the back-trace to be seen.

Used `journalctl -u cloud-init-local.service` to gather.

Revision history for this message
Mina Galić (minagalic) wrote :

cloudinit.net.dhcp is due a refactoring: https://github.com/canonical/cloud-init/blob/main/WIP-ONGOING-REFACTORIZATION.rst
this would shift the duty of knowing what is the correct dhcp client onto the distro classes, which should be in way better shape to know that than our aging collection of hacks that is cloudinit.net

Revision history for this message
Brett Holman (holmanb) wrote :

NixOS is not supported by upstream cloud-init. Please contact your distro maintainers for a fix.

Regarding ISC's client support, this is a real issue and plans for a replacement are under way.

Changed in cloud-init:
status: New → Invalid
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.