On Wed, 1 Nov 2006, Adam Leventhal wrote:

Rick McNeal and I have been working on building support for sharing ZVOLs
as iSCSI targets directly into ZFS. Below is the proposal I'll be
submitting to PSARC. Comments and suggestions are welcome.

Adam

---8<---

iSCSI/ZFS Integration

A. Overview

The goal of this project is to couple ZFS with the iSCSI target in Solaris
specifically to make it as easy to create and export ZVOLs via iSCSI as it
is to create and export ZFS filesystems via NFS. We will add two new ZFS
properties to support this feature.

   shareiscsi

        Like the 'sharenfs' property, 'shareiscsi' indicates if a ZVOL should
        be exported as an iSCSI target. The acceptable values for this property
        are 'on', 'off', and 'direct'. In the future, we may support other
        target types (for example, 'tape'). The default is 'off'. This property
        may be set on filesystems, but has no direct effect; this is to allow
        ZVOLs created under the ZFS hierarchy to inherit a default. For
        example, an administrator may want ZVOLs to be shared by default, and
        so set 'shareiscsi=on' for the pool.

   iscsioptions

        This property, which is hidden by default, is used by the iSCSI target
        daemon to store persistent information such as the IQN. The contents
        are not intended for users or external consumers.


B. Examples

iSCSI targets are simple to create with the zfs(1M) command:

# zfs create -V 100M pool/volumes/v1
# zfs set shareiscsi=on pool/volumes/v1
# iscsitadm list target
Target: pool/volumes/v1
   iSCSI Name: iqn.1986-03.com.sun:02:4db92521-f5dc-cde4-9cd5-a3f6f567220a
   Connections: 0

Renaming the ZVOL has the expected result for the iSCSI target:

# zfs rename pool/volumes/v1 pool/volumes/stuff
# iscsitadm list target
Target: pool/volumes/stuff
   iSCSI Name: iqn.1986-03.com.sun:02:4db92521-f5dc-cde4-9cd5-a3f6f567220a
   Connections: 0

Note that per the iSCSI specification (RFC3720), the iSCSI Name is unchanged
after the ZVOL is renamed.

Exporting a pool containing a shared ZVOL will cause the target to be removed;
importing a pool containing a shared ZVOL will cause the target to be
shared:

# zpool export pool
# iscsitadm list target
# zpool import pool
# iscsitadm list target
Target: pool/volumes/stuff
   iSCSI Name: iqn.1986-03.com.sun:02:4db92521-f5dc-cde4-9cd5-a3f6f567220a
   Connections: 0

Note again that all configuration information is stored with the dataset. As
with NFS shared filesystems, iSCSI targets imported on a different system
will be shared appropriately.

This is super useful! Will ACLs and aliases be stored as properties? Could you post the list of available iSCSI properties to the list?

Thanks,
- Ryan
--
UNIX Administrator
http://prefetch.net
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to