VNX: update sg in cache

When `destroy_empty_storage_group` is enabled, the sg will be deleted
after the last lun is detached from it. The issue is that the sg cache
isn't updated, which caused the failure of subsequent attaching volumes
to the same host because the sg in the cache will be used directly which
doesn't exist any more.

The fix is updating the sg with poll after deleting it. This doesn't
delete the sg from cache explicitly but makes sure the sg in cache with
latest status `not-exist`. Subsequent attaching will create the sg if it
is `not-exist`.

Closes-bug: #1817385
Change-Id: Ibb39879a77c97c6a5d885461e93116810d16b265
(cherry picked from commit eefd8302b3)
(cherry picked from commit 1f57f502c8)
(cherry picked from commit 29d42fa734)
(cherry picked from commit dcfc2f3d5a)
This commit is contained in:
Ryan Liang 2019-02-25 17:43:46 +08:00
parent 2a5979e4e7
commit 187016c285
4 changed files with 20 additions and 1 deletions

View File

@ -1846,6 +1846,8 @@ test_terminate_connection_cleanup_remove_sg:
delete:
disconnect_host:
get_alu_hlu_map: {}
update:
with_poll: _context
test_terminate_connection_cleanup_sg_absent:
sg:
@ -1859,6 +1861,8 @@ test_terminate_connection_cleanup_deregister:
delete:
disconnect_host:
get_alu_hlu_map: {}
update:
with_poll: _context
vnx:
_methods:
remove_hba:

View File

@ -1069,6 +1069,11 @@ class CommonAdapter(object):
LOG.info(_LI("Storage Group %s is empty."), sg.name)
sg.disconnect_host(sg.name)
sg.delete()
# Update sg with poll makes the one in client.sg_cache is with
# latest status which is un-exist. This makes sure the sg is
# created during next attaching.
self.update_storage_group_if_required(sg)
if host is not None and self.itor_auto_dereg:
# `host` is None when force-detach
self._deregister_initiator(host)

View File

@ -72,9 +72,12 @@ class VNXDriver(driver.ManageableVD,
9.0.0 - Use asynchronous migration for cloning
9.0.1 - Extend SMP size before aync migration when cloning from an
image cache volume
9.0.2 - Fix bug https://bugs.launchpad.net/cinder/+bug/1817385 to
make sure sg can be created again after it was destroyed
under `destroy_empty_stroage_group` setting to `True`
"""
VERSION = '09.00.01'
VERSION = '09.00.02'
VENDOR = 'Dell EMC'
# ThirdPartySystems wiki page
CI_WIKI_NAME = "EMC_VNX_CI"

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Dell EMC VNX Driver: Fixes `bug 1817385
<https://bugs.launchpad.net/cinder/+bug/1817385>`__ to make sure the sg can
be created again after it was destroyed under `destroy_empty_storage_group`
setting to `True`.