How to troubleshoot iSCSI issues in CentOS / RHEL 6,7?

Internet Small Computer System Interface (iSCSI) is an IP-based standard for connecting storage devices. iSCSI uses IP networks to encapsulate SCSI commands, allowing data to be transferred over long distances. iSCSI provides shared storage among a number of client systems. Storage devices are attached to servers (targets). Client systems (initiators) access the remote storage devices over IP networks. To the client systems, the storage devices appear to be locally attached. iSCSI uses the existing IP infrastructure and does not require any additional cabling, as is the case with Fibre Channel (FC) storage area networks.

 

The post describes how to troubleshoot iSCSI issue using tcpdump.

 

Useful Commands

 

Below are some useful commands to gather information on the current iSCSI setup that you may have.

 

1. To get target list, run:

# iscsiadm -m discovery

 

2. To get the node list, run:

# iscsiadm -m node

 

3. The iscsid daemon opens a TCP session with the target . To check the open session, run:

# iscsiadm -m session

OR

# netstat -tpan | grep iscsid

or check /sys/class/iscsi_session

 

4. Find which session a disk belongs to:

# iscsiadm -m session

 

The output will include active sessions and attached scsi disks.

 

Debuging iSCSI issues

 

1. Log out of the iSCSI connections with the command:

# iscsiadm --mode node --targetname [target_name(iqn)] --portal [target_IP:port_number] --logout

 

2. Stop the iscsid daemon:

# service iscsid stop   ### RHEL 6
# systemctl iscsid stop   ### RHEL 7

 

3. Start the packet capture on the network interface:

# tcpdump -s0 -i [interface] -w /var/tmp/[interface]-dump.pcap

 

4. Start iscsid in debug mode and write all the outputs into the file /tmp/iscsid.log :

# iscsid -d 8 -c /etc/iscsi/iscsid.conf -i /etc/iscsi/initiatorname.iscsi -f &> /tmp/iscsid.log

 

5. After that login again into the target:

# iscsiadm --mode node --targetname [target_name] --portal [target_IP:port_number] --login

 

Wait until you have errors in the logs. Then stop both the tcpdump and the iscsid program to review (*.pcap and iscsid.log).

 

NOTE: Adding the parameter “-d 8” to the init.d script won’t add any debugging log into the /var/log/messages.

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)