Cannot claim sticky IP address for a device with parent unless observed IPs exist for the parent
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Unassigned |
Bug Description
Using maas 1.9.0~beta2+
I've discovered that after adding a device via the CLI, e.g.:
$ maas hw-root devices new hostname=device-11 mac_addresses=
(created OK, e.g. deviceID=
and then trying to claim a sticky ip address for it:
$ maas hw-root device claim-sticky-
(returned no error, but the "ip_addresses" list in the response was still empty).
Looking at the log in /var/log/
Nov 9 16:31:51 maas-hw maas.interface: [ERROR] Tried to allocate an IP to interface <name=eth0, type=physical, mac=00:1
6:3e:de:fa:e0>, but its cluster interface is not known.
Nov 9 16:31:51 maas-hw maas.api: [INFO] device-11: Sticky IP address(es) allocated:
(no IP or anything).
However, since I was able to do claim a sticky IP for another device on another node, I started digging into the maasserver source, and I suspect the reason for that error is because I'm not passing a requested_address and MAAS tries to find an available one but ONLY among the "discovered_ips" (AIUI observed DHCP requests for the same subnet and node (the parent)).
I can readily reproduce this by dropping the dhcpd.leases file, deleting all records maasserver_
In case anybody else hits this issue, here's how I managed to fix it:
1. first, make sure all your nodes have static IP assigned (not auto or DHCP) for their primary (PXE) interface (it might make a difference where there are more than one NIC).
2. $ rm -f /var/lib/
3. $ dpkg-reconfigure maas-dhcp
4. recommission all nodes
5. after it's done, you should see at least 1 "observed" IP per node in the managed subnet's UI details page (needs to be refreshed manually sometimes), and creating devices + claim-sticky-
Related branches
- Blake Rouse (community): Approve
-
Diff: 127 lines (+50/-11)2 files modifiedsrc/maasserver/models/interface.py (+34/-11)
src/maasserver/models/tests/test_interface.py (+16/-0)
Changed in maas: | |
importance: | Undecided → Critical |
milestone: | none → 1.9.0 |
status: | New → Triaged |
Changed in maas: | |
status: | Triaged → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Just so you know, I think step (4) alone would have been enough. That is, regardless of DHCP, recommissioning a node under 1.9 should cause it to create "discovered" (aka "observed") addresses.
Do I assume correctly that this MAAS setup had been upgraded from 1.8? Upgraded nodes will not have "observed" IP addresses yet.