Doing iSCSI targets on ZFS

As ZFS did quite well here – even after messing around with disks, I decided to give it another try. This time I am out to use its features on other systems. But to do so, I need to share it. As I am running virtual machines, it would be nice to have iSCSI shares to (ab)use. So let’s do it by starting the service:

# svcadm enable iscsitgt

As my Solaris install is still quite fresh I got a spare disk in it. It should carry my iscsi pool which I will just call ‘iscsistore’. Keeping it on a separate disk allows me to export it independently. So here we go:

# zpool create iscsistore c0t1d0

If you think that I have to mess around with dd now to write containers, you’re wrong. ZFS does this for us elegantly:

# zfs create -s -V 10gb iscsistore/zvol

Now the iSCSI shares:

# zfs set shareiscsi=on iscsistore/zvol

We check:

# iscsitadm list target -v

And that’s it. We’re ready to roll. Simple and easy. Simply ZFS.


Leave a Reply

Your email address will not be published. Required fields are marked *