Este contenido no está disponible en el idioma seleccionado.
Chapter 27. Set up an iSCSI Target and Initiator
Note
When using the hal daemon with a large number of iSCSI LUNs, over several thousand, the
--child-timeout
option should be used in order to avoid boot failures. The --child-timeout
option sets the number of seconds to wait for all disk probes to run. For example, to force the hal daemon to wait 10 minutes and 30 seconds, the option would read --child-timeout=630
. The default time is 250 seconds. While this means the hal daemon will take longer to start, it will give enough time for all disk devices to be recognized and avoid boot failures.
The reason for this work around is because in 2003 when the hal daemon was created, it was unusual to have more than a dozen iSCSI disks. It is for this reason, the hal daemon has been removed in Red Hat Enterprise Linux 7 and replaced with udisks.
For more information, see the following Red Hat Knowledgebase solution: haldaemon fails to start on system with a large number of disks in RHEL 5 and RHEL 6
27.1. iSCSI Target Creation Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
An iSCSI target can be a dedicated physical device in a network, or it can be an iSCSI software-configured logical device on a networked storage server. The target is the end point in SCSI bus communication. Storage on the target, accessed by an initiator, is defined by LUNs.
Procedure 27.1. Create an iSCSI Target
- Install
scsi-target-utils
.yum install scsi-target-utils
~]# yum install scsi-target-utils
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Open port 3260 in the firewall.
iptables -I INPUT -p tcp -m tcp --dport 3260 -j ACCEPT service iptables save
~]# iptables -I INPUT -p tcp -m tcp --dport 3260 -j ACCEPT ~]# service iptables save
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start and enable the target service.
service tgtd start chkconfig tgtd on
~]# service tgtd start ~]# chkconfig tgtd on
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Allocate storage for the LUNs. In this example a new partition is being created for block storage.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the
/etc/tgt/targets.conf
file to create the target.Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the above example a simple target containing one backing store and one allowed initiator has been created. It must be named with an iqn name in the format ofiqn.YYYY-MM.reverse.domain.name:OptionalIdentifier
. The backing store is the device the storage is located on. The initiator-address is the IP address of the initiator to access the storage. - Restart the target service.
service tgtd restart
~]# service tgtd restart Stopping SCSI target daemon: [ OK ] Starting SCSI target daemon: [ OK ]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Check the configuration.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow