Don't call begin_detaching when detaching volume from shelved vm
When shelve an instance, if the instance has volume attached,
with new attach/detach flow, we will delete the old attachment
and create a new attachment, the volume status will be ``reserved``.
If the user tries to detach these volumes, it fails due to that
Cinder does not allow a begin_detaching() call on a `reserved` volume.
Actually for shelved instances, we can just skip this step and
directly detach it.
Change-Id: Ib1799feebbd8f4b0f389168939df7e5e90c8add1
closes-bug: #1808089
(cherry picked from commit 41b982c9feec3105247bc72d23d1470bcabc3a0f)
(cherry picked from commit e7dc43bf848105fdd24b89216676e3a56f1f6689)
Reviewed: https:/ /review. openstack. org/633962 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=b8704a1d1cf e0b1fecfb21fb93 73b0659f9a611d
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit b8704a1d1cfe0b1 fecfb21fb9373b0 659f9a611d
Author: Kevin_Zheng <email address hidden>
Date: Thu Dec 13 19:31:13 2018 +0800
Don't call begin_detaching when detaching volume from shelved vm
When shelve an instance, if the instance has volume attached,
with new attach/detach flow, we will delete the old attachment
and create a new attachment, the volume status will be ``reserved``.
If the user tries to detach these volumes, it fails due to that
Cinder does not allow a begin_detaching() call on a `reserved` volume.
Actually for shelved instances, we can just skip this step and
directly detach it.
Change-Id: Ib1799feebbd8f4 b0f389168939df7 e5e90c8add1 5247bc72d23d147 0bcabc3a0f) dd24b89216676e3 a56f1f6689)
closes-bug: #1808089
(cherry picked from commit 41b982c9feec310
(cherry picked from commit e7dc43bf848105f