Re: Help with RTSLib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/13/2012 06:16 AM, Holcombe, Christopher wrote:
>                 for a in acl_wwn:
>                                 tpg = TPG(target, lun_id)
>                                 map_lun = tpg.lun(lun_id, so, name)

> Depending on how I rework the code I get something like this:

>     tpg = TPG(target, lun_id)
>   File "/usr/lib/python2.7/dist-packages/rtslib/target.py", line 999, in __init__
>     raise RTSLibError("Target cannot have multiple TPGs.")
> rtslib.utils.RTSLibError: Target cannot have multiple TPGs.

Try just creating one TPG object. For each StorageObject you will then
need to add it to the tpg, creating a LUN object. Add a NodeACL to the
TPG for each initiator, and for each NodeACL, create a MappedLUN to give
the NodeACL access to the tpg LUN.

So it's a bit of a two-step process for fabrics that support ACLs. It
makes more sense given that all fabrics don't support ACLs. For those,
they just add the StorageObject to the TPG. But for fabrics that have
initiator ACLs, they do that, and then also need to grant access to the
TPG LUN by a given NodeACL with the MappedLUN.

so if you want to map a single storageobject to multiple initiators:

target = Target(fabric)
tpg = TPG(target)
lun = LUN(tpg, lun=0, so=so)

for init_wwn in initiator_wwns:
    node_acl = NodeACL(tpg, init_wwn)
    mlun = MappedLUN(node_acl, lun)

Hope this helps -- Regards -- Andy
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux