In complex storage environments, iSCSI lets you present remote block devices over a standard IP network just as if they were local disks. But when a connection drops, volumes fail to mount or performance degrades, tracking down the root cause can be challenging. CentOS and RHEL (6 and 7) include tools that help you inspect discovery records, session status and low-level network traffic—making it possible to pinpoint authentication errors, misconfigured portals or intermittent packet loss.

In this guide you’ll learn how to:

  • Gather your current iSCSI configuration and session details

  • Capture and analyse network packets between initiator and target

  • Run the iSCSI daemon in debug mode to collect detailed logs

  • Compare service management commands on CentOS/RHEL 6 versus 7

With these techniques you’ll be able to isolate login failures, timeouts or data-transfer hiccups and restore reliable access to your shared storage.

 

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.

 

Esta resposta foi útil? 0 Utilizadores acharam útil (0 Votos)