Merge lp://qastaging/~blake-rouse/maas/fix-pod-delete into lp://qastaging/~maas-committers/maas/trunk

Proposed by Blake Rouse
Status: Merged
Approved by: Blake Rouse
Approved revision: no longer in the source branch.
Merged at revision: 5750
Proposed branch: lp://qastaging/~blake-rouse/maas/fix-pod-delete
Merge into: lp://qastaging/~maas-committers/maas/trunk
Diff against target: 684 lines (+324/-24)
14 files modified
src/maasserver/api/pods.py (+9/-1)
src/maasserver/api/tests/test_pods.py (+17/-2)
src/maasserver/enum.py (+11/-0)
src/maasserver/forms/pods.py (+6/-2)
src/maasserver/migrations/builtin/maasserver/0114_node_dynamic_to_creation_type.py (+26/-0)
src/maasserver/models/bmc.py (+115/-3)
src/maasserver/models/node.py (+6/-5)
src/maasserver/models/signals/nodes.py (+3/-1)
src/maasserver/models/signals/tests/test_nodes.py (+15/-3)
src/maasserver/models/tests/test_bmc.py (+109/-2)
src/maasserver/models/tests/test_node.py (+3/-1)
src/maasserver/testing/factory.py (+2/-2)
src/maasserver/websockets/handlers/device.py (+1/-1)
src/maasserver/websockets/handlers/machine.py (+1/-1)
To merge this branch: bzr merge lp://qastaging/~blake-rouse/maas/fix-pod-delete
Reviewer Review Type Date Requested Status
Newell Jensen (community) Approve
Review via email: mp+317653@code.qastaging.launchpad.net

Commit message

Fix pod deletion to only decompose machines that MAAS has composed. Convert pod deletion into an async operation.

MAAS know records the creation type of a machine. This type allows MAAS to know what to do upon deletion of that machine. If the machine existed in the pod or was added to the pod out of band from MAAS then it will not be decomposed when the machine or pod is deleted. If the machine was created by MAAS then it will be decomposed in the pod when the machine or pod is deleted. The pod delete operation is not an asynchronous operation where it tries its best to decompose all machines. If decomposing fails then the deletion process will be stopped and the reason for the failure will be raised. If all the machines that required decomposition are successfully decomposed then it will also delete the pre-existing machines and the pod.

To post a comment you must log in.
Revision history for this message
Newell Jensen (newell-jensen) wrote :

I am getting this error when doing a `make run` with your branch (I initially saw this when trying to install packages for RSD testing).

django.db.utils.ProgrammingError: column maasserver_node.creation_type does not exist
LINE 1: ...node"."netboot", "maasserver_node"."license_key", "maasserve...
                                                             ^

review: Needs Fixing
Revision history for this message
Newell Jensen (newell-jensen) wrote :

I tested this in the RSD lab. Deleting the Pod work with or without pre-composed nodes present.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.