Internet Small Computer System Interface (iSCSI) is a protocol that allows computers to communicate with storage devices by SCSI requests and responses carried over TCP/IP. Because iSCSI is based on the standard SCSI protocols, it uses some terminology from SCSI. The device on the SCSI bus to which requests get sent, and which answers these requests, is known as the target and the device issuing requests is known as the initiator. In other words, an iSCSI disk is a target and the iSCSI software equivalent of a SCSI controller or SCSI Host Bus Adapter (HBA) is called an initiator. This appendix only covers Linux as an iSCSI initiator; how Linux uses iSCSI disks, but not how Linux hosts iSCSI disks.
Linux has a software iSCSI initiator in the kernel that takes the place and form of a SCSI HBA driver and therefore allows Linux to use iSCSI disks. However, as iSCSI is a fully network-based protocol, iSCSI initiator support requires more than just the ability to send SCSI packets over the network. Before Linux can use an iSCSI target, Linux must find the target on the network and make a connection to it. In some cases, Linux must send authentication information to gain access to the target. Linux must also detect any failure of the network connection and must establish a new connection, including logging in again if necessary.
The discovery, connection, and logging in is handled in user space by the iscsiadm utility, while errors are handled, also in user space, by the iscsid utility.
Both iscsiadm and iscsid are part of the iscsi-initiator-utils package under CentOS.
The Anaconda installation program can discover and log in to iSCSI disks in two ways:
When Anaconda starts, it checks if the BIOS or add-on boot ROMs of the system support iSCSI Boot Firmware Table (iBFT), a BIOS extension for systems which can boot from iSCSI. If the BIOS supports iBFT, Anaconda will read the iSCSI target information for the configured boot disk from the BIOS and log in to this target, making it available as an installation target.
To connect automatically to an iSCSI target, a network device for accessing the target needs to be activated. The recommended way to do so is to use
You can discover and add iSCSI targets manually in the graphical user interface in anaconda. From the main menu, the Installation Summary screen, click the Installation Destination option. Then click the Add a disk in the
Specialized & Network Diskssection of the screen. A tabbed list of available storage devices appears. In the lower right corner, click the Add iSCSI Target button and proceed with the discovery process. See The Storage Devices Selection Screen (x86) for more information.
/bootpartition cannot be placed on iSCSI targets which have been added manually using this method - an iSCSI target containing a
/bootpartition must be configured for use with iBFT.
While Anaconda uses iscsiadm to find and log into iSCSI targets, iscsiadm automatically stores any information about these targets in the iscsiadm iSCSI database. Anaconda then copies this database to the installed system and marks any iSCSI targets not used for
/ so that the system will automatically log in to them when it starts. If
/ is placed on an iSCSI target, initrd will log into this target and Anaconda does not include this target in start up scripts to avoid multiple attempts to log into the same target.
Events related to iSCSI might occur at a number of points while the system is starting:
The init script in the initrd will log into iSCSI targets used for
/, if any. This is done using the iscsistart utility, without requiring iscsid to run.
If the root file system is on an iSCSI disk connected using IPv6, ensure that the installed system is using the correct
ip=boot option, for example
ip=eth0:auto6. If this option is not set, the installed system can spend up to 20 minutes at boot time attempting to establish a connection, before eventually succeeding. Using the correct
ip=option eliminates this delay.
When the root file system has been mounted and the various service init scripts are running, the iscsi init script will get called. This script then starts the iscsid daemon if any iSCSI targets are used for
/, or if any targets in the iSCSI database are marked to be logged into automatically.
After the classic network service script has been run, the iscsi init script will run. If the network is accessible, this will log into any targets in the iSCSI database that are marked to be logged into automatically. If the network is not accessible, this script will exit quietly.
When using NetworkManager to access the network, instead of the classic network service script, NetworkManager will call the iscsi init script. Also see the
/etc/NetworkManager/dispatcher.d/04-iscsifile for further reference.
Because NetworkManager is installed in the
/usrdirectory, you cannot use it to configure network access if
/usris on network-attached storage such as an iSCSI target.
If iscsid is not needed as the system starts, it will not start automatically. If you start iscsiadm, iscsiadm will start iscsid in turn.