Currently Cinder recover volume's status before remove_export,
which leads that recreated iSCSI targets may be deleted and
attachment fails.
Let's consider the case: A volume is attached to instance A, and then
detached. During detach, Cinder sets volume's status to available and
remove iSCSI targets.
At the exact time the volume is reset to
available but targets are not removed, the volume is attached to
instance 2 and targets are created again. And then former remove_export
removed the recreated targets, and then it leads attachment fail.
This patch is to move remove_export after changing volume's
status.
Reviewed: https:/ /review. openstack. org/360211 /git.openstack. org/cgit/ openstack/ cinder/ commit/ ?id=c3b33b6a23c 885853d28cb340a 394d72cd18839a
Committed: https:/
Submitter: Jenkins
Branch: master
commit c3b33b6a23c8858 53d28cb340a394d 72cd18839a
Author: lisali <email address hidden>
Date: Thu Aug 25 12:03:31 2016 +0800
Recover volume status after remove_export
Currently Cinder recover volume's status before remove_export,
which leads that recreated iSCSI targets may be deleted and
attachment fails.
Let's consider the case: A volume is attached to instance A, and then
detached. During detach, Cinder sets volume's status to available and
remove iSCSI targets.
At the exact time the volume is reset to
available but targets are not removed, the volume is attached to
instance 2 and targets are created again. And then former remove_export
removed the recreated targets, and then it leads attachment fail.
This patch is to move remove_export after changing volume's
status.
Change-Id: I914d4badd9b93e 9dc8f4ebc4f7431 4afe95bf855
Closes-Bug: #1616719