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

Data disks udev rule #624

Merged
merged 2 commits into from Mar 31, 2017
Merged

Data disks udev rule #624

merged 2 commits into from Mar 31, 2017

Conversation

paulmey
Copy link
Member

@paulmey paulmey commented Mar 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

@msftclas
Copy link

@paulmey,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@paulmey
Copy link
Member Author

paulmey commented Mar 24, 2017

Don't merge yet, we're still testing on all distros...

@szarkos
Copy link
Contributor

szarkos commented Mar 25, 2017

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:
ID_PATH=vmbus-f8b3781b:1e82:4818:a1c3:63d806ec15bb-lun-0

CentOS 6:
ID_PATH=scsi-0:0:0:0

CentOS 7:
undefined

Ubuntu 14.04:
undefined

Ubuntu 16.04:
ID_PATH=acpi-VMBUS:01-scsi-0:0:0:0

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"
Copy link
Contributor

Choose a reason for hiding this comment

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

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"

@paulmey
Copy link
Member Author

paulmey commented Mar 25, 2017

That will need a bit of work to also work with partitions... I'll be back

@paulmey
Copy link
Member Author

paulmey commented Mar 28, 2017

@szarkos check it out. I've changed it so it now works for:

  • CentOS-6-8
  • CentOS-7-3
  • Debian-8
  • openSUSE-Leap-42-2
  • RHEL-6-8
  • RHEL-7-3
  • SLES-11-SP4
  • SLES-12-SP2
  • UbuntuServer-12-04-5-LTS
  • UbuntuServer-14-04-5-LTS
  • UbuntuServer-16-04-LTS

Detailed results: https://gist.github.com/paulmey/aa40585ced19f3857c02d9f031580f86#file-results-txt

@paulmey
Copy link
Member Author

paulmey commented Mar 30, 2017

Okay, one more change coming. People want us to prepare for usage of multiple controllers.

@hglkrijger hglkrijger added this to the v2.2.8 milestone Mar 31, 2017
@hglkrijger hglkrijger merged commit 8821957 into Azure:master Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants