[2.0 beta 2] Cannot delete a rack controller that was previously a 'machine'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Lee Trager |
Bug Description
I had a machine in MAAS which I deployed. After deployment, I manually installed maas-rack-
Then I configured this rack controller as secondary rack controller for a VLAN.
Finally, I tried to delete this new rack controller and came across this error in the UI:
The delete action for 1 controller failed with error: ("Cannot delete some instances of model 'VLAN' because they are referenced through a protected foreign key: 'PhysicalInterf
logs:
==> /var/log/
2016-04-15 13:45:19 [-] Error on request (118) controller.action: ("Cannot delete some instances of model 'VLAN' because they are referenced through a protected foreign key: 'PhysicalInterf
Traceback (most recent call last):
File "/usr/lib/
File "/usr/lib/
return target()
File "/usr/lib/
task()
File "/usr/lib/
task()
--- <exception caught here> ---
File "/usr/lib/
result = inContext.theWork()
File "/usr/lib/
File "/usr/lib/
return self.currentCon
File "/usr/lib/
return func(*args,**kw)
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
return func_outside_
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
return func(*args, **kwds)
File "/usr/lib/
return action.
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
Related branches
- Mike Pontillo (community): Approve
- Andres Rodriguez (community): Approve
- Jeffrey C Jones (community): Approve
-
Diff: 130 lines (+38/-13)6 files modifiedsrc/maasserver/models/node.py (+13/-1)
src/maasserver/models/tests/test_node.py (+14/-0)
src/maasserver/models/tests/test_vlan.py (+4/-0)
src/maasserver/models/vlan.py (+3/-1)
src/maasserver/static/partials/node-details.html (+1/-9)
src/maasserver/websockets/handlers/node.py (+3/-2)
description: | updated |
Changed in maas: | |
importance: | Undecided → Critical |
Changed in maas: | |
assignee: | nobody → Lee Trager (ltrager) |
status: | New → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
This is because the rack is still linked to the VLAN as a secondary_rack. We can solve this in one of two ways
1. Automatically delete the link(s) between the to be deleted rack and any VLAN it is associated with
2. Error and inform the user of the VLAN(s) the rack is associated with
We don't currently have a way to set the primary and secondary racks for a VLAN in the UI so option 2 will cause the UI to produce an error message which can only be resolved by using the CLI.