dhcp snippets not working in acquired state

Bug #1940998 reported by dann frazier
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Medium
Unassigned
3.3
Won't Fix
Medium
Unassigned
3.4
Won't Fix
Medium
Unassigned

Bug Description

MAAS 2.9.3-beta1.

DHCP snippets don't seem to be active for nodes in the "Acquired" state, though they work fine when the node is in the "Deploying" state. I discovered this through trial and error. My use case is that I often need to manually test non-MAAS PXE installations on servers that live in our MAAS cluster. It seemed logical that I could Acquire a node (to avoid someone else from grabbing it), install a DHCP snippet to point the node at some other install server, and test that way. But even with such a snippet enabled, the node still boots from the MAAS server. If I instead Deploy the node, the snippet actually starts to be used, and the machine PXE boots from the intended install server (only to obviously fail Deployment later).

The documentation on DHCP snippets[*] doesn't mention a difference in behavior depending on state, so this seems like a bug if not in MAAS. But if not perhaps we should update the docs.

[*] https://maas.io/docs/snap/2.9/ui/managing-dhcp#heading--dhcp-snippets

Revision history for this message
Alberto Donato (ack) wrote :

Could you please provide a sample of the DHCP snippet you're using?

Changed in maas:
status: New → Incomplete
Alberto Donato (ack)
summary: - dhcp snippets not working in acquire state
+ dhcp snippets not working in acquired state
Revision history for this message
dann frazier (dannf) wrote :

Sure. I use "Type: Machine" snippets that look like:

next-server 10.229.70.43;
filename "grubnetaa64.efi";

Changed in maas:
status: Incomplete → New
Revision history for this message
Alberto Donato (ack) wrote :

Could you please provide MAAS' dhcpd.conf (with the snippet enabled) when that machine is deployed and when it's acquired?

Changed in maas:
status: New → Incomplete
Revision history for this message
dann frazier (dannf) wrote :

Will a diff do?

--- dhcpd.conf.allocated 2021-09-08 20:01:28.624907214 +0000
+++ dhcpd.conf.deploy 2021-09-08 20:01:43.448306879 +0000
@@ -436,6 +436,18 @@
    hardware ethernet f0:92:1c:b4:d6:30;
    fixed-address 10.229.70.43;
 }
+# bizzy-enp1s0f0
+host 0c-42-a1-49-ee-f4 {
+ #
+ # Node DHCP snippets
+ #
+ # Name: bizzy
+ next-server 10.229.70.43;
+ filename "grubnetaa64.efi";
+
+ hardware ethernet 0c:42:a1:49:ee:f4;
+ fixed-address 10.229.74.89;
+}
 # blanka-enp226s0
 host 5c-ff-35-e

Changed in maas:
status: Incomplete → New
Alberto Donato (ack)
Changed in maas:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Alberto Donato (ack) wrote :

Currently, host stanzas in DHCP config are only created when a fixed-address is assigned to the host.
This basically happens either when the PXE interface is set to "static IP" or it's "auto" and the machine is being deployed.

We should indeed investigate always creating the host stanza if there are machine snippets.

As a workaround you could either set a static IP on the interface of that machine, or creating a global snippet with the whole host stanza.

Changed in maas:
milestone: none → next
Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

Machine DHCP snippets should be associated with specific machines, instead of being active only when the machine is being acquired/deployed/etc. This change needs to be emphasised in the documentation and release notes.

Changed in maas:
milestone: next → 3.3.0
Changed in maas:
milestone: 3.3.0 → 3.4.0
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.x
Changed in maas:
milestone: 3.4.x → 3.5.x
no longer affects: maas/3.3
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.