RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 908368 - targetcli: How to access different LUNs using different IQNs.
Summary: targetcli: How to access different LUNs using different IQNs.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: targetcli
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Andy Grover
QA Contact: Bruno Goncalves
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-06 14:30 UTC by Bruno Goncalves
Modified: 2023-03-08 07:25 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-04-24 11:58:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
targetcli ls output (2.55 KB, text/plain)
2013-02-06 14:37 UTC, Bruno Goncalves
no flags Details

Description Bruno Goncalves 2013-02-06 14:30:07 UTC
I'm trying to configure LIO to provide different LUNs depending on iqn.

I think I'm making something wrong there, would you know what is the problem?

I'm trying to login with iqn mapped to tpg2
(iqn.1994-05.com.redhat:storage-initiator2) and I only want to access tpg2 LUN.

targetcli /iscsi/iqn.1994-05.com.redhat:storage-target ls
o- iqn.1994-05.com.redhat:storage-target
....................................................................................
[2 TPGs]
o- tpg1
................................................................................................................
[enabled]
| o- acls
................................................................................................................
[1 ACL]
| | o- iqn.1994-05.com.redhat:storage-initiator1-boot
.................................................................. [2
Mapped LUNs]
| | o- mapped_lun0
......................................................................... [lun0
block/storage-initiator1-boot (rw)]
| | o- mapped_lun1
...........................................................................
[lun1 block/storage-initiator1-io (rw)]
| o- luns
...............................................................................................................
[2 LUNs]
| | o- lun0 .....................................................
[block/storage-initiator1-boot (/dev/iscsi_backend/storage-initiator1-boot)]
| | o- lun1 .........................................................
[block/storage-initiator1-io (/dev/iscsi_backend/storage-initiator1-io)]
| o- portals
..........................................................................................................
[1 Portal]
| o- [::0]:3260
...........................................................................................................
[OK]
o- tpg2
................................................................................................................
[enabled]
o- acls
................................................................................................................
[1 ACL]
| o- iqn.1994-05.com.redhat:storage-initiator2
......................................................................... [1
Mapped LUN]
| o- mapped_lun0
.............................................................................
[lun0 block/storage-initiator2 (rw)]
o- luns
................................................................................................................
[1 LUN]
| o- lun0 .............................................................
[block/storage-initiator2 (/dev/iscsi_backend/storage-initiator2)]
o- portals
..........................................................................................................
[1 Portal]
o- [::0]:3260
...........................................................................................................
[OK]

----
Feb 4 14:59:25 storage-target kernel: [338881.456551] iSCSI Initiator
Node: iqn.1994-05.com.redhat:storage-initiator2 is not authorized to access
iSCSI target portal group: 1.
Feb 4 14:59:25 storage-target kernel: [338881.519016] iSCSI Login
negotiation failed.
Feb 4 14:59:25 storage-target kernel: [338881.542073] iSCSI Initiator
Node: iqn.1994-05.com.redhat:storage-initiator2 is not authorized to access
iSCSI target portal group: 1.
Feb 4 14:59:25 storage-target kernel: [338881.602433] iSCSI Login
negotiation failed.

Comment 2 Bruno Goncalves 2013-02-06 14:37:06 UTC
Created attachment 693961 [details]
targetcli ls output

Comment 3 Bruno Goncalves 2013-02-06 14:38:32 UTC
rpm -q targetcli
targetcli-2.0rc1.fb19-1.el7.noarch

Comment 4 Andy Grover 2013-02-19 22:28:30 UTC
I think you should be able to use a single TPG, but just map different luns to each initiator via separate ACLs?

Also, separate TPGs should not allow you to use the same NetworkPortal for both, I think this is only slightly related but will be fixed in kernel 3.9 most likely.

Comment 5 Bruno Goncalves 2013-03-11 15:12:51 UTC
It seems to work. The only problem when having more than one ACL per TPG is that every new LUN that is created on TPG is automatically mapped to all ACLS...

Comment 6 Andy Grover 2013-03-21 23:10:28 UTC
Ah ok, for that do "set global auto_add_mapped_luns=false".

Comment 7 Bruno Goncalves 2013-04-24 11:58:12 UTC
perfect, it does work.


Note You need to log in before you can comment on or make changes to this bug.