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

Detect iSCSI in the zpool cmd vdev media script #12206

Merged
merged 1 commit into from
Sep 2, 2021
Merged

Detect iSCSI in the zpool cmd vdev media script #12206

merged 1 commit into from
Sep 2, 2021

Conversation

don-brady
Copy link
Contributor

Motivation and Context

In the zpool status command, the -c media option shows whether a vdev is a file, hdd, or ssd. It would be nice to also support iSCSI devices as a media type.

Description

Added support to the media script to detect if a device is iSCSI.

How Has This Been Tested?

manually tested with a pool comprised of iSCSI devices. Here are two example runs with the new detection:

$ zpool status -c media,vendor domain0
  pool: domain0
 state: ONLINE
config:

	NAME                                      STATE     READ WRITE CKSUM  media    vendor
	domain0                                   ONLINE       0     0     0
	  scsi-36f47acc1000000006b6b727300000281  ONLINE       0     0     0  iscsi  SolidFir
	  scsi-36f47acc1000000006b6b727300000282  ONLINE       0     0     0  iscsi  SolidFir

errors: No known data errors
$ zpool status -c media,vendor domain0
  pool: domain0
 state: ONLINE
config:

	NAME                                      STATE     READ WRITE CKSUM  media   vendor
	domain0                                   ONLINE       0     0     0
	  scsi-3600140535077b47cb424772bc8e6a4dd  ONLINE       0     0     0  iscsi  LIO-ORG
	  scsi-360014053d2ba41f557a4eb98e2f95041  ONLINE       0     0     0  iscsi  LIO-ORG
	  scsi-360014054498a6f3ff7a4f9988f3c6624  ONLINE       0     0     0  iscsi  LIO-ORG

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Signed-off-by: Don Brady <don.brady@delphix.com>
@don-brady don-brady requested review from sdimitro and tonyhutter June 8, 2021 17:55
Copy link
Contributor

@sdimitro sdimitro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending tests

vpd_pg83="/sys/block/$device/device/vpd_pg83"
if [ -f "$vpd_pg83" ]; then
if grep -q --binary "iqn." "$vpd_pg83"; then
MEDIA="iscsi"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since iscsi is the transport protocol, would it make sense to append iscsi to the disk type, like iscsi-hdd or iscsi-ssd? (I have not used iscsi so this may be a dumb question).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the iSCSI protocol exposes the backend device type. But I'll try an experiment with both backends to see if we can see it. If so then a hybrid might make sense.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jun 10, 2021
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Sep 2, 2021
@behlendorf behlendorf merged commit ab15b1f into openzfs:master Sep 2, 2021
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 15, 2021
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Don Brady <don.brady@delphix.com>
Closes openzfs#12206
rincebrain pushed a commit to rincebrain/zfs that referenced this pull request Sep 22, 2021
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Don Brady <don.brady@delphix.com>
Closes openzfs#12206
@don-brady don-brady deleted the iscsi-media branch November 5, 2021 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants