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.
- 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.
- Restart iSCSI to take effect using the following command:
Original: InitiatorName=iqn.1993-08.org.debian:01:bb88f6a25285
Modified: InitiatorName=iqn.1993-08.org.debian:01:<Servername + No.>
systemctl restart iscsid
Discovering the iSCSI Target to PVE
- Before attaching the SANsymphony iSCSI target, discover all the iqn-portname using the following command:
- Attach all the SANsymphony iSCSI targets on each PVE using the following command:
iscsiadm -m discovery -t sendtargets -p <IP-address>:3260
For Example: # iscsiadm -m discovery -t sendtargets -p 172.16.41.21:3260
iscsiadm --mode node --targetname <IQN> -p <IP-address> --login
For more information, see the Wiki iSCSI Multipath.
- iscsiadm --mode node --targetname iqn.2000-08.com.datacore:pve-sds11-fe1 -p: 172.16.41.21 --login
- iscsiadm --mode node --targetname iqn.2000-08.com.datacore:pve-sds11-fe2 -p 172.16.42.21 --login
- iscsiadm --mode node --targetname iqn.2000-08.com.datacore:pve-sds10-fe1 -p 172.16.41.20 --login
- iscsiadm --mode node --targetname iqn.2000-08.com.datacore:pve-sds10-fe2 -p 172.16.42.20 --login
- Restart the iSCSI session using the following command:
For Example:
iscsiadm -m session –rescan
- Rescanning session [sid: 1, target: iqn.2000-08.com.datacore:pve-sds11-fe1, portal: 172.16.41.21,3260]
- Rescanning session [sid: 4, target: iqn.2000-08.com.datacore:pve-sds11-fe2, portal: 172.16.42.21,3260]
- Rescanning session [sid: 2, target: iqn.2000-08.com.datacore:pve-sds10-fe1, portal: 172.16.41.20,3260]
- Rescanning session [sid: 3, target: iqn.2000-08.com.datacore:pve-sds10-fe2, portal: 172.16.42.20,3260]
For Example:
Displaying the Active Session
Use the following command to display the active session:
iscsiadm --mode session --print=1