diff --git a/manila/share/drivers/glusterfs/layout_volume.py b/manila/share/drivers/glusterfs/layout_volume.py index 3a6d13a84a..882fa97c45 100644 --- a/manila/share/drivers/glusterfs/layout_volume.py +++ b/manila/share/drivers/glusterfs/layout_volume.py @@ -435,6 +435,10 @@ class GlusterfsVolumeMappedLayout(layout.GlusterfsShareLayoutBase): gmgr.set_vol_option(USER_MANILA_SHARE, 'NONE') gmgr.set_vol_option('nfs.disable', 'on') + # When deleting the share instance, we need to + # update'self.gluster_used_vols' again + self.gluster_used_vols = set() + self.gluster_used_vols.add(gmgr.qualified) self._push_gluster_vol(gmgr.qualified) except exception.GlusterfsException: msg = ("Error during delete_share request for " diff --git a/manila/tests/share/drivers/glusterfs/test_layout_volume.py b/manila/tests/share/drivers/glusterfs/test_layout_volume.py index b91b311366..a5e0da6699 100644 --- a/manila/tests/share/drivers/glusterfs/test_layout_volume.py +++ b/manila/tests/share/drivers/glusterfs/test_layout_volume.py @@ -587,6 +587,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase): gmgr1 = gmgr(self.glusterfs_target1, self._execute, None, None) gmgr1.set_vol_option = mock.Mock() gmgr1.get_vol_option = mock.Mock(return_value=clone_of) + new_vol_addr = self.glusterfs_target1 self.mock_object(self._layout, '_glustermanager', mock.Mock(return_value=gmgr1)) self._layout.gluster_used_vols = set([self.glusterfs_target1]) @@ -596,6 +597,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase): gmgr1.get_vol_option.assert_called_once_with( 'user.manila-cloned-from') self._layout._wipe_gluster_vol.assert_called_once_with(gmgr1) + self.assertIn(new_vol_addr, self._layout.gluster_used_vols) self._layout._push_gluster_vol.assert_called_once_with( self.glusterfs_target1) self._layout.private_storage.delete.assert_called_once_with( diff --git a/releasenotes/notes/bug-1894362-fix-Glusterfs-del-share-3c8467e1d9f0c6e4.yaml b/releasenotes/notes/bug-1894362-fix-Glusterfs-del-share-3c8467e1d9f0c6e4.yaml new file mode 100644 index 0000000000..e1cd5f3e08 --- /dev/null +++ b/releasenotes/notes/bug-1894362-fix-Glusterfs-del-share-3c8467e1d9f0c6e4.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixed `bug #1894362 `_ + Fixed the problem of Couldn't find the'gluster_used_vols' error when + deploying glusterfs driver multi-backend service and deleting share + instance.