cannot use release API on stuck observed IPs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Medium
|
Rodrigo Barbieri | ||
2.7 |
Fix Committed
|
Undecided
|
Unassigned | ||
2.8 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
One of the ways that should be possible to workaround bug https:/
the CLI (maas root ipaddresses release ip='192.
or API POST http://{{maas_
However, when using this API to remove IP 192.168.105.227 which is stuck to a machine in Ready state after successful commissioned and modified reserved dynamic range to exclude this IP (as per instructions in #1896292), those are the results (from MaaS 2.7.3-8291-
maas root ipaddresses release ip='192.
IP address 192.168.105.227 does not exist, is not the correct type of address, or does not belong to the requesting user.
If you are sure you want to release this address, use force=true as a MAAS administrator.
maas root ipaddresses release ip='192.
IP address 192.168.105.227 does not exist.
maas root ipaddresses release ip='192.
IP address 192.168.105.227 does not exist, is not the correct type of address, or does not belong to the requesting user.
If you are sure you want to release this address, use force=true as a MAAS administrator.
maas root ipaddresses release ip='192.
Unknown alloc_type.
From regiond.log:
2020-10-01 21:04:42 regiond: [info] 127.0.0.1 GET /MAAS/rpc/ HTTP/1.1 --> 200 OK (referrer: -; agent: provisioningser
2020-10-01 21:04:46 maasserver: [error] #######
2020-10-01 21:04:46 maasserver: [error] Traceback (most recent call last):
File "/usr/lib/
response = wrapped_
File "/usr/lib/
return view_atomic(*args, **kwargs)
File "/usr/lib/
return func(*args, **kwds)
File "/usr/lib/
response = upcall(request, *args, **kwargs)
File "/usr/lib/
response = func(*args, **kwargs)
File "/usr/lib/
result = self.error_
File "/usr/lib/
result = meth(request, *args, **kwargs)
File "/usr/lib/
return function(self, request, *args, **kwargs)
File "/usr/lib/
interface.
File "/usr/lib/
mode = ip_address.
File "/usr/lib/
raise ValueError("Unknown alloc_type.")
ValueError: Unknown alloc_type.
2020-10-01 21:04:46 regiond: [info] 127.0.0.1 POST /MAAS/api/
Related branches
- Alberto Donato: Approve
- MAAS Lander: Approve
-
Diff: 74 lines (+40/-1)3 files modifiedsrc/maasserver/api/tests/test_ipaddresses.py (+30/-0)
src/maasserver/models/staticipaddress.py (+4/-1)
src/maasserver/models/tests/test_staticipaddress.py (+6/-0)
- Alberto Donato: Approve
- MAAS Lander: Approve
-
Diff: 74 lines (+40/-1)3 files modifiedsrc/maasserver/api/tests/test_ipaddresses.py (+30/-0)
src/maasserver/models/staticipaddress.py (+4/-1)
src/maasserver/models/tests/test_staticipaddress.py (+6/-0)
- Björn Tillenius: Approve
- MAAS Lander: Approve
- Lee Trager: Pending requested
- MAAS Maintainers: Pending requested
-
Diff: 74 lines (+40/-1)3 files modifiedsrc/maasserver/api/tests/test_ipaddresses.py (+30/-0)
src/maasserver/models/staticipaddress.py (+4/-1)
src/maasserver/models/tests/test_staticipaddress.py (+6/-0)
Changed in maas: | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Rodrigo Barbieri (rodrigo-barbieri2010) |
milestone: | none → 2.9.0b7 |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
tags: | added: sts |
Adding IPADDRESS_ TYPE.DISCOVERED to the condition at [0], causes the code to go to [1] when invoked by the release API, resulting in the delete of the IP similarly to how it is done in [2].
I also tested coding something similar to [3] which does ip=None and then ip.save, but in my testing the result was the same as ip.delete().
[0] https:/ /github. com/maas/ maas/blob/ 04a456af79ebdfd 4858bd317f48e42 959cc97670/ src/maasserver/ models/ staticipaddress .py#L876
[1] https:/ /github. com/maas/ maas/blob/ 04a456af79ebdfd 4858bd317f48e42 959cc97670/ src/maasserver/ models/ interface. py#L1189
[2] https:/ /github. com/maas/ maas/blob/ 04a456af79ebdfd 4858bd317f48e42 959cc97670/ src/maasserver/ rpc/leases. py#L149
[3] https:/ /github. com/maas/ maas/blob/ 04a456af79ebdfd 4858bd317f48e42 959cc97670/ src/maasserver/ rpc/leases. py#L212