Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iSCSI Integration (shareiscsi) #3116

Closed
wants to merge 1 commit into from
Closed

Conversation

behlendorf
Copy link
Contributor

This is iSCSI sharing for ZoL (shareiscsi).

  • Supports the following iSCSI implementations (in this order of discovery):
  • Will refuse to unshares an active target (one with sessions).
  • Supports the following options to the 'shareiscsi' property:
    • name/iqn Full iSCSI Qualified Name (IQN), including identifier.
      This is generated by iscsi_generate_target():
      + Uses the content of an optional /etc/iscsi_target_id file:
      Example: iqn.YYYY-MM.tld.domain
      + If this file doesn't exist, it uses the current year, month
      and domain name to generate the iqn.
      + The dataset name is appended at the end of the iqn, with
      slashes replaced with dots.
      => :
    • lun LUN (0-16384)
      Default: 0 (1 for STGT)
    • type Share mode (fileio, blockio, nullio, disk, tape)
      STGT: ssc, pt
      Default: blockio (disk for STGT)
    • iomode IO mode (wb, wt, ro)
      STGT: rdwr, aio, mmap, sg, ssc
      Default: wt (rdwr for STGT)
    • blocksize Logical block size (512, 1024, 2048, 4096)
      Default: Volume blocksize, 4096 if not usable.
      NOTE: Currently not supported for STGT (doesn't seem to be
      an option for it in tgtadm).
    • initiator Allow only this initiator to bind to target.
      Currently only availible for LIO, STGT and SCST.
    • authname Global user to use in binds on targets.
    • authpass Password for global user.
  • If not called with a 'name/iqn' value, then force setting it.
    This so that the IQN doesn't change every month (when it is
    regenerated again). It will be generated by iscsi_generate_target()
    (see above).

NOTE:

  • Moved nfs.c:foreach_nfs_shareopt() to libshare.c:foreach_shareopt()
    so that it can be (re)used in smb.c and iscsi.c.

  • Split iSCSI implementation into their own separate source files

  • Use the list_{create,insert}() etc for keeping tabs of the linked lists
    instead of using a home-made version.

  • A half second delay had to be added in lib/libzfs/libzfs_mount.c:zfs_unmount()
    after the successful unshare. This to avoid 'dataset busy' when destroying
    recursivly.
    = The 'initiator', 'authname' and 'authpass' option might have some issues:
    It will make the compatibility between the different iSCSI implementations
    questionable - can't switch between them easily (it will ONLY be availible
    in ZoL). I COULD make the option be silently ignored (instead of forcibly
    rejected if not availible).

    But that still doesn't solve the (possible) problem between ZoL and
    OpenZFS/Illumos (setting the option, will possibly introduce problems when
    importing the pool on something else than ZoL).

    So some more discussion might be needed..

@behlendorf behlendorf added this to the 0.6.4 milestone Feb 18, 2015
@behlendorf behlendorf added the Type: Feature Feature request or new feature label Feb 18, 2015
@behlendorf
Copy link
Contributor Author

Closing see original #1099 pull request for review and comment.

@behlendorf behlendorf closed this Feb 24, 2015
@behlendorf behlendorf reopened this Feb 27, 2015
@sempervictus
Copy link
Contributor

Thanks, will work off this PR moving forward.

This is iSCSI sharing for ZoL (shareiscsi).
* Supports the following iSCSI implementations (in this order of discovery):
  + IET         http://iscsitarget.sourceforge.net
  + STGT        http://stgt.berlios.de
  + SCST        http://scst.sourceforge.net
    + Requires that SCST was compiled with /sys support (the default).
  + LIO         http://linux-iscsi.org
* Will refuse to unshares an active target (one with sessions).
* Supports the following options to the 'shareiscsi' property:
  + name/iqn    Full iSCSI Qualified Name (IQN), including identifier.
                This is generated by iscsi_generate_target():
                + Uses the content of an optional /etc/iscsi_target_id file:
                  Example: iqn.YYYY-MM.tld.domain
                + If this file doesn't exist, it uses the current year, month
                  and domain name to generate the iqn.
                + The dataset name is appended at the end of the iqn, with
                  slashes replaced with dots.
                  => <iqn>:<dataset>
  + lun         LUN (0-16384)
                Default: 0 (1 for STGT)
  + type        Share mode (fileio, blockio, nullio, disk, tape)
                STGT: ssc, pt
                Default: blockio (disk for STGT)
  + iomode      IO mode (wb, wt, ro)
                STGT: rdwr, aio, mmap, sg, ssc
                Default: wt (rdwr for STGT)
  + blocksize   Logical block size (512, 1024, 2048, 4096)
                Default: Volume blocksize, 4096 if not usable.
                NOTE: Currently not supported for STGT (doesn't seem to be
                      an option for it in tgtadm).
  + initiator   Allow only this initiator to bind to target.
                Currently only availible for LIO, STGT and SCST.
  + authname    Global user to use in binds on targets.
  + authpass    Password for global user.
* If not called with a 'name/iqn' value, then force setting it.
  This so that the IQN doesn't change every month (when it is
  regenerated again). It will be generated by iscsi_generate_target()
  (see above).

NOTE:
+ Moved nfs.c:foreach_nfs_shareopt() to libshare.c:foreach_shareopt()
  so that it can be (re)used in smb.c and iscsi.c.
+ Split iSCSI implementation into their own separate source files
+ Use the list_{create,insert}() etc for keeping tabs of the linked lists
  instead of using a home-made version.
+ A half second delay had to be added in lib/libzfs/libzfs_mount.c:zfs_unmount()
  after the successful unshare. This to avoid 'dataset busy' when destroying
  recursivly.
= The 'initiator', 'authname' and 'authpass' option might have some issues:
  It will make the compatibility between the different iSCSI implementations
  questionable - can't switch between them easily (it will ONLY be availible
  in ZoL). I COULD make the option be silently ignored (instead of forcibly
  rejected if not availible).

  But that still doesn't solve the (possible) problem between ZoL and
  OpenZFS/Illumos (setting the option, will possibly introduce problems when
  importing the pool on something else than ZoL).

  So some more discussion might be needed..
@behlendorf
Copy link
Contributor Author

Closing. The patches will remain available for those who want to apply them.

@behlendorf behlendorf closed this Apr 28, 2015
@behlendorf behlendorf deleted the iscsi branch April 19, 2021 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Feature request or new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants