[1.9] DHCP interface automatically obtains an IP even when the subnet is unmanaged
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Mike Pontillo | ||
1.9 |
Fix Released
|
High
|
Mike Pontillo |
Bug Description
I have a node on an interface that's connected to a subnetwork that MAAS does not manage (meaning, it does not have control of DHCP). However, when I set this interface to DHCP in the Node Details Page, MAAS automatically and erroneously assigns an IP address to it. This is erroneous because I simply want the interface to be configured as DHCP in /e/n/i, and have it DHCP from an external router.
What should happen is:
1. if subnetwork is unmanaged (no DHCP by MAAS), MAAS should *not* automatically assign an IP.
2. On deployment /e/n/i will reflect the interface as DHCP
3. The interface will successfully DHCP from MAAS.
Obviously, this means that no DNS record will be created against this interface, provided MAAS does not manage DHCP.
Related branches
- Blake Rouse (community): Approve
-
Diff: 935 lines (+533/-60)13 files modified.idea/encodings.xml (+3/-1)
.idea/vcs.xml (+0/-6)
src/maasserver/api/devices.py (+17/-7)
src/maasserver/api/tests/test_devices.py (+125/-11)
src/maasserver/models/interface.py (+96/-18)
src/maasserver/models/node.py (+5/-1)
src/maasserver/models/nodegroupinterface.py (+37/-3)
src/maasserver/models/staticipaddress.py (+9/-4)
src/maasserver/models/subnet.py (+8/-1)
src/maasserver/models/tests/test_interface.py (+114/-4)
src/maasserver/models/tests/test_nodegroupinterface.py (+35/-0)
src/maasserver/testing/factory.py (+14/-4)
utilities/remote-reinstall (+70/-0)
- Blake Rouse (community): Approve
-
Diff: 982 lines (+548/-54)15 files modified.idea/encodings.xml (+3/-1)
.idea/maas.iml (+1/-1)
.idea/misc.xml (+1/-1)
.idea/vcs.xml (+0/-6)
src/maasserver/api/devices.py (+17/-7)
src/maasserver/api/tests/test_devices.py (+133/-0)
src/maasserver/models/interface.py (+98/-20)
src/maasserver/models/node.py (+5/-1)
src/maasserver/models/nodegroupinterface.py (+37/-3)
src/maasserver/models/staticipaddress.py (+9/-4)
src/maasserver/models/subnet.py (+8/-1)
src/maasserver/models/tests/test_interface.py (+115/-5)
src/maasserver/models/tests/test_nodegroupinterface.py (+35/-0)
src/maasserver/testing/factory.py (+14/-4)
utilities/remote-reinstall (+72/-0)
I have tested this extensively today and did not see this exact behavior. However, when the interface is set to "Auto assign", I saw similar behavior in some cases.
In previous versions of MAAS, having a dynamic range on an unmanaged cluster interface meant that we expect MAAS to use DHCP. Upon migrating to 1.9, those DHCP links became "AUTO" links. Thus we see this regression.
I linked a branch which fixes half of this issue by making unmanaged networks consistent with managed networks. That is, if you assign a static range on an unmanaged network and use AUTO, we will assign out of the static range. If it only has a dynamic range, you will get an error. (you must configure the interface to use DHCP, as this bug implies it was originally, but I suspect it wasn't - due to a migration bug.) If the cluster interface has neither, MAAS will assume it can use the entire subnet (minus any configured routers, etc) for allocation.