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
Add enclosure_symlinks option to vdev_id #8194
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8194 +/- ##
=========================================
- Coverage 78.52% 78.42% -0.1%
=========================================
Files 379 378 -1
Lines 114880 114759 -121
=========================================
- Hits 90210 90001 -209
- Misses 24670 24758 +88
Continue to review full report at Codecov.
|
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 haven't manually tested it yet on a real system but it looks good. @tesujimath if you can spare the time it'd be great if you could review this change too since you've extended this script yourself once.
| # When udev sees a scsi_generic device, it calls this script with -e to | ||
| # create the enclosure device symlinks only. We also need | ||
| # "enclosure_symlinks yes" set in vdev_id.config to actually create the | ||
| # symlink. |
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: check whitespace for this whole block
| /dev/by-enclosure/enc-U0 | ||
| /dev/by-enclosure/enc-U1 | ||
| .fi | ||
| .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.
Please update the vdev_id.conf.sas_direct.example file so it includes enclosure_symlinks yes.
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.
Will this be limited to sas_direct? It seems as though it could apply to multipath as well
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.
@gdevenyi yep it will work (I tested with multipath). multipath is independent of the HBA topology mapping (sas_direct/sas_switch).
|
@behlendorf I should be able to have a look at this next week. |
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 checked this out on my servers. All is fine as far as I am concerned.
Add an 'enclosure_symlinks' option to vdev_id.conf. This creates consistently named symlinks to the enclosure devices (/dev/sg*) based off the configuration in vdev_id.conf. The enclosure symlinks show up in /dev/by-enclosure/<prefix>-<channel><num>. The links make it make it easy to run sg_ses on a particular enclosure device. The enclosure links are created in addition to the normal /dev/disk/by-vdev links. 'enclosure_symlinks' is only valid in sas_direct configurations. Signed-off-by: Tony Hutter <hutter2@llnl.gov>
0b831f9
to
f5b0125
Compare
|
Commits squashed |
Add an 'enclosure_symlinks' option to vdev_id.conf. This creates consistently named symlinks to the enclosure devices (/dev/sg*) based off the configuration in vdev_id.conf. The enclosure symlinks show up in /dev/by-enclosure/<prefix>-<channel><num>. The links make it make it easy to run sg_ses on a particular enclosure device. The enclosure links are created in addition to the normal /dev/disk/by-vdev links. 'enclosure_symlinks' is only valid in sas_direct configurations. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Simon Guest <simon.guest@tesujimath.org> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes openzfs#8194
Add an 'enclosure_symlinks' option to vdev_id.conf. This creates consistently named symlinks to the enclosure devices (/dev/sg*) based off the configuration in vdev_id.conf. The enclosure symlinks show up in /dev/by-enclosure/<prefix>-<channel><num>. The links make it make it easy to run sg_ses on a particular enclosure device. The enclosure links are created in addition to the normal /dev/disk/by-vdev links. 'enclosure_symlinks' is only valid in sas_direct configurations. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Simon Guest <simon.guest@tesujimath.org> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes #8194
Motivation and Context
This updates
vdev_idto create/dev/by-enclosuresymlinks to the enclosure/dev/sg*devices. For example:/dev/by-enclosure/enc-L0 -> /dev/sg0'Description
Add an
enclosure_symlinksoption to vdev_id.conf. This creates consistently named symlinks to the enclosure devices (/dev/sg*) based off the configuration in vdev_id.conf. The enclosure symlinks showup in
/dev/by-enclosure/<prefix>-<channel><num>. The symlinks make easy to identify a particular enclosure device, since the underlying /dev/sg* devices can be instantiated differently at each boot. The enclosure links are created in addition to the normal/dev/disk/by-vdevlinks.enclosure_symlinksis only valid in sas_direct configurations.How Has This Been Tested?
Tested configuration manually on a system with four enclosure devices and and verified
enclosure_symlinksandenclosure_symlinks_prefixworked as expcted.Types of changes
Checklist:
Signed-off-by.