I'm trying to present a ZFS file system as an iSCSI target. This is ultimately for using it with OS X Time Machine, but that should be irrelevant in this question.
# zfs get all | grep scsi
From several blog posts, it appears it should have a "shareiscsi" property. But just to be thorough, I installed the iscsi target package, hoping it would show up:
# pkg install pkg:/network/iscsi/target
# svcadm enable -rs network/iscsi/target
# svcs | grep scsi
online Mar_30 svc:/network/iscsi/initiator:default
online 6:02:56 svc:/network/iscsi/target:default
Still no shareiscsi in the properties. I did see a blog post about having to install "SUNWiscsitgt" but according to pkg, it is obsolete:
# pkg info -r SUNWiscsitgt
Name: SUNWiscsitgt
State: Not installed (Obsolete)
What am I missing?
Best Answer
It appears OpenIndiana does not use the shareiscsi property. Also (perhaps relatedly) COMSTAR is not included as part of the base installation. So I fired up a fresh OpenIndiana VM and ran the following commands and was able to create, share and mount a sparse LUN without any drama:
Use that GUID from the sbdadm output (my GUID below):
Take your target name (example: iqn.1986-03.com.sun:02:9f57392e-9859-61fe-ec5c-da681f9214dd) and put it in to your iSCSI initiator (I use the free globalSAN iSCSI on my mac) along with the IP address (or hostname) of your OpenIndiana box. Tada.
Source: Setting up COMSTAR and iSCSI target on the Nexenta Wiki.