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 udev rule for GCE LocalSSD's #1465

Closed
zmarano opened this Issue Jul 19, 2016 · 0 comments

Comments

@zmarano

zmarano commented Jul 19, 2016

Issue Report

CoreOS Version

NAME=CoreOS
ID=coreos
VERSION=1081.5.0
VERSION_ID=1081.5.0
BUILD_ID=2016-07-16-2255
PRETTY_NAME="CoreOS 1081.5.0 (MoreOS)"
ANSI_COLOR="1;32"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://github.com/coreos/bugs/issues"

Feature Request

Add a udev rule for GCE LocalSSD's to show up correctly in /dev/disk/by-id the same as Persistent Disks.

Environment

Google Compute Engine with a Local SSD attached

Desired Feature

ls /dev/disk/by-id/google-local-ssd-0 should work (or whatever your local-ssd is named)

Other Information

/usr/lib/udev/rules.d/90-cloud-storage.rules has rules for PersistentDisk identifiers. Add a rule for "EphemeralDisk".
udevadm info -q all -n /dev/sdb
P: /devices/pci0000:00/0000:00:04.0/virtio1/host1/target1:0:1/1:0:1:0/block/sdb
N: sdb
S: disk/by-id/scsi-0Google_EphemeralDisk_local-ssd-0
S: disk/by-path/virtio-pci-0000:00:04.0-scsi-0:0:1:0
E: DEVLINKS=/dev/disk/by-path/virtio-pci-0000:00:04.0-scsi-0:0:1:0 /dev/disk/by-id/scsi-0Google_EphemeralDisk_local-ssd-0
E: DEVNAME=/dev/sdb
E: DEVPATH=/devices/pci0000:00/0000:00:04.0/virtio1/host1/target1:0:1/1:0:1:0/block/sdb
E: DEVTYPE=disk
E: ID_BUS=scsi
E: ID_MODEL=EphemeralDisk
E: ID_MODEL_ENC=EphemeralDisk\x20\x20\x20
E: ID_PATH=virtio-pci-0000:00:04.0-scsi-0:0:1:0
E: ID_PATH_TAG=virtio-pci-0000_00_04_0-scsi-0_0_1_0
E: ID_REVISION=1
E: ID_SCSI=1
E: ID_SERIAL=0Google_EphemeralDisk_local-ssd-0
E: ID_SERIAL_SHORT=local-ssd-0
E: ID_TYPE=disk
E: ID_VENDOR=Google
E: ID_VENDOR_ENC=Google\x20\x20
E: MAJOR=8
E: MINOR=16
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=9205524

Should just have to add the following to /usr/lib/udev/rules.d/90-cloud-storage.rules:
KERNEL=="sd_|vd_", ENV{ID_VENDOR}=="Google", ENV{ID_MODEL}=="EphemeralDisk", ENV{ID_SERIAL_SHORT}=="?", ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-id/google-$env{ID_SERIAL_SHORT}"
KERNEL=="sd
|vd_", ENV{ID_VENDOR}=="Google", ENV{ID_MODEL}=="EphemeralDisk", ENV{ID_SERIAL_SHORT}=="?_", ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-id/google-$env{ID_SERIAL_SHORT}-part%n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment