udev rules for hyperV disks
- Dominant language
- Python
- Stars
- 11
- Forks
- 24
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 1
Description
Hi,
I would like to see some official MSFT udev rules for HyperV similar to [udev/80-azure-disk.rules](https://github.com/Azure/azure-vm-utils/blob/main/udev/80-azure-disk.rules)
Is Microsoft interesting making that part of the azure-vm-utils package? As of right now I have built my own rules:
```
ACTION!="add|change", GOTO="hyperv_storage_end"
SUBSYSTEM!="block", GOTO="hyperv_storage_end"
ENV{ID_PATH}!="acpi-VMBUS:00-vmbus-*-lun-*", GOTO="hyperv_storage_end"
ENV{ID_VENDOR}!="Msft", GOTO="hyperv_storage_end"
ENV{ID_MODEL}!="Virtual_Disk", GOTO="hyperv_storage_end"
ENV{DEVTYPE}=="disk", KERNEL=="sd*", \
PROGRAM="/bin/sh -c 'a=$(basename $(readlink -f /sys/class/block/%k/device)); bus=$(echo $a | cut -d: -f1); lun=$(echo $a | cut -d: -f4); echo scsi${bus}/lun${lun}'", \
ENV{HYPERV_SCSI_NAME}="$result", \
SYMLINK+="disk/hyperv/$env{HYPERV_SCSI_NAME}"
ENV{DEVTYPE}=="partition", KERNEL=="sd*[0-9]", \
PROGRAM="/bin/sh -c 'a=$(basename $(readlink -f /sys/class/block/%k/../device)); bus=$(echo $a | cut -d: -f1); lun=$(echo $a | cut -d: -f4); echo scsi${bus}/lun${lun}'", \
ENV{HYPERV_SCSI_NAME}="$result", \
SYMLINK+="disk/hyperv/$env{HYPERV_SCSI_NAME}-part%n"
LABEL="hyperv_storage_end"
```
They seem to work, but I am guessing there are some possibilties in hyperv that I am not aware of :)
Greetings
Klaas
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.