Problem
The iSCSI targets may not be discovered after rebooting CentOS/RHEL server. The iSCSI daemon does not show any active sessions after the reboot.
# iscsiadm -m session iscsiadm: No active sessions.
iSCSI might show the following errors:
# iscsiadm -m node []:3260,-1 []:3260,-1 []:3260,-1 []:3260,-1 []:3260,-1 []:3260,-1 []:3260,-1 []:3260,-1 []:3260,-1 []:3260,-1 []:3260,-1 []:3260,-1 ...
Solution
The iSCSI daemon was abnormal and when rebooting the server the iSCSI service didn’t start correctly. The following behaviour may be observed when there is a corruption of the iSCSI utilities. The symptoms may be corrected by reinstalling and rediscovering the targets by following steps:
1. Make Sure nothing is using the targets on the server
2. Stop iSCSI service.
# service iscsi stop
3. Erase the iscsi initiator packages.
# yum erase iscsi-initiator-utils
4. Make sure /var/lib/iscsi directory is empty, and there are no leftovers
# ls /var/lib/iscsi #
5. Install the iscsi initiator packages again.
# yum install iscsi-initiator-utils
6. Discover targets using the target ip address in the below command.
# iscsiadm -m discovery -t st -p [IP addr]
7. Login to targets.
# iscsiadm -m node --loginall all
8. Make sure you see them all by running the following command
# iscsiadm -m session tcp: [1] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun134-xxx (non-flash) tcp: [10] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun133-xxx (non-flash) tcp: [11] 1x.x.x.x:3260,2460 iqn.2007-11.com.server:lun132-xxx (non-flash) tcp: [12] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun131-xxx (non-flash) tcp: [13] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun001-xxx (non-flash) tcp: [14] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun129-xxx (non-flash) tcp: [15] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun128-xxx (non-flash) tcp: [16] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun127-xxx (non-flash) tcp: [17] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun126-xxx (non-flash) tcp: [18] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun125-xxx (non-flash) tcp: [19] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun124-xxx (non-flash) tcp: [2] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun123-xxx (non-flash) tcp: [20] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun122-xxx c (non-flash) tcp: [21] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun121-xxx (non-flash) tcp: [22] x.x.x.x:3260,2460 iqn.2007-11.com.server:lun130-xxx (non-flash)
9. Reboot the server to make sure the problem is completely resolved and will not reoccur after reboot.
# shutdown -r now
At this point iSCSI should have detected the targets after a reboot.
How to troubleshoot iSCSI issues in CentOS / RHEL 6,7
How to configure iSCSI Initiator (client) in CentOS / RHEL 6