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
vdev_id: new slot type SES. #6956
Conversation
6527da3
to
d650e40
Compare
cmd/vdev_id/vdev_id
Outdated
| # [5:0:61:0] enclosu HP D6000 2.38 - /dev/sg141 | ||
| # [6:0:25:0] enclosu HP D2700 SAS AJ941A 0147 - /dev/sg167 | ||
| # [6:0:51:0] enclosu HP D2700 SAS AJ941A 0147 - /dev/sg193 | ||
| enclosures=`lsscsi -g | sed -n -e '/enclosu/s/^.* \([^ ]*\)$/\1/p'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sed line here doesn't appear to correctly handle the following abbreviated output from lsscsi -g. Specifically it does not print the first device.
[0:0:0:0] enclosu RAIDINC 84BAY EBOD 0204 - /dev/sg0
[0:0:81:0] enclosu RAIDINC 84BAY EBOD 0204 - /dev/sg81
[11:0:1:0] enclosu RAIDINC 84BAY EBOD 0204 - /dev/sg163
[11:0:81:0] enclosu RAIDINC 84BAY EBOD 0204 - /dev/sg243
lsscsi -g | sed -n -e '/enclosu/s/^.* \([^ ]*\)$/\1/p'
/dev/sg81
/dev/sg163
/dev/sg243There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed to cope with the pesky trailing space.
cmd/vdev_id/vdev_id
Outdated
| @@ -276,6 +276,26 @@ sas_handler() { | |||
| d=$(eval echo \${$i}) | |||
| SLOT=`echo $d | sed -e 's/^.*://'` | |||
| ;; | |||
| "SES") | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] for consistency with "lun" let's go with a lower case "ses".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially I did write ses in lower case, but I decided it was too easily confused with sas, and that SES was much clearer. That is, clarity trumped consistency. Do you agree?
(I'll address the other points on Monday.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that, but in this case I don't think it will result in too much confusion since sas is not a valid value for slot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, now lowercased.
man/man5/vdev_id.conf.5
Outdated
| @@ -103,6 +103,9 @@ taken. The default is bay. | |||
| \fIid\fR - use the scsi id as the slot number. | |||
|
|
|||
| \fIlun\fR - use the scsi lun as the slot number. | |||
|
|
|||
| \fISES\fR - use the SCSI Enclosure Services (SES) enclosure device slot number, as reported by | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you expand on this slightly as you did in the commit comment to explain that this is not the preferred setting but is being provided as an option for drivers which don't provide any other stable identifier.
Please also mind the 80 character line limit here and in cmd/vdev_id/vdev_id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, and now complies with the 80 character line limit, notwithstanding the tension between this and the 8 character (tab) indent level ;-)
This extends vdev_id to support a new slot type, ses, for SCSI Enclosure Services. With slot type ses, the disk slot numbers are determined by using the device slot number reported by sg_ses for the device with matching SAS address, found by querying all available enclosures. This is primarily of use on systems with a deficient driver omitting support for bay_identifier in /sys/devices. In my testing, I found that the existing slot types of port and id were not stable across disk replacement, so an alternative was required. Signed-off-by: Simon Guest <simon.guest@tesujimath.org>
d650e40
to
22bf1ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and works as expected. Thanks!
Codecov Report
@@ Coverage Diff @@
## master #6956 +/- ##
==========================================
+ Coverage 75.25% 75.38% +0.12%
==========================================
Files 296 296
Lines 95453 95453
==========================================
+ Hits 71837 71958 +121
+ Misses 23616 23495 -121
Continue to review full report at Codecov.
|
This extends vdev_id to support a new slot type, ses, for SCSI Enclosure Services. With slot type ses, the disk slot numbers are determined by using the device slot number reported by sg_ses for the device with matching SAS address, found by querying all available enclosures. This is primarily of use on systems with a deficient driver omitting support for bay_identifier in /sys/devices. In my testing, I found that the existing slot types of port and id were not stable across disk replacement, so an alternative was required. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Simon Guest <simon.guest@tesujimath.org> Closes openzfs#6956
This extends vdev_id to support a new slot type, ses, for SCSI Enclosure Services. With slot type ses, the disk slot numbers are determined by using the device slot number reported by sg_ses for the device with matching SAS address, found by querying all available enclosures. This is primarily of use on systems with a deficient driver omitting support for bay_identifier in /sys/devices. In my testing, I found that the existing slot types of port and id were not stable across disk replacement, so an alternative was required. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Simon Guest <simon.guest@tesujimath.org> Closes openzfs#6956
This extends vdev_id to support a new slot type, ses, for SCSI Enclosure Services. With slot type ses, the disk slot numbers are determined by using the device slot number reported by sg_ses for the device with matching SAS address, found by querying all available enclosures. This is primarily of use on systems with a deficient driver omitting support for bay_identifier in /sys/devices. In my testing, I found that the existing slot types of port and id were not stable across disk replacement, so an alternative was required. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Simon Guest <simon.guest@tesujimath.org> Closes openzfs#6956
This extends vdev_id to support a new slot type, ses, for SCSI Enclosure Services. With slot type ses, the disk slot numbers are determined by using the device slot number reported by sg_ses for the device with matching SAS address, found by querying all available enclosures. This is primarily of use on systems with a deficient driver omitting support for bay_identifier in /sys/devices. In my testing, I found that the existing slot types of port and id were not stable across disk replacement, so an alternative was required. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Simon Guest <simon.guest@tesujimath.org> Closes #6956
Description
This extends vdev_id to support a new slot type,
SES, for SCSI Enclosure Services.With slot type
SES, the disk slot numbers are determined by using the device slot number reported bysg_sesfor the device with matching SAS address.Motivation and Context
This is primarily of use on systems with a deficient driver omitting support for bay_identifier in /sys/devices. For example, HP's hpsa driver used with their H241 cards doesn't support bay_identifier, instead returning invalid argument. The reason for this can be found in the source code for that driver, which has the following
Oh dear.
In my testing, I found that the existing slot types of
portandidwere not stable across disk replacement, so an alternative was required.How Has This Been Tested?
This has been tested on all our ZFS fileservers, which now produce a satisfactory bay identifier when udev is triggered to run the vdev_id script. These servers include:
The combination of DL380 Gen 9, H241, and older D2700 external storage does not seem to support SCSI Enclosure Services.
Types of changes
Checklist:
Signed-off-by.