iSCSI Connection

Changing the iSCSI-Initiator Name on each PVE

The Initiator Name must be unique for each iSCSI initiator. Do NOT duplicate the iSCSI-Initiator Names.

  1. Edit the iSCSI initiator name in the /etc/iscsi/initiatorname.iscsi file to assign a unique name in a way that the IQN refers to the server and the function. This change makes administration and troubleshooting easier.
  2. Original: InitiatorName=iqn.1993-08.org.debian:01:bb88f6a25285

    Modified: InitiatorName=iqn.1993-08.org.debian:01:<Servername + No.>

  3. Restart iSCSI to take effect using the following command:
systemctl restart iscsid

Discovering the iSCSI Target to PVE

  1. Before attaching the SANsymphony iSCSI target, discover all the iqn-portname using the following command:
  2. iscsiadm -m discovery -t sendtargets -p <IP-address>:3260

    For Example: # iscsiadm -m discovery -t sendtargets -p 172.16.41.21:3260

  3. Attach all the SANsymphony iSCSI targets on each PVE using the following command:
  4. iscsiadm --mode node --targetname <IQN> -p <IP-address> --login

    For more information, see the Wiki iSCSI Multipath.

    For Example:

    1. iscsiadm --mode node --targetname iqn.2000-08.com.datacore:pve-sds11-fe1 -p: 172.16.41.21 --login
    2. iscsiadm --mode node --targetname iqn.2000-08.com.datacore:pve-sds11-fe2 -p 172.16.42.21 --login
    3. iscsiadm --mode node --targetname iqn.2000-08.com.datacore:pve-sds10-fe1 -p 172.16.41.20 --login
    4. iscsiadm --mode node --targetname iqn.2000-08.com.datacore:pve-sds10-fe2 -p 172.16.42.20 --login
  1. Restart the iSCSI session using the following command:
  2. iscsiadm -m session –rescan

    For Example:

    1. Rescanning session [sid: 1, target: iqn.2000-08.com.datacore:pve-sds11-fe1, portal: 172.16.41.21,3260]
    2. Rescanning session [sid: 4, target: iqn.2000-08.com.datacore:pve-sds11-fe2, portal: 172.16.42.21,3260]
    3. Rescanning session [sid: 2, target: iqn.2000-08.com.datacore:pve-sds10-fe1, portal: 172.16.41.20,3260]
    4. Rescanning session [sid: 3, target: iqn.2000-08.com.datacore:pve-sds10-fe2, portal: 172.16.42.20,3260]

Displaying the Active Session

Use the following command to display the active session:

iscsiadm --mode session --print=1