How to Configure an iSCSI Initiator
The Discovery process presents an initiator with a list of available targets. You can configure iSCSI Targets for static, Send Targets, or iSNS dynamic discovery. Dynamic discovery using the Send Targets option is the optimum configuration for an iSCSI initiator that accesses a large number of targets, such over an iSCSI to Fibre Channel bridge. Send Targets dynamic discovery requires the IP address and port combination of the iSCSI target for the iSCSI initiator to be able to perform the device discovery.
| Note The Send Targets dynamic discovery option should only be configured on the initiator in an iSCSI environment. The COMSTAR iSCSI target uses the itadm utility to present both static and Send Targets options to the initiator. |
For more information, see How to Configure an iSCSI Target for Discovery.
How to Configure an iSCSI Initiator
- Log in to the target as superuser.
- For static discovery, obtain the (inet) IP address of the target and the target name (iqn) of the storage target you want to connect to.
For instance, on an OpenSolaris target system:# ifconfig -a ibd0: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 2044 index 3 inet 10.1.190.141 netmask ffffff00 broadcast 10.255.255.255 ipib 0:0:0:46:fe:80:0:0:0:0:0:0:0:2:c9:2:0:27:5b:59 # itadm list-target TARGET NAME STATE SESSIONS iqn.1986-03.com.sun:02:7136fd12-a275-ecf5-9fb7-c3117f1a5f70 online 0On the initiator host, initiate static configuration for the iSCSI target, and then list the results for verification. The string passed to the iscsiadm command consists of the IQN number followed by a comma, the IP address of the target followed by a colon, and the port number. If you do not supply a port number, it defaults to 3260. In this example, the IQN number is iqn.1986-03.com.sun:02:7136fd12-a275-ecf5-9fb7-c3117f1a5f70 and the IP address of the target is 10.1.190.141.
Static Discovery # iscsiadm add static-config iqn.1986-03.com.sun:02:7136fd12-a275-ecf5-9fb7-c3117f1a5f70,10.1.190.141 # iscsiadm list static-config Static Configuration Target: iqn.1986-03.com.sun:02:7136fd12-a275-ecf5-9fb7-c3117f1a5f70,10.1.190.141:3260
- For Send Targets discovery, configure the IP address of the target system.
SendTargets Discovery # iscsiadm add discovery-address 10.1.190.141:3260
- For iSNS discovery using the Internet Standard Name Services (iSNS) method, configure the IP address of the iSNS server.
The example shows that the iSNS server IP address is 10.1.190.142.iSNS Discovery iscsiadm add isns-server 10.1.190.142
The iSCSI connection is not initiated until the discovery method is enabled, as described in the next step.
- Enable discovery.
- For the static discovery method:
# iscsiadm modify discovery --static enable
- For the Send Targets discovery method:
# iscsiadm modify discovery --sendtargets enable
- For the iSNS discovery method:
# iscsiadm modify discovery --iSNS enable
- For the static discovery method:
- Verify that the discovery method is enabled.
The example below shows that you enabled the Send Targets discovery option.# iscsiadm list discovery Discovery: Static: disabled Send Targets: enabled iSNS: disabled
- Confirm that the desired target systems and storage targets are now visible to the initiator iSCSI.
# iscsiadm list target Target: iqn.1986-03.com.sun:02:7136fd12-a275-ecf5-9fb7-c3117f1a5f70 Alias: - TPGT: 1 ISID: 4000002a0000 Connections: 1 - Create the iSCSI device links for the local system.
# devfsadm -i iscsi
- Confirm that the expected target disks are now available to the initiator system. For example, use the format command.
# format < /dev/null
How to Set Tunable Parameters
You can set and change the timeout length for iSCSI connections with the iscsiadm modify -T command. These tunable parameters apply to the active connection, and change the behavior of the iSCSI initiator and the targets that connect to the initiator. The ability to dynamically tune parameters provides flexibility when configuring your iSCSI initiators. For example, if you use an iSCSI quorum device with Sun Cluster software, you could increase the timeout value so that the device does not time out during a reboot.
- View a list of all tunable parameters.
iscsiadm list initiator-node or iscsiadm list target-param [<target-name>]
For example, iscsiadm list initiator-node.
- Set a tunable parameter.
iscsiadm modify target-param -T <tunable-prop>=<value> <target-name>
For example, to set the maximum connection retry time to 90 seconds: iscsiadm modify initiator-node -T conn-login-max=90.
You can set and tune the following parameters.
| Parameter Name | Description | Valid Values (seconds) | Default Value (seconds) |
|---|---|---|---|
| recv-login-rsp-timeout | Session login response time - Specifies how long an iSCSI initiator waits for the response of an iSCSI session login request from the given iSCSI target. | 0 - 3600 | 60 |
| conn-login-max | Maximum connection retry time - Determines the maximum iSCSI initiator connection retry time, after the iSCSI initiator to target IO times out or the connection fails. | 0 - 3600 | 180 |
| polling-login-delay | Login retry time interval - Determines the time interval between each iSCSI session login retry, after the iSCSI initiator to target IO times out or the connection fails. | 0 - 3600 | 60 |

