Before we define iSCSI,we must know what is SCSI itself.
SCSI: Small Computer Systems Interface, is a family of protocols for communicating with I/O devices( especially storage).
SCSI protocol is being used by servers to communicate with storages over various types of transports like SAS , SAS2 ,SATA, Parallel SSCSI , FC…etc.
for SAS or SATA we have the limitation in the distance that these cables support,while in Fibre Channel (FC) it can go for long distances ,but it is very costly.
Hint:
1- SCSI is a client-server architecture, client is “initiator” while storage is “target”
2- initiator mostly is OS ( Windows, Linux, Unix) . Target mostly is storage like (NetApp,EMC,ZFS..etc ).
So, SCSI packets is being transported mostly by SAS ,SATA,and FC cables.
iSCSI : is transporting SCSI packets over TCP/IP, providing block-level access to storage devices over TCP/IP network.
So, initiators will have its own IP and targets as well ,all packets are being transported over normal IP networks
Initiators issue SCSI “commands” to request services from targets.
But how initiator(operating system ) can discover targets (storag)?
iSCSI discovery mechanism:
1- Send Targets : the target IP and Port is known to the initiator, a discovery session is established , then initiator sends SendTargets commands to get available iscsi targets from storage.
2- Static Configuration: the IP,Port and IQN of target are available for the initiator.
3- Zero-Configuration : the initiator doesn’t have any information about targets, a discovery messages are sent to Storage Name Server ( iSNS , SLP…etc), where all information regarding initiators and targets and access list.
iSNS: Internet Storage Name Server , is centeralized server that has iSCSI configurations of initiators and targets.
SLP : Service Location Protocol, is not widely implemented, but anyway it helps computers to find iSCSI services across network.
in iSCSI network, each component (initiator or target ) has its unique name,Lets have a look at naming types
iSCSI Naming: Three naming are supported by iSCSI
1- iqn ( iSCSI Qualified Name )format : iqn.yyyy-mm.ReversedDomain:String
iqn.2001.04.com.example:storage:diskarrays-sn-a8675309
2- eui :eui.{EUI-64 bit address} (e.g. eui.02004567A425678D)
3- NAA Network Address Authority: naa.{NAA 64 or 128 bit identifier} (e.g. naa.52004567BA64678D)
| SCSI Transport Protocol |
EUI-64 |
NAA |
IQN |
| iSCSI |
X |
X |
X |
| FCP ( Fibre Channel) |
|
X |
|
| SAS |
|
X |
|
iSCSI Session Types:
the initiator and target, both creates a session for communication as following
1- Discovery Session: opened to discover target only
2- Normal Operation Session: unrestricted session for I/O operations
iSCSI Security:
iSCSI supports two separate security mechanisms:
1-in-band authentication between initiator and target at the iSCSI connection level.(like CHAP authentication), occurs during login into storage
2- packet protection by IPsec at the IP level.( all packets are secured )
iSCSI will do a login to storgae first(here we implement in-band authentication if needed ),after successfull login it will start exchanging packets ( here we can implement IPSec if needed)
Lets see how to configure Solaris and Linux as a client fro storages :
1- Solaris Configuration as a client to connect to iSCSI storage:
Assuming Storage IP is 10.10.10.151
Here is the sequence of commands to use:
# svcadm enable network/iscsi/initiator
# iscsiadm modify discovery –static enable
# iscsiadm modify discovery –sendtargets enable
# iscsiadm add discovery-address 10.10.10.151
# iscsiadm list discovery-address -v 10.10.10.151 (get iqn of target and use in next command)
# iscsiadm add static-config iqn.1986-03.com.sun:02:1859adc5-0f56-c7a4-a08a-dfad6332b09a,10.10.10.151
#devfsadm -i iscsi
#iscsiadm list target -vS ( list iscsi devices and OS disk path)
2- Linux 7 Configuration as a client to connect to iSCSI storage:
# systemctl start iscsi iscsid ( enable iscsi daemon )
# cat /etc/iscsi/initiatorname.iscsi ( get you host iqn ,share it with storage admin)
# iscsiadm -m discovery -t sendtargets -p 10.10.10.151 ( query iqn of target ,it will be used in next command )
# iscsiadm -m node -T iqn.1986-03.com.sun:02:1859adc5-0f56-c7a4-a08a-dfad6332b09a -p 10.10.10.151 –login
# iscsiadm -m node -o update -n node.startup -v automatic ( enable auto startup )
# iscsiadm -m node -o update -n node.conn[0].startup -v automatic ( enable auto connection startup )
# iscsiadm –mode node -l all ( create all needed devices )
# iscsiadm -m session -P 2
# fdisk /dev/sdX
# add line in /etc/fstab ,like: ( be sure you add _netdev ,it tells kernel the device is network device ,otherwise linux wll run into single user-mode if you reboot the machine )
/dev/sdb1 /ahmed xfs defaults,_netdev 0 0
References :
1- RFC 3721,7143 (IETF Internet Engineering Task Force)
2- NetApp Guide.
3- Tecmint.
4- Redhat Documentation
5- Oracle Documentations