-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
Closing see original #1099 pull request for review and comment. |
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..
Closing. The patches will remain available for those who want to apply them. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is iSCSI sharing for ZoL (shareiscsi).
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.
=> :
Default: 0 (1 for STGT)
STGT: ssc, pt
Default: blockio (disk for STGT)
STGT: rdwr, aio, mmap, sg, ssc
Default: wt (rdwr for STGT)
Default: Volume blocksize, 4096 if not usable.
NOTE: Currently not supported for STGT (doesn't seem to be
an option for it in tgtadm).
Currently only availible for LIO, STGT and SCST.
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..