-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create symlinks root/resource devices to /dev/disk/azure folder. Currently, Azure CSI uses folder /dev/drive/azure to define the boot/temporary disks. It helps to find the disk by LUN number (removes the system disks from result). Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev> Signed-off-by: Noel Georgi <git@frezbo.dev>
- Loading branch information
1 parent
e72fe55
commit 24e545e
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Original file https://github.com/canonical/cloud-init/blob/main/udev/66-azure-ephemeral.rules | ||
# Skip all partitions symlinks. It uses by cloud-init (fstab mount paths) only. | ||
# | ||
# Azure specific rules | ||
ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_VENDOR}=="Msft", ENV{ID_MODEL}=="Virtual_Disk", GOTO="azure_disk" | ||
GOTO="azure_end" | ||
|
||
LABEL="azure_disk" | ||
# Root has a GUID of 0000 as the second value on Gen1 instances | ||
# 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" | ||
ATTRS{device_id}=="?00000001-0001-*", ENV{fabric_name}="BEK", GOTO="azure_names" | ||
|
||
# Azure well known SCSI controllers on Gen2 instances | ||
ATTRS{device_id}=="{f8b3781a-1e82-4818-a1c3-63d806ec15bb}", ENV{fabric_scsi_controller}="scsi0", GOTO="azure_datadisk" | ||
GOTO="azure_end" | ||
|
||
# Map scsi#/lun# fabric_name to azure_root|resource on Gen2 instances | ||
LABEL="azure_datadisk" | ||
ENV{DEVTYPE}=="disk", ENV{fabric_name}="$env{fabric_scsi_controller}/$env{ID_PATH}", GOTO="azure_names" | ||
GOTO="azure_end" | ||
|
||
# Create the symlinks | ||
LABEL="azure_names" | ||
ENV{DEVTYPE}=="disk", SYMLINK+="disk/azure/$env{fabric_name}" | ||
|
||
LABEL="azure_end" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters