iscsiadm: Could not login to [iface: default, target: iqn.2021-10.org.freenas.ctl:asm-t1, portal: 192.168.93.53,3260].

willtruenas

Cadet
Joined
Oct 20, 2021
Messages
2
version: TrueNAS-SCALE-21.08-BETA.2.iso
environment: vmwareworkstation 16 pro

iscsi with chap auto failed

Code:
[root@localhost ~]# iscsiadm --mode node --targetname iqn.2021-10.org.freenas.ctl:asm-t1 --portal 192.168.93.53 --login

Logging in to [iface: default, target: iqn.2021-10.org.freenas.ctl:asm-t1, portal: 192.168.93.53,3260] (multiple)

iscsiadm: Could not login to [iface: default, target: iqn.2021-10.org.freenas.ctl:asm-t1, portal: 192.168.93.53,3260].

iscsiadm: initiator reported error (24 - iSCSI login failed due to authorization failure)

iscsiadm: Could not log into all portals
[/CODE]


my config
Code:
cat >>/etc/iscsi/iscsid.conf<<EOF
discovery.sendtargets.auth.authmethod = CHAP
discovery.sendtargets.auth.username = user
discovery.sendtargets.auth.password = pass12345678
EOF



truenas1.png



truenas2.png


truenas3.png


