As part of my testing phase during the custom SAN project, I was running into performance issues with the Microsoft iSCSI Software Initiator and the OpenSolaris COMSTAR iSCSI target. Although some individuals were running into significant performance issues, such as 600KB/sec writes, my problem was 30MB/sec writes with 90MB/sec reads. Regardless, that is not the point of this post – instead I am posting the commands I used for employing SUN’s iSCSI Initiator during testing between SUN’s iSCSI target and SUN’s iSCSI initiator.
SUN iSCSI Initiator
Obviously you need to have your network configured properly prior to working with the iSCSI initiator or targets. In this example, I was working with the iSCSI initiator and target in a lab environment, with the host (target) being 192.168.0.18 and the client (initiator) being 192.168.0.19. Secondly, you will need the iSCSI initiator software to be installed from Package Manager – easiest way is to search for iscsi and ensure all four of those packages are installed.
For this example we will use Send Targets for discovering iSCSI targets/paths:
iscsiadm add discovery-address 192.168.0.18:3260 iscsiadm modify discovery --sendtargets enable
Now that you have added the discovery address of the iSCSI target and enabled the discovery “Send Targets”, check to see if your target was discovered:
iscsiadm list target
If you saw the targets you were expecting, the next step is to create the device links between iSCSI and your system – so you can see the iSCSI LUN as a disk on your system.
devfsadm -i iscsi
Check the available disks on your system using the format command. After running the format command, hit CTRL-C to bounce back to the terminal prompt.
Using / Mounting the iSCSI LUN
Now that you have the iSCSI initiator working properly and the iSCSI targets discovered, lets actually use the new iSCSI disk with ZFS.
First we need to create the ZFS pool using the new disk. If you forgot the name of the new disk, you can learn it using the format command. If it is anything like the one on my OpenSolaris box, the name is rather large, (c0t600144F0F9A00C0000004AA9510A0001d0):
zpool create diskpool c0t600144F0F9A00C0000004AA9510A0001d0
To verify the pool was created, use:
Now we can create a ZFS file system on top of that pool:
zfs create diskpool/test
Check your new ZFS filesystem was created:
And now you can create files within the mount point:
Everything you write to that mount point will be written to the iSCSI target, as one would hope.
Good luck with your performance!