New release: targetd 0.8
by Andy Grover
Hi all,
0.8 adds support for new access_group methods, courtesy of Gris Ge.
Github:
https://github.com/agrover/targetd
tarballs:
https://fedorahosted.org/released/targetd/
targetd-0.8:
Andy Grover <agrover(a)redhat.com> (1):
update version to 0.8
Gris Ge <fge(a)redhat.com> (9):
New method: initiator_list(standalone_only=False)
New method: access_group_list()
New method: access_group_create()
New method: access_group_destroy(ag_name)
New method: access_group_init_add(ag_name, init_id, init_type)
New method: access_group_init_del(ag_name, init_id, init_type)
New method: access_group_map_list()
New method: access_group_map_create(pool_name, vol_name, ag_name,
h_lun_id=None)
New method: access_group_map_destroy(pool_name, vol_name, ag_name)
Regards -- Andy
9 years, 3 months
[PATCH] Fix false alarm on "vol_destroy" about volume is masked.
by Gris Ge
Problem:
'vol_destroy' call will failed with error -303 indicating the
requested volume is masked if that volume was masked to any access group.
Root cause:
The 'destroy()' method use tpg.luns to check whether certain volume is
still masked/exported/mapped to any initiator or access group.
The 'access_group_map_destroy()' does not remove StorageObject and LUN
instances which cause this false alarm.
Fix:
Remove the StorageObject and LUN instances if that lun is not masked to
any initiator in access_group_map_destroy() method.
Tested:
Tested both for access group volume mapping and initiator volume mapping.
Signed-off-by: Gris Ge <fge(a)redhat.com>
---
targetd/block.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/targetd/block.py b/targetd/block.py
index 888e6e4..2d7d1e1 100644
--- a/targetd/block.py
+++ b/targetd/block.py
@@ -582,4 +582,11 @@ def access_group_map_destroy(req, pool_name, vol_name, ag_name):
if map_group.tpg_lun == tpg_lun:
map_group.delete()
+ if not len(list(tpg_lun.mapped_luns)):
+ # If LUN is not masked to any access group or initiator
+ # remove LUN instance.
+ lun_so = tpg_lun.storage_object
+ tpg_lun.delete()
+ lun_so.delete()
+
RTSRoot().save_to_file()
--
1.8.3.1
9 years, 4 months