Automatic iSCSI target discovery and login (persistent across subsequent reboots)

You can configure iscsid to discover the iSCSI target and to log in to the iSCSI target automatically.

About this task

When iscsid starts, it checks the SendTarget discovery records. The steps are as follows:

Procedure

  1. For the iSCSI initd script startup, set a session to "automatic" in /etc/iscsi/iscsid.conf:
    node.startup = automatic
    By default node.startup is set to:
    • automatic in Red Hat Enterprise Linux
    • manual in SUSE Linux Enterprise Server
  2. Create the SendTargets record:
    # iscsiadm --mode node --target <IQN> --portal 192.0.2.*:3260 -o new
  3. Set the use_discoveryd setting for SendTargets record:
    #iscsiadm --mode node --target <IQN> --portal 192.0.2.*:3260 
    -n discovery.sendtargets.use_discoveryd -v Yes
  4. Set the polling interval:
    #iscsiadm --mode node --target IQN --portal 192.0.2.*:3260  
    -n discovery.sendtargets.discoveryd_poll_inval -v 30  
  5. To make the new settings take effect, restart the iscsi service.
    • In Red Hat Enterprise Linux:
      # /etc/init.d/iscsi restart 
    • In SUSE Linux Enterprise Server:
      # rcopen-iscsi restart
    Now SCSI devices appear automatically after subsequent reboots.