On 12/10/2014 07:45 PM, Gris Ge wrote:
On Wed, Dec 10, 2014 at 11:17:22AM -0800, Andy Grover wrote:
>> 6. Can NodeACLGroup automatically chose the host LUN ID like LUN class do?
>
> NodeACLGroup.mapped_lun()? You shouldn't need to give it a tpg_lun,
> only the LUN to map it to. I don't think I understand this issue.
In LUN class, we have these codes for find next available target LUN ID:
if lun is None:
luns = [l.lun for l in self.parent_tpg.luns]
for index in xrange(self.MAX_LUN+1):
if index not in luns:
lun = index
break
if lun is None:
raise RTSLibError("All LUNs 0-%d in use" % self.MAX_LUN)
else:
lun = int(lun)
if lun < 0 or lun > self.MAX_LUN:
raise RTSLibError("LUN must be 0 to %d" % self.MAX_LUN)
So I am expecting to have similar code in NodeACLGroup.mapped_lun() to find
next available host LUN ID.
Yes, the client should find (or create) a LUN object before creating a
MappedLUN or MappedLUNGroup. targetd does this already when creating a
MappedLUN, it should be exactly the same when creating a MappedLUNGroup.
>> 8. How to check whether a NodeACL is in a NodeACLGroup?
>> Options A:
>> NodeACL.tag
>> # This require user know NodeACLGroup internal design.
>> Options B:
>> NodeACL.is_group_member # True or False
>
> I thought we were trying to make it possible to use NodeACLGroups
> with no NodeACL objects. Are you finding you still have NodeACL
> objects?
To achieve backward compatibility in libstoragemgmt targetd plugin(at lest we
try to), we still want to provide initiator level LUN mapping in targetd.
But for sure, it will be isolated from access group level LUN mapping.
That's why we need to know we are not touching any access group member there.
In that case I'd say it's ok to just check if nodeacl.tag == None.
BTW I've renamed NodeACLGroup.mapped_lun() to .mapped_lun_group(), so
that it matches the renamed mapped_lun_groups property name.
I'll be pushing a rebased and squashed set to the dev-groups branch
today. If you want to take one last look, then I think we're close to
being ready to merge it.
Thanks -- Regards -- Andy