Add force detach volume to nova

Registered by wanghao

There is use case: we have two nova components(call them nova A and nova B) and one cinder component. Attach a volume to an instance in nova A and then services of nova A become abnormal. Because the volume also want to be used in nova B, so using cinder api "force detach volume" to free this volume. But when nova A is normal, nova can't detach this volume from instance by using nova api "detach volume" , as nova check the volume state must be "attached".

I think should we add "force detach" function to nova just like "attach" and "detach", because if using force detach volume in cinder, there is still some attach information in nova which can't be cleaned by using nova api "detach".

This will be added to nova-manage:
nova-mange volume force-detach

Blueprint information

Status:
Started
Approver:
John Garbutt
Priority:
Medium
Drafter:
wanghao
Direction:
Needs approval
Assignee:
Andrea Rosa
Definition:
Pending Approval
Series goal:
None
Implementation:
Blocked
Milestone target:
None
Started by
John Garbutt

Whiteboard

There is two ways to implement this :

1. add optional "force_detach" parameter in nova detach api, when using it, nova will detach the volume for clean the attach information whether volume status is attached or detached and call force detach api in cinder.

2. create a new api for nova which named "force detach",it's action will be same as above way.

Consider not more complicated api, I prefer the first one to implement this bp.

Any suggestion is great.

Gerrit topic: https://review.openstack.org/#q,topic:bp/add-force-detach-to-nova,n,z

Addressed by: https://review.openstack.org/84048
    add force detach to nova

Spec review is stalled, un-targeting blueprint from Juno-1 --johnthetubaguy (28th May 2014)

Gerrit topic: https://review.openstack.org/#q,topic:bug/1449221,n,z

Addressed by: https://review.openstack.org/184537
    WIP: adding a volume detach_force call

In a nova-meeting we discussed the need to come up with a work around that doesn't involve an API change. Marked as obsolete. --johnthetubaguy 15th July 2015

Re-approving to track the new patch --johnthetubaguy 20151117

Depends on this:
https://blueprints.launchpad.net/python-cinderclient/+spec/nova-force-detach-needs-cinderclient-api

Pending patches
=============

https://review.openstack.org/#/c/184537/24/nova/cmd/manage.py,cm

Moving this to blocked, due to discussions here:
http://lists.openstack.org/pipermail/openstack-dev/2015-December/082683.html
And the uncovering of this:
https://review.openstack.org/#/c/260339/

moved to newton --johnthetubaguy 2nd march 2016

(?)

Work Items

Work items:
Code: INPROGRESS

This blueprint contains Public information 
Everyone can see this information.