Knowledge Base : Configures Solaris 10 as iSCSI target

Solaris as an iSCSI Server with ZFS

iSCSI terminology

iSCSI Target: iSCSI Server
iSCSI Initiator: iSCSI Client

Installing requisite Solaris Packages

pkgadd -d . SUNWiscsir SUNWiscsitgtr SUNWiscsitgtu SUNWiscsiu
svcadm enable iscsitgt

Sharing a ZFS zvol block storage unit

We need a “block device” to export over iSCSI. ZFS lets you create “sparse” zvols which start off small, and expand to full size as you use them. Let’s add a 10GB sized one:

zfs create -s -V 10G zpool01/myiscsivol

We can now share it as simply as:

zfs set shareiscsi=on zpool01/myiscsivol

Configuring your iSCSI share with iscsitadm

View details of your iSCSI share:

iscsitadm list target -v

Configuring CHAP Authentication

First, we need to tell iscsitadm about our client (the „initiator“), and give it a friendly name. You’ll need the iqn (iSCSI Qualified Name), which you can get from the client (In Windows, it’s on the iSCSI „General“ tab).

iscsitadm create initiator –iqn iqn.1234-01.com.microsoft:win01 myclient

Now set the CHAP authentication parameters, the username and password. The password if you’re not using ipsec must be exactly between 12 and 16 characters:

iscsitadm modify initiator –chap-name myusername myclient
iscsitadm modify initiator –chap-secret myclient

You now need to associate the initiator entry you just created, with the ACL (Access Control List) of the iSCSI share:

iscsitadm modify target –acl myclient zpool01/myiscsivol

see: Solaris as an iSCSI Server with ZFS