some error logs
Code:
[root@localhost ~]# tail -50f /var/log/messages
Oct 21 22:06:04 localhost kernel: sd 4:0:0:1: [sdc] Write Protect is off
Oct 21 22:06:04 localhost kernel: sd 4:0:0:1: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA
Oct 21 22:06:04 localhost kernel: sd 4:0:0:1: [sdc] Optimal transfer size 16384 bytes
Oct 21 22:06:04 localhost kernel: sd 4:0:0:1: [sdc] Attached SCSI disk
Oct 21 22:06:11 localhost kernel: scsi host5: iSCSI Initiator over TCP/IP
Oct 21 22:06:11 localhost iscsid: iscsid: Connection3:0 to [target: iqn.2021-10.org.freenas.ctl:asm-t3, portal: 192.168.93.53,3260] through [iface: default] is operational now
Oct 21 22:14:48 localhost systemd: Starting Cleanup of Temporary Directories...
Oct 21 22:14:48 localhost systemd: Started Cleanup of Temporary Directories.
Oct 21 22:35:40 localhost systemd-logind: Removed session 1.
Oct 21 22:44:09 localhost systemd-logind: New session 3 of user root.
Oct 21 22:44:09 localhost systemd: Started Session 3 of user root.
Oct 21 22:51:38 localhost kernel: sd 3:0:0:0: [sdb] Synchronizing SCSI cache
Oct 21 22:51:38 localhost iscsid: iscsid: Connection1:0 to [target: iqn.2021-10.org.freenas.ctl:asm-t1, portal: 192.168.93.53,3260] through [iface: default] is shutdown.
Oct 21 22:51:42 localhost kernel: sd 4:0:0:1: [sdc] Synchronizing SCSI cache
Oct 21 22:51:42 localhost iscsid: iscsid: Connection2:0 to [target: iqn.2021-10.org.freenas.ctl:asm-t2, portal: 192.168.93.53,3260] through [iface: default] is shutdown.
Oct 21 22:51:45 localhost iscsid: iscsid: Connection3:0 to [target: iqn.2021-10.org.freenas.ctl:asm-t3, portal: 192.168.93.53,3260] through [iface: default] is shutdown.
Oct 21 22:51:54 localhost kernel: scsi host6: iSCSI Initiator over TCP/IP
Oct 21 22:51:54 localhost iscsid: iscsid: Connection4:0 to [target: iqn.2021-10.org.freenas.ctl:asm-t1, portal: 192.168.93.53,3260] through [iface: default] is operational now
Oct 21 22:51:54 localhost kernel: scsi 6:0:0:0: Direct-Access     TrueNAS  iSCSI Disk       360  PQ: 0 ANSI: 6
Oct 21 22:51:54 localhost kernel: sd 6:0:0:0: Attached scsi generic sg2 type 0
Oct 21 22:51:54 localhost kernel: sd 6:0:0:0: Power-on or device reset occurred
Oct 21 22:51:54 localhost kernel: sd 6:0:0:0: [sdb] 2621444 4096-byte logical blocks: (10.4 GB/10.0 GiB)
Oct 21 22:51:54 localhost kernel: sd 6:0:0:0: [sdb] 16384-byte physical blocks
Oct 21 22:51:54 localhost kernel: sd 6:0:0:0: [sdb] Write Protect is off
Oct 21 22:51:54 localhost kernel: sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA
Oct 21 22:51:54 localhost kernel: sd 6:0:0:0: [sdb] Optimal transfer size 16384 bytes
Oct 21 22:51:54 localhost kernel: sd 6:0:0:0: [sdb] Attached SCSI disk
Oct 21 22:51:58 localhost kernel: sd 6:0:0:0: [sdb] Synchronizing SCSI cache
Oct 21 22:51:58 localhost iscsid: iscsid: Connection4:0 to [target: iqn.2021-10.org.freenas.ctl:asm-t1, portal: 192.168.93.53,3260] through [iface: default] is shutdown.
Oct 21 22:52:18 localhost kernel: scsi host7: iSCSI Initiator over TCP/IP
Oct 21 22:52:18 localhost iscsid: iscsid: Login failed to authenticate with target iqn.2021-10.org.freenas.ctl:asm-t1
Oct 21 22:52:18 localhost iscsid: iscsid: session 5 login rejected: Initiator failed authentication with target
Oct 21 22:52:18 localhost kernel: connection5:0: detected conn error (1020)
Oct 21 22:52:18 localhost iscsid: iscsid: Connection5:0 to [target: iqn.2021-10.org.freenas.ctl:asm-t1, portal: 192.168.93.53,3260] through [iface: default] is shutdown.
Oct 21 22:58:04 localhost kernel: scsi host8: iSCSI Initiator over TCP/IP
Oct 21 22:58:04 localhost iscsid: iscsid: Login failed to authenticate with target iqn.2021-10.org.freenas.ctl:asm-t1
Oct 21 22:58:04 localhost iscsid: iscsid: session 6 login rejected: Initiator failed authentication with target
Oct 21 22:58:04 localhost kernel: connection6:0: detected conn error (1020)
Oct 21 22:58:04 localhost iscsid: iscsid: Connection6:0 to [target: iqn.2021-10.org.freenas.ctl:asm-t1, portal: 192.168.93.53,3260] through [iface: default] is shutdown.
Oct 21 22:58:09 localhost systemd: Stopping Open-iSCSI...
Oct 21 22:58:09 localhost iscsid: iscsid: iscsid shutting down.
Oct 21 22:58:09 localhost systemd: Stopped Open-iSCSI.
Oct 21 22:58:09 localhost systemd: Starting Open-iSCSI...
Oct 21 22:58:09 localhost systemd: Started Open-iSCSI.
Oct 21 22:58:12 localhost kernel: scsi host9: iSCSI Initiator over TCP/IP
Oct 21 22:58:12 localhost iscsid: iscsid: Login failed to authenticate with target iqn.2021-10.org.freenas.ctl:asm-t1
Oct 21 22:58:12 localhost iscsid: iscsid: session 7 login rejected: Initiator failed authentication with target
Oct 21 22:58:12 localhost kernel: connection7:0: detected conn error (1020)
Oct 21 22:58:12 localhost iscsid: iscsid: Connection7:0 to [target: iqn.2021-10.org.freenas.ctl:asm-t1, portal: 192.168.93.53,3260] through [iface: default] is shutdown.
Oct 21 23:01:01 localhost systemd: Started Session 4 of user root.


here have wrong guide:https://www.truenas.com/docs/core/sharing/iscsi/iscsishare/
it should be


Code:
cat >>/etc/iscsi/iscsid.conf<<EOF
node.session.auth.authmethod = CHAP
node.session.auth.username = user
node.session.auth.password = pass12345678
EOF


and success
Code:
[root@localhost ~]# iscsiadm --mode node --targetname iqn.2021-10.org.freenas.ctl:asm-t1 --portal 192.168.93.53 --login
Logging in to [iface: default, target: iqn.2021-10.org.freenas.ctl:asm-t1, portal: 192.168.93.53,3260] (multiple)
Login to [iface: default, target: iqn.2021-10.org.freenas.ctl:asm-t1, portal: 192.168.93.53,3260] successful.
 
Top