Alot of my time is spent handling storage from the array side, however recently I had the need to test both sides of the process in order to perform some exclusionary tests against a fully adaptable environment, without impacting our production environments, so I ended up using OpenIndiana 151a on both the target and initator side of the connection. This is how you handle the initiator side of the connection.
Identify the Initiator IQN
First we need to identify the IQN of the iSCSI initiator, this is necessary to configure the security on the iSCSI target.
# iscsiadm list initiator-node Initiator node name: iqn.1986-03.com.sun:01:c0ca4ce904ff.4f45b957 Initiator node alias: openindiana Login Parameters (Default/Configured): Header Digest: NONE/- Data Digest: NONE/- Authentication Type: NONE RADIUS Server: NONE RADIUS Access: disabled Tunable Parameters (Default/Configured): Session Login Response Time: 60/- Maximum Connection Retry Time: 180/- Login Retry Time Interval: 60/- Configured Sessions: 1
Configure iSCSI Static Discovery
Here we configure the type of discovery that we want to use, in our case we are using static discovery.
# iscsiadm modify discovery --static enable
Here we add the actual discovery parameters, the IQN of the target, as well as the IP which we will connect to to create the connection.
# iscsiadm add static-config iqn.2010-09.org.openindiana:02:1a7a530f-8508-4736-f269-d6363a8cb5e6,10.0.0.21:3260
View Available LUNs
Now with everything working on both sides of the connection we will end up seeing specifics about our connection, and our available LUNs
# iscsiadm list target -vS Target: iqn.2010-09.org.openindiana:02:1a7a530f-8508-4736-f269-d6363a8cb5e6 Alias: - TPGT: 1 ISID: 4000002a0000 Connections: 1 CID: 0 IP address (Local): 10.0.0.22:59749 IP address (Peer): 10.0.0.21:3260 Discovery Method: Static Login Parameters (Negotiated): Data Sequence In Order: yes Data PDU In Order: yes Default Time To Retain: 20 Default Time To Wait: 2 Error Recovery Level: 0 First Burst Length: 65536 Immediate Data: yes Initial Ready To Transfer (R2T): yes Max Burst Length: 262144 Max Outstanding R2T: 1 Max Receive Data Segment Length: 32768 Max Connections: 1 Header Digest: NONE Data Digest: NONE LUN: 0 Vendor: OI Product: COMSTAR OS Device Name: /dev/rdsk/c4t600144F0B7EA490000004F471B750001d0s2
Notice LUN 0 in the above output. This is our LUN, remember if you expose multiple LUNs then you will see multiple LUNs here, this is not yet a usable disk for that we will need to use the format utility to identify the disk name.
# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c3t0d0 <ATA-WDCWD5003ABYX-1-1S02 cyl 60798 alt 2 hd 255 sec 63> /pci@0,0/pci1028,4dd@1f,2/disk@0,0 1. c4t600144F0B7EA490000004F471B750001d0 <OI-COMSTAR-1.0 cyl 1303 alt 2 hd 255 sec 63> /scsi_vhci/disk@g600144f0b7ea490000004f471b750001
We now have a completed iSCSI session, and we have a usable volume on our client side.