Red Hat Enterprise Linux Diagnostics and Troubleshooting
Troubleshoot and resolve issues with an iSCSI initiator.
Outcomes
You should be able to identify and resolve a misconfiguration of an iSCSI initiator on a client system.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
[student@workstation ~]# lab start storage-iscsi
This command prepares an iSCSI storage device, ACL, and initiator.
Instructions
The serverb system is configured with a iSCSI target named iqn.2021-10.com.example.lab:target1. The target is configured with an ACL that grants access only to the iqn.2021-10.com.example.lab:servera IQN. The target is configured without authentication.
Another administrator configured the servera system to use iqn.2021-10.com.example.lab:target1 as the target. The administrator can discover the target, but cannot log in to it. Troubleshoot, identify, and correct the issue so that the initiator can successfully log in to the target.
Log in to
serveraand switch to therootuser.[student@workstation ~]$
ssh student@servera...output omitted... [student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#Verify that the client cannot log in to the target and that no active sessions exist.
Verify that the system has a successfully discovered target.
[root@servera ~]#
iscsiadm -m node172.25.250.11:3260,1 iqn.2021-10.com.example.lab:target1Verify that the system has no active sessions.
[root@servera ~]#
iscsiadm -m sessioniscsiadm: No active sessions.Attempt to log in to the target. Verify that the login fails, and view the displayed errors.
[root@servera ~]#
iscsiadm -m node -T iqn.2021-10.com.example.lab:target1 -lLogging in to [iface: default, target: iqn.2021-10.com.example.lab:target1, portal: 172.25.250.11,3260] iscsiadm: Could not login to [iface: default, target: iqn.2021-10.com.example.lab:target1, portal: 172.25.250.11,3260]. iscsiadm: initiator reported error (24 - iSCSI login failed due to authorization failure) iscsiadm: Could not log into all portals
Using the
-ddiagnostic option, attempt to log in to the target again, and then view the extra debug information. Because the error messages indicated an authorization failure, look for debug messages with an "auth" keyword.[root@servera ~]#
iscsiadm -m node -T iqn.2021-10.com.example.lab:target1 -l -d8...output omitted... iscsiadm: updated 'node.session.auth.authmethod', 'None' => 'CHAP' ...output omitted...The debug messages indicate that the initiator used CHAP authentication. Because the target uses no authentication, the initiator's authorization method is incorrect.
Correct the configuration in
/etc/iscsi/iscsid.confby commenting out the following line:# node.session.auth.authmethod = CHAP
Despite changing the initiator configuration, the previous target settings persist in the
/var/lib/iscsi/nodesconfiguration cache. Clear the saved configuration with theiscsiadmcommand.[root@servera ~]#
iscsiadm -m node -T iqn.2021-10.com.example.lab:target1 -o deleteRestart the
iscsidservice.[root@servera ~]#
systemctl restart iscsidRediscover the target.
[root@servera ~]#
iscsiadm -m discovery -t st -p serverb.lab.example.com172.25.250.11:3260,1 iqn.2021-10.com.example.lab:target1
Attempt to log in to the target to verify that the login issue is resolved.
[root@servera ~]#
iscsiadm -m node -T iqn.2021-10.com.example.lab:target1 -lLogging in to [iface: default, target: iqn.2021-10.com.example.lab:target1, portal: 172.25.250.11,3260] iscsiadm: Could not login to [iface: default, target: iqn.2021-10.com.example.lab:target1, portal: 172.25.250.11,3260]. iscsiadm: initiator reported error (24 - iSCSI login failed due to authorization failure) iscsiadm: Could not log into all portalsDespite fixing the initiator's authentication configuration, the issue persists. Verify that the initiator IQN matches the
iqn.2021-10.com.example.lab:serveraIQN as defined in the ACL.[root@servera ~]#
cat /etc/iscsi/initiatorname.iscsiInitiatorName=iqn.2021-10.lab.example.com:serveraThe initiator name is incorrectly configured because the domain name is not reversed. Fix the name and restart the
iscsidservice to implement the change.Fix the initiator name.
[root@servera ~]#
echo InitiatorName=iqn.2021-10.com.example.lab:servera > /etc/iscsi/initiatorname.iscsiRestart the
iscsidservice.[root@servera ~]#
systemctl restart iscsid
Attempt to log in to the target to verify that the login issue is resolved.
[root@servera ~]#
iscsiadm -m node -T iqn.2021-10.com.example.lab:target1 -lLogging in to [iface: default, target: iqn.2021-10.com.example.lab:target1, portal: 172.25.250.11,3260] Login to [iface: default, target: iqn.2021-10.com.example.lab:target1, portal: 172.25.250.11,3260] successful.Return to
workstationas thestudentuser.[root@servera ~]#
exit[student@servera ~]$exit[student@workstation ~]$