You are not logged in.

#1 2012-04-12 15:27:16

faicker
Member
Registered: 2012-04-12
Posts: 5

[SOLVED] iscsi target lio (targetcli_fb) problem

I configured the targetcli:(don't use authentication)

tpg1> set parameter AuthMethod=None
set attribute authentication=0

/etc/rc.d/target run well.
But when the initiator connects the target, target reports the error:

iSCSI Initiator Node: iqn.xxxx-xxxx-xxxx is not authorized to access iSCSI target portal group: 1

uname -a
Linux  3.2.13-1-ARCH

what else settings? Thanks.
This is the saveconfig.json
-------------------------------------------

{
  "fabric_modules": [],
  "storage_objects": [
    {
      "attributes": {
        "block_size": 512,
        "emulate_dpo": 0,
        "emulate_fua_read": 0,
        "emulate_fua_write": 1,
        "emulate_rest_reord": 0,
        "emulate_tas": 1,
        "emulate_tpu": 0,
        "emulate_tpws": 0,
        "emulate_ua_intlck_ctrl": 0,
        "emulate_write_cache": 0,
        "enforce_pr_isids": 1,
        "is_nonrot": 0,
        "max_sectors": 1024,
        "max_unmap_block_desc_count": 0,
        "max_unmap_lba_count": 0,
        "optimal_sectors": 1024,
        "queue_depth": 32,
        "unmap_granularity": 0,
        "unmap_granularity_alignment": 0
      },
      "buffered_mode": true,
      "dev": "/home/faicker/test.img",
      "name": "disk1",
      "plugin": "fileio",
      "size": 10737418240,
      "wwn": "b83cf4a1-5e30-4df4-a5a2-ac7163d78a4d"
    }
  ],
  "targets": [
    {
      "fabric": "iscsi",
      "tpgs": [
        {
          "attributes": {
    "authentication": 0,
    "cache_dynamic_acls": 0,
    "default_cmdsn_depth": 16,
    "demo_mode_write_protect": 1,
    "generate_node_acls": 0,
    "login_timeout": 15,
    "netif_timeout": 2,
    "prod_mode_write_protect": 0
  },
  "enable": 1,
  "luns": [
    {
      "index": 0,
      "storage_object": "/backstores/fileio/disk1"
    }
  ],
  "node_acls": [],
  "parameters": {
    "AuthMethod": "None",
    "DataDigest": "CRC32C,None",
    "DataPDUInOrder": "Yes",
    "DataSequenceInOrder": "Yes",
    "DefaultTime2Retain": "20",
    "DefaultTime2Wait": "2",
    "ErrorRecoveryLevel": "0",
    "FirstBurstLength": "65536",
    "HeaderDigest": "CRC32C,None",
    "IFMarkInt": "2048~65535",
    "IFMarker": "No",
    "ImmediateData": "Yes",
    "InitialR2T": "Yes",
    "MaxBurstLength": "262144",
    "MaxConnections": "1",
    "MaxOutstandingR2T": "1",
    "MaxRecvDataSegmentLength": "8192",
    "OFMarkInt": "2048~65535",
            "OFMarkInt": "2048~65535",
            "OFMarker": "No",
            "TargetAlias": "LIO Target"
          },
          "portals": [
            {
              "ip_address": "0.0.0.0",
              "port": 3260
            }
          ],
          "tag": 1
        }
      ],
      "wwn": "iqn.2003-01.org.linux-iscsi.u205.x8664:sn.5f9e1e0139f2"
    }
  ]
}

Last edited by faicker (2012-04-16 15:27:21)


easy arch

Offline

#2 2012-04-13 16:37:47

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [SOLVED] iscsi target lio (targetcli_fb) problem

You need to authorize the initiator:

/iscsi/.../tpg1> cd acls
/iscsi/.../acls> create <initiator iqn>

Just use the "iqn.xxxx-xxxx-xxxx" from the error message you posted.

This is straight from the ISCSI Target wiki page.

Also, you need to learn how to use code tags.

Last edited by alphaniner (2012-04-13 16:40:24)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2012-04-14 15:34:09

faicker
Member
Registered: 2012-04-12
Posts: 5

Re: [SOLVED] iscsi target lio (targetcli_fb) problem

/iscsi/iqn.20...1e0139f2/tpg1> ls /
o- / ..................................................................... [...]
  o- backstores .......................................................... [...]
  | o- block ................................................ [0 Storage Object]
  | o- fileio ............................................... [1 Storage Object]
  | | o- disk1 ........................ [/home/mocan/test.img (10.0G) activated]
  | o- pscsi ................................................ [0 Storage Object]
  | o- ramdisk .............................................. [0 Storage Object]
  o- ib_srpt ....................................................... [Not found]
  o- iscsi .......................................................... [1 Target]
  | o- iqn.2003-01.org.linux-iscsi.u205.x8664:sn.5f9e1e0139f2 .......... [1 TPG]
  |   o- tpg1 ........................................................ [enabled]
  |     o- acls ........................................................ [1 ACL]
  |     | o- iqn.2003-01.org.linux-iscsi.u205.x8664:sn.5f9e1e0139f2  [1 Mapped LUN]
  |     |   o- mapped_lun0 ............................ [lun0 fileio/disk1 (rw)]
  |     o- luns ........................................................ [1 LUN]
  |     | o- lun0 ........................ [fileio/disk1 (/home/mocan/test.img)]
  |     o- portals .................................................. [1 Portal]
  |       o- 0.0.0.0:3260 ................................................. [OK]
  o- loopback ....................................................... [0 Target]
  o- qla2xxx ....................................................... [Not found]
  o- tcm_fc ........................................................ [Not found]

This is targetcli ls / result.
the open-iscsi initiator report error:

iscsiadm: initiator reported error (19 - encountered non-retryable iSCSI login failure)

It still wasn't solved.

Last edited by faicker (2012-04-14 15:36:07)


easy arch

Offline

#4 2012-04-16 14:07:19

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [SOLVED] iscsi target lio (targetcli_fb) problem

From your output:

| o- iqn.2003-01.org.linux-iscsi.u205.x8664:sn.5f9e1e0139f2 .......... [1 TPG]
...
  |     | o- iqn.2003-01.org.linux-iscsi.u205.x8664:sn.5f9e1e0139f2  [1 Mapped LUN]

You have the same iqn in both places.  This is wrong.  The first iqn is that of your iSCSI target.  The second iqn needs to be that of the iSCSI initiator which will connect to the target.  Here is my working configuration:

/iscsi> ls
o- iscsi ............................................................ [1 Target]
  o- iqn.2003-01.org.linux-iscsi.crapshoot.x8664:sn.cfca64dc8830 ....... [1 TPG]
    o- tpg1 .......................................................... [enabled]
      o- acls .......................................................... [1 ACL]
      | o- iqn.2005-03.org.open-iscsi:c3b952dbf91 ............... [1 Mapped LUN]
      |   o- mapped_lun0 ............................. [lun0 block/sasdisk (rw)]
      o- luns .......................................................... [1 LUN]
      | o- lun0 .................................... [block/sasdisk (/dev/sdb1)]
      o- portals .................................................... [1 Portal]
        o- 0.0.0.0:3260 ................................................... [OK]

If open-iscsi is your initiator, you should be able to find its iqn in /etc/iscsi/initiatorname.iscsi.  Or, as I suggested before, just get the initiator iqn from the error message.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#5 2012-04-16 15:17:06

faicker
Member
Registered: 2012-04-12
Posts: 5

Re: [SOLVED] iscsi target lio (targetcli_fb) problem

Thanks alphaniner. smile
My problem is solved.


easy arch

Offline

#6 2012-04-16 15:23:26

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [SOLVED] iscsi target lio (targetcli_fb) problem

Happy to help.  Please edit your first post and prepend [SOLVED] to the title.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

Board footer

Powered by FluxBB