Avoid API conflicting operations in parallel

Registered by Rui Chen

Currently when we attach/detach volume and network interface from instance,
the task state of the instance is unchanged, it cause some issues.

1. In some API concurrent requests scenarios the operation results are
   unpredictable and inconclusive, for example: do the concurrent operation
   rebuilding-instance and detaching-volume for the same instance. Because
   task_state of instance isn't set when detaching volume,
   @check_instance_state is bypassed, nova-compute start to execute rebuilding
   and detaching-volume on one instance at the same time. It cause the
   unpredictable result, sometimes the operations were successful, but
   sometimes it would be fails according to the time sequence of concurrent
   operations. We should do these tasks one by one.

   Think about the following failed case:
      1. start to detach volume from instance in nova-api
      2. start to rebuild instance in nova-api, get the instance bdms from db,
         because the detaching volume don't finish, so the bdms contain the
         volume that will be detached.
      3. start to detach volume from instance in nova-compute, and detaching
         finish successfully, the bdm of this volume is destroyed.
      4. start to rebuild the instance in nova-compute, try to detach all the
         volumes according to the bdms that pass through from nova-api and
         contain the volume had been detached. That would be failed, because
         the bdm of the volume can't be found. Exception VolumeBDMNotFound was
         raised.
      5. rebuilding failed, the instance is set to ERROR.

This blueprint try to fix these issue on API rebuild/resize/shelved/unshelved

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Rui Chen
Direction:
Needs approval
Assignee:
None
Definition:
Superseded
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Rui Chen

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.