Add instance_state to ensure volume attachment successful

Registered by Brin Zhang

In continuous attaching volumes, if the attching volume takes off too long time in nova-compute, and at the same time, another attaching request received by nova-api, nova-api will post RPC call request to nova-compute to create bdm. If the nova-compute won't return the response in time, the nova-api will wait timeout and raise Exception. However, the nova-compute will still create bdm when attaching the previous volume over. The log is the problem log when attaching the second volume.

We would like to add attaching/detachting status, to solve this issue.

An alternative would be to drop the RPC call to reserve_block_device_name entirely as the returned device isn't guaranteed to be the actual device that ends up being presented within the guestOS anyway by most hypervisors (namely libvirt). We could always create the bdm in the API and update the device once attached on the compute.

more details you can refer https://bugs.launchpad.net/nova/+bug/1897424

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Brin Zhang
Direction:
Needs approval
Assignee:
Brin Zhang
Definition:
New
Series goal:
Proposed for wallaby
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.opendev.org/#/q/topic:bp/ensure-volume-attachment-successful

Addressed by: https://review.opendev.org/758918
    reject attach and detach volume while task_state is not None

Addressed by: https://review.opendev.org/754258
    add task state for attach volume and detach volume

Addressed by: https://review.opendev.org/758920
    Add ensure-volume-attachment-successful.rst spec

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.