add force detach to nova

Change-Id: Ic4f9a0b3e2443db7852e8c5c18ce37584dff6943
This commit is contained in:
wanghao 2014-03-31 11:51:58 +08:00
parent 525c1121ec
commit 55397acd13
1 changed files with 124 additions and 0 deletions

View File

@ -0,0 +1,124 @@
..
This work is licensed under a Creative Commons Attribution 3.0 Unported
License.
http://creativecommons.org/licenses/by/3.0/legalcode
=================================================================
Add force detach to nova
=================================================================
https://blueprints.launchpad.net/nova/+spec/add-force-detach-to-nova
Add force detach to nova for cleaning the attach information in nova,
and make it better than only calling "force detach" in cinder like
attach and detach.
Problem description
====================
There is use case: we have two nova componentscall 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".
proposed change
================
1. Add optional "force_detach" parameter which is boolean variable
(default value is false) in nova detach api.
2. When force_detach is true, nova will detach the volume for clean the attach information
whether volume status is attached or detached.
3. Then call force detach api in cinder.
Alternatives
-------------
None
Data model impact
------------------
None
REST API impact
----------------
Add an optional parameter "force_detach=true/false"
in rest body of nova detach api.
Security Impact
---------------
None
Notifications impact
---------------------
None
Other End user impact
-----------------------
None
Performance Impact
---------------------
There is no impact about the performance of nova.
Deployer impact
----------------
None
Developer impact
----------------
None
Implementation
==============
Assignee(s)
-----------
Assignee: wanghao749 <wanghao749@huawei.com>
Work Items
----------
None
Dependencies
============
None
Testing
=======
Unit tests and tempest tests will check "force detach" function.
Documentation Impact
====================
A description of this function will be added into Compute API V2 Reference.
References
==========
None