[openstack-dev] [Nova] attaching and detaching volumes in the API

Murray, Paul (HP Cloud) pmurray at hpe.com
Thu Nov 5 18:13:02 UTC 2015


Normally operations on instances are synchronized at the compute node. In some cases it is necessary to synchronize somehow at the API. I have one of those cases and wondered what is a good way to go about it.

As part of this spec: https://review.openstack.org/#/c/221732/

I want to attach/detach volumes (and so manipulate block device mappings) when an instance is not on any compute node (actually when in shelved). Normally this happens in a function on the compute manager synchronized on the instance uuid. When an instance is in the shelved_offloaded state it is not on a compute host, so the operations have to be done at the API (an existing example is when the instance deleted in this state - the cleanup is done in the API but is not synchronized in this case).

One option I can see is using tack states, using expected_task_state parameter in instance.save() to control state transitions. In the API this makes sense as the calls will be synchronous so if an operation cannot be done it can be reported back to the user in an error return. I'm sure there must be some other options.

Any suggestions would be welcome.

Paul

Paul Murray
Nova Technical Lead, HP Cloud
Hewlett Packard Enterprise
+44 117 316 2527



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20151105/eed926f7/attachment.html>


More information about the OpenStack-dev mailing list