Internet Small Computer System Interface (iSCSI) is an IP-based standard for connecting storage devices. iSCSI uses IP networks to encapsulate SCSI commands, allowing data to be transferred over long distances. iSCSI provides shared storage among a number of client systems. Storage devices are attached to servers (targets). Client systems (initiators) access the remote storage devices over IP networks. To the client systems, the storage devices appear to be locally attached. iSCSI uses the existing IP infrastructure and does not require any additional cabling, as is the case with Fibre Channel (FC) storage area networks.
To use RHEL/CentOS 7 system as an iSCSI initiator or client, you must have iscsi-initiator-utils package installed. You can verify that this is installed on your system using the rpm command, as shown in the following example:
$ rpm -qa | grep iscsi-initiator-utils
If the package is not installed on your system, install it using yum.
# yum install iscsi-initiator-utils
In Red Hat Enterprise Linux 7, the iSCSI service is lazily started by default. If root is not on an iSCSI device or there are no nodes marked with “node.startup = automatic” then the iSCSI service will not start until an iscsiadm command is run that requires iscsid or the iscsi kernel modules to be started. For example, running the discovery command:
# iscsiadm -m discovery -t st -p ip:port
For Example, Obtain a listing of available targets from a given host (please note that ipaddress listed below must be replaced with the resolvable hostname or ip address of the system providing the port if different than default):
# iscsiadm -m discovery -t st -p [target_ipaddress] xxx.xxx.xxx.xxx:3260,1 iqn.2010-03.com.example:tgtd
iqn.2010-03.com.example:tgtd – is the target iqn name
xxx.xxx.xxx.xxx – is the IP address of the target (mentioning port is optional if it is running on the default port 3260)
The following command will login to the discovered target.
# iscsiadm -m node -T target_iqn_name -p ipaddress -l Logging in to [iface: default, target: iqn.2010-03.com.example:tgtd, portal: xxx.xxx.xxx.xxx,3260] Login to [iface: default, target: iqn.2010-03.com.example:tgtd, portal: xxx.xxx.xxx.xxx,3260]: successful
You can also log into all the LUNs exported on the target by running:
# iscsiadm -m discovery -t st -l
This procedure will enable the target(or targets if you logged into all) to be accessed upon reboot. The information is stored in the node database found in
To disconnect from iSCSI storage
If you want to disable the target, you need log out by:
# iscsiadm -m node -T target_iqn_name -p ipaddress -u
2. Delete the Target
To remove the target from the iscsi database so that the iscsi does not reconnect upon reboot, delete the target after logging out of it:
# iscsiadm -m node -T target_iqn_name -p ip address --op delete
Note, you can log out of all targets by running:
# iscsiadm -m node -U all