[openstack-dev] [Nova] attaching and detaching volumes in the API
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 __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Nova] attaching and detaching volumes in the API
On 11/05/2015 12:13 PM, Murray, Paul (HP Cloud) wrote: 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. Whatever you do requires a single synchronization point. If we can't use nova-compute, the only other option is the database. (Since we don't yet have a DLM.) Chris __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev