Aborting node deployment

Registered by Lucas Alvares Gomes on 2013-12-16

The utility-ramdisk blueprint[1] will make the ramdisk to ask the Ironic API for the next task it has to execute, when the deployment is set to be aborted, in the next iteration with the Ironic API, the API will just tell the node to stop everything it's doing and power-off, the API should also be responsable for cleaning up the target state of that node.

Some deployments can't be aborted, for e.g firmware updates. When the driver is about to start a deployment (after validations) it should mark that deployment as interruptible[2].

[1] https://blueprints.launchpad.net/ironic/+spec/utility-ramdisk
[2] https://bugs.launchpad.net/ironic/+bug/1260099

API Design:

The provisionment of a node is an asynchronous task that could be trigged via the Ironic API by sending a PUT request to the /nodes/<uuid>/states/provision URI. Each node can only run one provision task per time and the state of the task is traceable by sending a GET to the /nodes/<uuid>/states URI that will return the current and target states of the node.

In order to abort that task, this blueprint proposes the following design on the Ironic API:

* Using the DELETE method to trigger the abortion
* DELETE as an asynchronous task

The client could issue a DELETE to the /nodes/<uuid>/provision URI, HTTP 202 (Accepted) will be returned which would imply that the task has been *marked* for abort. The status of the process is traceable by issuing a GET to the /nodes/<uuid>/states URI and getting the current and target states of the node.

Issuing a DELETE to the /nodes/<uuid>/provision URI on a interruptible deployment will return HTTP 403 (Forbidden) indicating that the deployment can't be aborted and the request should not be repeated.

Issuing a DELETE to the /nodes/<uuid>/provision URI when there's no task running or it's already completed should just return HTTP 404 (NotFound) indicating there's no provision task running in the moment.

Blueprint information

Status:
Complete
Approver:
aeva black
Priority:
Undefined
Drafter:
Lucas Alvares Gomes
Direction:
Needs approval
Assignee:
Lucas Alvares Gomes
Definition:
Obsolete
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Lucas Alvares Gomes on 2015-07-21

Related branches

Sprints

Whiteboard

Lucas, in the API, would DELETE of an in-progress-deployment be different from DELETE of an active (already-completed) deployment?

-Deva

Yes, I thinking of it as a task running in the background, so once the deployment is completed that task is gone and it would return 404. But it looks abit inconsistent, so I think we might want to discuss a bit more how such triggers are going to work in our API, please take a look at https://bugs.launchpad.net/ironic/+bug/1259910

-Lucas

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.