Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Data disks udev rule #624
Conversation
msftclas
commented
Mar 24, 2017
|
@paulmey, |
msftclas
added
the
cla-not-required
label
Mar 24, 2017
|
Don't merge yet, we're still testing on all distros... |
|
I think the use of $ID_PATH is not going to be very consistent across distributions. In some distributions we do not see ID_PATH configured, or the formatting varies. We might want to revert to using something like "/sys/block/%k/device" as you were in an earlier version. Running "udevadm info --query=property --name=/dev/sdc | grep ID_PATH" I see the following results on various endorsed distros: SLES 11: CentOS 6: CentOS 7: Ubuntu 14.04: Ubuntu 16.04: The lack of ID_PATH or any by-path links in CentOS 7 seems to be a bug and related to this issue: https://access.redhat.com/solutions/1565863 |
| # Root has a GUID of 0000 as the second value | ||
| # The resource/resource has GUID of 0001 as the second value | ||
| ATTRS{device_id}=="?00000000-0000-*", ENV{fabric_name}="root", GOTO="azure_names" | ||
| ATTRS{device_id}=="?00000000-0001-*", ENV{fabric_name}="resource", GOTO="azure_names" | ||
| +PROGRAM="/bin/sh -c 'echo $ID_PATH|cut -d: -f5'", ENV{fabric_name}="datadisks/lun$result", GOTO="azure_names" |
szarkos
Mar 25, 2017
Contributor
The following seems to work more consistently across distros and versions:
KERNEL=="sr*", GOTO="azure_end"
PROGRAM="/bin/sh -c 'readlink /sys/block/%k/device|cut -d: -f4'", ENV{fabric_name}="datadisks/lun-$result", GOTO="azure_names"
|
That will need a bit of work to also work with partitions... I'll be back |
|
@szarkos check it out. I've changed it so it now works for:
Detailed results: https://gist.github.com/paulmey/aa40585ced19f3857c02d9f031580f86#file-results-txt |
|
Okay, one more change coming. People want us to prepare for usage of multiple controllers. |
paulmey commentedMar 24, 2017
Adds matching rules for all scsi disks other than root/resource disk
Data disks will show up as /dev/disks/azure/datadisks/lun*, matching the LUN's specified on attach/deploy
Also fixed the test-out matching, since vendor and model were completely ignored