View Source

h2. 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.

{info:title=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.{info}
For more information, see [How to Configure an iSCSI Target for Discovery].

h3. 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:
{code:none}
# 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 0
{code}
On 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.
{code:none}
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
{code}
# For Send Targets discovery, configure the IP address of the target system.
{code:none}
SendTargets Discovery
# iscsiadm add discovery-address 10.1.190.141:3260
{code}
# 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.
{code:none}
iSNS Discovery
iscsiadm add isns-server 10.1.190.142
{code}
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:
{code:none}
# iscsiadm modify discovery --static enable
{code}
#* For the Send Targets discovery method:
{code:none}
# iscsiadm modify discovery --sendtargets enable
{code}
#* For the iSNS discovery method:
{code:none}
# iscsiadm modify discovery --iSNS enable
{code}
# Verify that the discovery method is enabled.
The example below shows that you enabled the Send Targets discovery option.
{code:none}
# iscsiadm list discovery
Discovery:
Static: disabled
Send Targets: enabled
iSNS: disabled
{code}
# Confirm that the desired target systems and storage targets are now visible to the initiator iSCSI.
{code:none}
# iscsiadm list target
Target: iqn.1986-03.com.sun:02:7136fd12-a275-ecf5-9fb7-c3117f1a5f70
Alias: -
TPGT: 1
ISID: 4000002a0000
Connections: 1
{code}
# Create the iSCSI device links for the local system.
{code:none}
# devfsadm -i iscsi
{code}
# Confirm that the expected target disks are now available to the initiator system. For example, use the {{format}} command.
{code:none}
# format < /dev/null
{code}

h3. 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.
{code}iscsiadm list initiator-node or iscsiadm list target-param [<target-name>]{code}
For example, {{iscsiadm list initiator-node}}.
# Set a tunable parameter.
{code}iscsiadm modify target-param -T <tunable-prop>=<value> <target-name>{code}
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 |

h5. Where to Go Next

* [How to Make Logical Units Available for iSCSI and iSER]

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact