25.2. Creating an iSCSI Initiator

After creating a target with targetcli as in Section 25.1, “Target Setup”, use the iscsiadm utility to set up an initiator.
In Red Hat Enterprise Linux 7, the iSCSI service is lazily started by default: the service starts after running the iscsiadm command.

Procedure 25.7. Creating an iSCSI Initiator

  1. Install iscsi-initiator-utils:
    # yum install iscsi-initiator-utils
  2. If the ACL was given a custom name in Section 25.1.6, “Configuring ACLs”, modify the /etc/iscsi/initiatorname.iscsi file accordingly. For example:
    # cat /etc/iscsi/initiatorname.iscsi
  3. Discover the target:
    # iscsiadm -m discovery -t st -p target-ip-address,1 iqn.2006-04.com.example:3260
  4. Set user-created ACLs within the TPG node on the target server:
    /iscsi/iqn.20...scsi:444/tpg1> set attribute generate_node_acls=1
    Then, use the exit command.
  5. Log in to the target with the target IQN you discovered in step 3:
    # iscsiadm -m node -T iqn.2006-04.com.example:3260 -l 
    Logging in to [iface: default, target: iqn.2006-04.com.example:3260, portal:,3260] (multiple)
    Login to [iface: default, target: iqn.2006-04.com.example:3260, portal:,3260] successful.
This procedure can be followed for any number of initators connected to the same LUN so long as their specific initiator names are added to the ACL as described in Section 25.1.6, “Configuring ACLs”.