Accessing iSCSI Targets from non-Linux Hosts

You can obtain obtain iSCSI software initiators for a variety of different operating systems. You can get the a Windows initiator from Microsoft and other initiators (HP-UX, Solaris, etc) from Cisco. The Cisco initiator uses the exact same syntax as the Linux client. For Windows clients just have the client software try to auto-discover your system hosting the targets and go from there.

If you do plan to use targets on Solaris initiators, take note of disk settings (heads, disks, cylinders) on the Linux host before you setup the Solaris system. On Solaris you'll need to install the Cisco package, edit your /etc/iscsi.conf just like you did on your Linux initiator (the syntax is identical) and then start the initiator (/etc/init.d/iscsi start). Once the targets are avalible to your Solaris system you'll need to create the device paths (devfsadm) and then repartition and label the device (the format command). When you select the iSCSI target in the format tool you'll be told that it can't be recognized as a Solaris disk and will want you to configure it, and auto-layout won't work. You'll need to take the values that your linux system saw and use those. Most of the values can be defaulted. You can find the values you need in the /proc filesystem on your linux initiator, but it's probly easier to just look at the partition map on the device using fdisk and then use those values. At that point you can actually partition slices on the disk and label it for use.

Here is a quick look at adding an initiator on Solaris:

Procedure 3. Setting up a Solaris Initiator

  1. Start by installing the Cisco iSCSI package for Solaris

    # gzcat solaris-iscsi-3.3.5.tar.Z | tar xfv -
    	(Lines removed)
    # pkgadd -d .
    
    The following packages are available:
      1  CSCOiscsi     Cisco iSCSI device driver
                       (sparc) 3.3.5
    
    Select package(s) you wish to process (or 'all' to process
    all packages). (default: all) [?,??,q]: 1
    	(Lines removed)
    	
  2. Now check the initiator name so that you can configure your targets as needed.

    # cat /etc/initiatorname.iscsi 
    InitiatorName=iqn.1987-05.com.cisco:01.7fcfb3a9ad78
    	
  3. After setting up your targets, start up the iSCSI initiator and see whats avalible.

    # cat /etc/initiatorname.iscsi 
    InitiatorName=iqn.1987-05.com.cisco:01.7fcfb3a9ad78
    # /etc/init.d/iscsi start
    iSCSI is starting.
    #
    # iscsi-ls 
    ********************************************************************************
    TARGET NAME iqn.1992-08.com.netapp:sn.33582139
    TARGET ID 0:
      ADDRESS = 10.10.2.240:3260, 1
      STATUS  = Connected 10.10.2.244:38784<->10.10.2.240:3260  6/6/2004 22:19:50
      SESSION = ISID 00023d000001  TSID 351  PID 6440
    ********************************************************************************
    	
  4. If you take a look at format you won't see our iSCSI block device because it hasn't been added to the devfs yet. Use devfsadm to create the devices. Note: I use the -vC options to devfsadm to show me what it does (-v: verbose) and to clean any old or unneeded entries from the tree (-C: Cleanup).

    # format
    Searching for disks...done
    
    
    AVAILABLE DISK SELECTIONS:
           0. c0t0d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
              /sbus@1f,0/SUNW,fas@e,8800000/sd@0,0
    Specify disk (enter its number): ^D
    # devfsadm -vC
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:a 0l/3l/60640
    devfsadm[6456]: verbose: symlink /dev/dsk/c1t0d0s0 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:a
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:b 0l/3l/60640
    devfsadm[6456]: verbose: symlink /dev/dsk/c1t0d0s1 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:b
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:c 0l/3l/60640
    devfsadm[6456]: verbose: symlink /dev/dsk/c1t0d0s2 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:c
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:d 0l/3l/60640
    devfsadm[6456]: verbose: symlink /dev/dsk/c1t0d0s3 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:d
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:e 0l/3l/60640
    devfsadm[6456]: verbose: symlink /dev/dsk/c1t0d0s4 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:e
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:f 0l/3l/60640
    devfsadm[6456]: verbose: symlink /dev/dsk/c1t0d0s5 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:f
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:g 0l/3l/60640
    devfsadm[6456]: verbose: symlink /dev/dsk/c1t0d0s6 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:g
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:h 0l/3l/60640
    devfsadm[6456]: verbose: symlink /dev/dsk/c1t0d0s7 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:h
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:a,raw 0l/3l/20640
    devfsadm[6456]: verbose: symlink /dev/rdsk/c1t0d0s0 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:a,raw
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:b,raw 0l/3l/20640
    devfsadm[6456]: verbose: symlink /dev/rdsk/c1t0d0s1 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:b,raw
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:c,raw 0l/3l/20640
    devfsadm[6456]: verbose: symlink /dev/rdsk/c1t0d0s2 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:c,raw
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:d,raw 0l/3l/20640
    devfsadm[6456]: verbose: symlink /dev/rdsk/c1t0d0s3 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:d,raw
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:e,raw 0l/3l/20640
    devfsadm[6456]: verbose: symlink /dev/rdsk/c1t0d0s4 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:e,raw
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:f,raw 0l/3l/20640
    devfsadm[6456]: verbose: symlink /dev/rdsk/c1t0d0s5 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:f,raw
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:g,raw 0l/3l/20640
    devfsadm[6456]: verbose: symlink /dev/rdsk/c1t0d0s6 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:g,raw
    devfsadm[6456]: verbose: mknod /devices/iscsipseudo/iscsi@0/sd@0,0:h,raw 0l/3l/20640
    devfsadm[6456]: verbose: symlink /dev/rdsk/c1t0d0s7 -> ../../devices/iscsipseudo/iscsi@0/sd@0,0:h,raw
    	
  5. Now the device exists. Use format to label and if needbe partition the device.

    # format
    Searching for disks...done
    
    c1t0d0: configured with capacity of 19.99GB
    
    
    AVAILABLE DISK SELECTIONS:
           0. c0t0d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
              /sbus@1f,0/SUNW,fas@e,8800000/sd@0,0
           1. c1t0d0 <NETAPP-LUN-0.2 cyl 5118 alt 2 hd 16 sec 512>
              /iscsipseudo/iscsi@0/sd@0,0
    Specify disk (enter its number): 1
    selecting c1t0d0
    [disk formatted]
    Disk not labeled.  Label it now? y
    	(blah blah blah)
    format> quit
    	
  6. If everything looks good so far, create your filesystem(s) and mount it.

    # newfs /dev/rdsk/c1t0d0s2 
    newfs: construct a new file system /dev/rdsk/c1t0d0s2: (y/n)? y
    /dev/rdsk/c1t0d0s2:     41926656 sectors in 5118 cylinders of 16 tracks, 512 sectors
            20472.0MB in 394 cyl groups (13 c/g, 52.00MB/g, 6336 i/g)
    super-block backups (for fsck -F ufs -o b=#) at:
     32, 107040, 214048, 321056, 428064, 535072, 642080, 749088, 856096, 963104,
    Initializing cylinder groups:
    .......
    super-block backups for last 10 cylinder groups at:
     40894496, 41001504, 41108512, 41215520, 41322528, 41429536, 41536544,
     41643552, 41750560, 41857568,
    # mount /dev/dsk/c1t0d0s2 /iscsi/
    # df -h
    Filesystem             size   used  avail capacity  Mounted on
    /dev/dsk/c0t0d0s0       16G   2.4G    13G    16%    /
    /proc                    0K     0K     0K     0%    /proc
    mnttab                   0K     0K     0K     0%    /etc/mnttab
    fd                       0K     0K     0K     0%    /dev/fd
    swap                   487M    40K   487M     1%    /var/run
    swap                   487M    40K   487M     1%    /tmp
    /dev/dsk/c1t0d0s2       20G     9K    19G     1%    /iscsi
    # 
    	
  7. Lastly, if you want the iSCSI share automatically mounted at boot when the iscsi init script runs, update your /etc/vfstab like you usually would, but in the "Mount at Boot" column instead of "yes" or "no", place the identifier "iscsi" to note that it's an iSCSI share. My line looks like this:

    /dev/dsk/c1t0d0s2 /dev/rdsk/c1t0d0s2 /iscsi     ufs     1       iscsi   -
    	
  8. Your done! Read and write stuff to the share to make sure everything is working properly and possibly even pull out a benchmark to see what thruput your getting. I personally recommend IOzone.