|
Now that both the iSCSI target and initiator are in Solaris, let's see how to set one up. On the target machine, we do the following...
First, use 'iscsitadm' to provide a directory where the iSCSI repository and configuration information is stored. This is also the directory where the logical units will be stored if you create luns that are disk emulated files (the default).
hodur# iscsitadm modify admin -d /var/tmp/iscsi
Now actually create the luns. I chose to create pass-through raw devices instead of file based disk emulating luns.
hodur# iscsitadm create target --type raw --backing-store /dev/rdsk/c4t2d0 c4t2d0
hodur# iscsitadm create target --type raw --backing-store /dev/rdsk/c4t4d0 c4t4d0
hodur# iscsitadm create target --type raw --backing-store /dev/rdsk/c4t8d0 c4t8d0
hodur# iscsitadm create target --type raw --backing-store /dev/rdsk/c4t12d0 c4t12d0
Let's get a listing of the targets on this machine:
hodur# iscsitadm list target
Target: c4t2d0
iSCSI Name: iqn.1986-03.com.sun:02:aaf6d680-6681-e36e-8497-855decbf8038.c4t2d0
Connections: 0
Target: c4t4d0
iSCSI Name: iqn.1986-03.com.sun:02:f935aa89-d195-6ed9-9a1a-febe8d0550d2.c4t4d0
Connections: 0
Target: c4t8d0
iSCSI Name: iqn.1986-03.com.sun:02:5af80810-aa7c-c8c2-e566-af70bd579219.c4t8d0
Connections: 0
Target: c4t12d0
iSCSI Name: iqn.1986-03.com.sun:02:b3120e6c-896c-e3e3-c908-8a43789997d9.c4t12d0
Connections: 0
hodur#
Now onto the initiator:
fsh-mullet# iscsiadm add discovery-address
fsh-mullet# iscsiadm modify discovery -t enable
We wait a few seconds, and then verify the status on the target machine (notice the 4 luns are now online instead of offline):
hodur# iscsitadm list target -v
Target: c4t2d0
iSCSI Name: iqn.1986-03.com.sun:02:aaf6d680-6681-e36e-8497-855decbf8038.c4t2d0
Connections: 1
Initiator:
iSCSI Name: iqn.1986-03.com.sun:01:0003ba73b35b.44d23863
Alias: fsh-mullet
ACL list:
TPGT list:
LUN information:
LUN: 0
GUID: 010000e0812a8f5300002a0044d3ef91
VID: SUN
PID: SOLARIS
Type: raw
Size: 34G
Backing store: /dev/rdsk/c4t2d0
Status: online
Target: c4t4d0
iSCSI Name: iqn.1986-03.com.sun:02:f935aa89-d195-6ed9-9a1a-febe8d0550d2.c4t4d0
Connections: 1
Initiator:
iSCSI Name: iqn.1986-03.com.sun:01:0003ba73b35b.44d23863
Alias: fsh-mullet
ACL list:
TPGT list:
LUN information:
LUN: 0
GUID: 010000e0812a8f5300002a0044d3ef8e
VID: SUN
PID: SOLARIS
Type: raw
Size: 34G
Backing store: /dev/rdsk/c4t4d0
Status: online
Target: c4t8d0
iSCSI Name: iqn.1986-03.com.sun:02:5af80810-aa7c-c8c2-e566-af70bd579219.c4t8d0
Connections: 1
Initiator:
iSCSI Name: iqn.1986-03.com.sun:01:0003ba73b35b.44d23863
Alias: fsh-mullet
ACL list:
TPGT list:
LUN information:
LUN: 0
GUID: 010000e0812a8f5300002a0044d3ef8a
VID: SUN
PID: SOLARIS
Type: raw
Size: 34G
Backing store: /dev/rdsk/c4t8d0
Status: online
Target: c4t12d0
iSCSI Name: iqn.1986-03.com.sun:02:b3120e6c-896c-e3e3-c908-8a43789997d9.c4t12d0
Connections: 1
Initiator:
iSCSI Name: iqn.1986-03.com.sun:01:0003ba73b35b.44d23863
Alias: fsh-mullet
ACL list:
TPGT list:
LUN information:
LUN: 0
GUID: 010000e0812a8f5300002a0044d3ef87
VID: SUN
PID: SOLARIS
Type: raw
Size: 34G
Backing store: /dev/rdsk/c4t12d0
Status: online
hodur#
Now back on the initiator, we check to see if we can see those devices:
fsh-mullet# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@1c,600000/scsi@2/sd@0,0
1. c0t1d0
/pci@1c,600000/scsi@2/sd@1,0
2. c2t1d0
/iscsi/disk@0000iqn.1986-03.com.sun%3A02%3Ab3120e6c-896c-e3e3-c908-8a43789997d9.c4t12d00001,0
3. c2t2d0
/iscsi/disk@0000iqn.1986-03.com.sun%3A02%3A5af80810-aa7c-c8c2-e566-af70bd579219.c4t8d00001,0
4. c2t4d0
/iscsi/disk@0000iqn.1986-03.com.sun%3A02%3Af935aa89-d195-6ed9-9a1a-febe8d0550d2.c4t4d00001,0
5. c2t5d0
/iscsi/disk@0000iqn.1986-03.com.sun%3A02%3Aaaf6d680-6681-e36e-8497-855decbf8038.c4t2d00001,0
Specify disk (enter its number): ^C
fsh-mullet#
Hmm, perhaps i could even create a RAID-Z out of those luns...
fsh-mullet# zpool create -f iscs-me raidz c2t1d0 c2t2d0 c2t4d0 c2t5d0
fsh-mullet# zpool status
pool: iscs-me
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
iscs-me ONLINE 0 0 0
raidz1 ONLINE 0 0 0
c2t1d0 ONLINE 0 0 0
c2t2d0 ONLINE 0 0 0
c2t4d0 ONLINE 0 0 0
c2t5d0 ONLINE 0 0 0
errors: No known data errors
fsh-mullet#
Do i hear Mr. Koolaid? ... "OH YEAH!"
(2006-08-04 18:08:29.0/2006-08-04 18:08:29.0)
Permalink
Trackback: http://blogs.sun.com/erickustarz/en_US/entry/iscsi_setup
|
Posted by c0t0d0s0.org on August 05, 2006 at 12:00 AM PDT #
Posted by David Smith on October 19, 2006 at 07:21 AM PDT #