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 regression: slot remapping doesn't work anymore #11951
Comments
|
Substantial rewrite at #11526 |
|
@arshad512 and @AeonJJohnson it sounds like a regression was accidentally introduced with the recent vdev_id rework. Would you mind taking a look at this. |
|
Can you clarify the following?
The rebuilt vdev_id script does depend on how enclosure firmware and HBA drivers populate sysfs with values. I have seen enclosures that have physical labeling (decals, etc) on slots that are different from what the firmware developers designate the slots. Example being external labeling starting with one (Slot 1) but that same slot is designated as 0. Zero start in firmware and One start in external visual labeling. If it was working and now is not, something has surely changed. Can you post the output of the following command, changing the argument to reflect a drive that is not reporting correctly? sh -x /usr/lib/udev/vdev_id -d sdX (where X equals the sd device instance not correctly reporting) Be sure to include what you think that drive should be processed by vdev_id as. |
|
This package is ideal for answering these questions, https://pypi.org/project/sasutils/ |
The mapping behaviour switches between work (zfs-0.8.3) and not-work (zfs-2.1.0rc4) on the same host, so I don't think it's at all hardware dependant. These particular HBA:s are LSI 9212-4i4e IIRC.
As above, behavior changes between zfs version and reboot, currently connected is a HP D2600 and a HP DL180G6 converted to be a disk enclosure.
I have only checked the Ubuntu 20.04 build of zfs 0.8.3 (which works) and 2.1.0rc4 that doesn't.
Yup, enclosures map ID:s all over the place and it gets worse when you have internal HBA:s with individual connectors that are not in the same order as the ports... That's why we need the slot mapping to be able to bring order to the madness.
The vdev_id.conf line: should trigger and map this drive as From a quick look it can be too "hard" quoting, so the LINUX_SLOT etc variables aren't expanded as they should in the awk command line? |
|
@ZNikke , Thanks for the debug output.
Right
I will update you on this. (However, this should not be the case) |
You are correct. When the code was moved form ``(back-ticks command subsitution) to $() version the expansion was not handled. I will also skim thourgh rest of code if any other place this change is required. I will update the patch with the changes. |
|
Progress, now it processes the per-channel mappings but still not the default/fallback mapping, ie enc10 in our config: Debug output on one of the enc10 disks: For this drive I would have expected this and map this drive to |
|
@ZNikke , thanks for trying out the patch. For the fallback mapping I will update the patch in sometime. |
|
I'll give this a test on our enclosures |
|
With the revised patch the result is as expected: However, if I comment out the With ... |
|
@ZNikke ,
Thank you for confirming.
The reason for this is that when you comment out the "slot bay" line under vdev_id.conf instead of picking up the default which is 'bay' it picks up the first line which is defined under 'mappings' sections. From your example debug run you posted... The '4' comes from the first line which is matching 'slot' once 'slot bay' is removed. This is clearly incorrect which leads to wrong values we are getting. The question is did it ever run correctly? The code changes under jsai20@1f9db7f did not change this part and this should be failing under old verison also. Could you please confirm if this worked in older version or not? If not then we should still be fixing this ofcourse but in a new bug and leave this for the original issue you filed which was a regression. Second, if we look at the man page the "bay" is optional and taken as default. However the key (slot) should be present. IMHO, the usage of removing the full line of "slot bay" is incorrect. I am commenting purely from the code I read. I will let other folks comment on this if this is indeed a bug which needs to be fixed or not ?. (@AeonJJohnson , @gdevenyi , @tonyhutter , @behlendorf ) |
|
I'm pretty sure this has been broken for quite some time, I have vivid memories of fighting with In any case, either the bug needs to be fixed or the shipped I'm guessing fixing the script is less work (should be as easy as only accepting a line which is valid for the slot <bay|phy|id|lun> spec for the assignment). If it should be done within this issue or in a separate issue is another question I guess. |
Understood. Than, I would say, this is expected behavior (as per the code). This is not part of regression.
As per the code it expects 'slot' with 'bay' as default. So, man page sould be updated if that is confusing for users.
The code assumes 'bay' as default. If we change the behavior then we might end up breaking few cases where only 'slot' is mentioned by user. It would be good to update the man page. IMO. |
|
I think we may be going into creeping elegance territory here. The original complaint root cause was identified and fixed. We should avoid fine tuning to a single use case. One of the challenges with this entire subsystem is that the SES enclosure standard is a loose standard and how it is applied by various platform, hardware and enclosure manufacturers varies. The slot bay function isn't broken, it just might not work correctly on some hardware. If you take a look at the sysfs enclosure tree on your system and see what enclosure pointers exist under the end_device subdir you will get an idea of whether bay, phy, id, ses or mix will work best for your specific hardware. This works fine for the megascale "a list" hardware like HGST, Quanta, Newisys and Netapp. Others, based on their firmware robustness, can be less so. Adaptec HBAs for example make strange representations in sysfs, LSI based HBAs run flawless (as long as you don't have their RAID 0/1/1E "IR" firmware loaded. If you descend into the sysfs tree under /sys/class/sas_host you'll find the enclosure device subdir for each disk (after several subdir levels) that contains the SES pointers the script pulls data from. In the case below (HGST UltraData60 JBOD) you'll see the slot special file that contains the numeric id for the enclosure slot number: Based upon a specific combination of HBA and enclosure one of the other settings may work better. With this newer version of vdev_id I added the "mix" use case because of a hardware situation I discovered where a "slot compliant" JBOD may be connected to a host with directly connected disks inside of it, direct cable to slot with no SAS expander or SES function in the middle. This gave vdev_id the ability to enumerate disks both in a SES JBOD as well as directly connected. Maybe polishing some of what I said above and adding it to the man page may be a better path than tweaking vdev_id for site specific use cases. |
|
I agree that the original issue is fixed. However, for the "slot bay" thing, my main point is that the shipped example file won't work as is, and the man page is confusing, but I'll readily agree that it's likely best handled in a separate issue :) Although I have to add that the mapping code is really not about dealing with the hardware, as it's performed after that stage to deal with whatever the results of the hardware-dealing was to map ID:s into the logic the user wants (based on human preferences such as naming conventions and matching ID:s to what's printed on boxes etc). And btw, the The double-use of the |
|
Thanks everybody for the quick fix and all the testing. I'll go ahead and get it merged and the documentation updates can be handled in a new PR. |
Under function map_slot() variable passed as args were not getting properly substituted or expanded. This patch fixes the substitution issue. Reviewed-by: Niklas Edmundsson <nikke@acc.umu.se> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com> Closes openzfs#11951 Closes openzfs#11959
Under function map_slot() variable passed as args were not getting properly substituted or expanded. This patch fixes the substitution issue. Reviewed-by: Niklas Edmundsson <nikke@acc.umu.se> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com> Closes openzfs#11951 Closes openzfs#11959
Under function map_slot() variable passed as args were not getting properly substituted or expanded. This patch fixes the substitution issue. Reviewed-by: Niklas Edmundsson <nikke@acc.umu.se> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com> Closes openzfs#11951 Closes openzfs#11959
Under function map_slot() variable passed as args were not getting properly substituted or expanded. This patch fixes the substitution issue. Reviewed-by: Niklas Edmundsson <nikke@acc.umu.se> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com> Closes openzfs#11951 Closes openzfs#11959
Under function map_slot() variable passed as args were not getting properly substituted or expanded. This patch fixes the substitution issue. Reviewed-by: Niklas Edmundsson <nikke@acc.umu.se> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com> Closes openzfs#11951 Closes openzfs#11959
System information
Describe the problem you're observing
It looks to me that slot remapping has stopped working sometime between zfs-0.8.3 (actually 0.8.3-1ubuntu12.8) and zfs-2.1.0-rc4.
Our disks ends up at different id:s depending on enclosure model, none of them matching the physical 1-12 numbering on the enclosure, so we want to map them all to match the 1-12 numbering.
Our previously working
vdev_id.confseems to still map the channels, but the disks ends up with whatever slot the enclosures use. As the documentation and examples forvdev_id.confsuggests this should still work, I think it's a regression.Describe how to reproduce the problem
Given this
vdev_id.conf:We get this mapping:
Ie no slot remapping was done! The expected result of the slot mapping would be for
c3bay c4bayto have the disks in the 8 .. 15 sequence, and that the enc9/enc10 enclosures to have the disks in the 1 .. 12 sequence.Things get extra interesting if I remove the
slot bayassignment, then I only getc0v1mapped inby-vdev/. Thevdev_id.confman page says thatbayis the default, so it really shouldn't be needed to specify it. On this subject it's interesting to note thatvdev_id.conf.sas_direct.exampledoesn't mentionslot bay, but but the example in thevdev_id.confman page do. I personally think that the double-use of theslotkeyword is a mistake, it's very confusing...Include any warning/errors/backtraces from the system logs
The text was updated successfully, but these errors were encountered: