canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization
https://cloud-init.io/
Other
2.99k stars 883 forks source link

[enhancement]: Azure: Support for NVMe disks #4598

Open ani-sinha opened 1 year ago

ani-sinha commented 1 year ago

Enhancement

For Azure VM sizes that use NVMe as OS disk, the 66-azure-ephemeral.rules cannot detect root partitions. No 'azure_root' links under /dev/disk/cloud:

# ll /dev/disk/cloud/
total 0
lrwxrwxrwx. 1 root root 9 Jul 19 06:28 azure_resource -> ../../sda
lrwxrwxrwx. 1 root root 10 Jul 19 06:28 azure_resource-part1 -> ../../sda1

This is similar to the ticket https://bugs.launchpad.net/cloud-init/+bug/1797480 where we enabled support for SCSI disks for Gen2 VMs. It was resolved with https://git.launchpad.net/cloud-init/commit/?id=3b332c93 in cloud-init.

I spawned two azure VMs with NVMe and ran udevadm info -q all /sys/class/block/nvme0n1* . Here are the resilts:

VM1:

# udevadm info -q all /sys/class/block/nvme0n1
P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/80c97e1e-15c4-4c6d-93d1-e38402047b8d/pci15c4:00/15c4:00:00.0/nvme/nvme0/nvme0n1
N: nvme0n1
S: disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001
S: disk/by-id/nvme-eui.577f8d0aff944fa3b6e5a7ff4d366001
S: disk/by-path/acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1
E: DEVLINKS=/dev/disk/by-path/acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1 /dev/disk/by-id/nvme-eui.577f8d0aff944fa3b6e5a7ff4d366001 /dev/disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001
E: DEVNAME=/dev/nvme0n1
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/80c97e1e-15c4-4c6d-93d1-e38402047b8d/pci15c4:00/15c4:00:00.0/nvme/nvme0/nvme0n1
E: DEVTYPE=disk
E: ID_MODEL=MSFT NVMe Accelerator v1.0
E: ID_PART_TABLE_TYPE=gpt
E: ID_PART_TABLE_UUID=28b3df8e-090e-47dc-8865-47ac2c596a5c
E: ID_PATH=acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1
E: ID_PATH_TAG=acpi-VMBUS_00-pci-15c4_00_00_0-nvme-1
E: ID_SERIAL=MSFT NVMe Accelerator v1.0_SN: 000001
E: ID_SERIAL_SHORT=SN: 000001
E: ID_WWN=eui.577f8d0aff944fa3b6e5a7ff4d366001
E: ID_WWN_WITH_EXTENSION=eui.577f8d0aff944fa3b6e5a7ff4d366001
E: MAJOR=259
E: MINOR=0
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=4882985

# udevadm info -q all /sys/class/block/nvme0n1p1
P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/80c97e1e-15c4-4c6d-93d1-e38402047b8d/pci15c4:00/15c4:00:00.0/nvme/nvme0/nvme0n1/nvme0n1p1
N: nvme0n1p1
S: disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part1
S: disk/by-id/nvme-eui.577f8d0aff944fa3b6e5a7ff4d366001-part1
S: disk/by-id/wwn-eui.577f8d0aff944fa3b6e5a7ff4d366001-part1
S: disk/by-partuuid/0ea96862-b56e-4cdf-834d-2d43b16332ad
S: disk/by-path/acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1-part1
S: disk/by-uuid/f165a2d2-e5f1-435f-86e6-b6dbc9aa66cb
E: DEVLINKS=/dev/disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part1 /dev/disk/by-id/wwn-eui.577f8d0aff944fa3b6e5a7ff4d366001-part1 /dev/disk/by-id/nvme-eui.577f8d0aff944fa3b6e5a7ff4d366001-part1 /dev/disk/by-uuid/f165a2d2-e5f1-435f-86e6-b6dbc9aa66cb /dev/disk/by-partuuid/0ea96862-b56e-4cdf-834d-2d43b16332ad /dev/disk/by-path/acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1-part1
E: DEVNAME=/dev/nvme0n1p1
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/80c97e1e-15c4-4c6d-93d1-e38402047b8d/pci15c4:00/15c4:00:00.0/nvme/nvme0/nvme0n1/nvme0n1p1
E: DEVTYPE=partition
E: ID_FS_TYPE=xfs
E: ID_FS_USAGE=filesystem
E: ID_FS_UUID=f165a2d2-e5f1-435f-86e6-b6dbc9aa66cb
E: ID_FS_UUID_ENC=f165a2d2-e5f1-435f-86e6-b6dbc9aa66cb
E: ID_MODEL=MSFT NVMe Accelerator v1.0
E: ID_PART_ENTRY_DISK=259:0
E: ID_PART_ENTRY_NUMBER=1
E: ID_PART_ENTRY_OFFSET=1026048
E: ID_PART_ENTRY_SCHEME=gpt
E: ID_PART_ENTRY_SIZE=1024000
E: ID_PART_ENTRY_TYPE=0fc63daf-8483-4772-8e79-3d69d8477de4
E: ID_PART_ENTRY_UUID=0ea96862-b56e-4cdf-834d-2d43b16332ad
E: ID_PART_TABLE_TYPE=gpt
E: ID_PART_TABLE_UUID=28b3df8e-090e-47dc-8865-47ac2c596a5c
E: ID_PATH=acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1
E: ID_PATH_TAG=acpi-VMBUS_00-pci-15c4_00_00_0-nvme-1
E: ID_SCSI=1
E: ID_SERIAL=MSFT NVMe Accelerator v1.0_SN: 000001
E: ID_SERIAL_SHORT=SN: 000001
E: ID_WWN=eui.577f8d0aff944fa3b6e5a7ff4d366001
E: ID_WWN_WITH_EXTENSION=eui.577f8d0aff944fa3b6e5a7ff4d366001
E: MAJOR=259
E: MINOR=1
E: PARTN=1
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=4909747

# udevadm info -q all /sys/class/block/nvme0n1p2
P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/80c97e1e-15c4-4c6d-93d1-e38402047b8d/pci15c4:00/15c4:00:00.0/nvme/nvme0/nvme0n1/nvme0n1p2
N: nvme0n1p2
S: disk/by-id/lvm-pv-uuid-KSMt1b-ZFz4-oAHv-yLIM-qLOt-SNPG-XzhZ21
S: disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part2
S: disk/by-id/nvme-eui.577f8d0aff944fa3b6e5a7ff4d366001-part2
S: disk/by-id/wwn-eui.577f8d0aff944fa3b6e5a7ff4d366001-part2
S: disk/by-partuuid/162ba977-1a7d-4003-9d79-934396046d68
S: disk/by-path/acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1-part2
E: DEVLINKS=/dev/disk/by-id/lvm-pv-uuid-KSMt1b-ZFz4-oAHv-yLIM-qLOt-SNPG-XzhZ21 /dev/disk/by-id/nvme-eui.577f8d0aff944fa3b6e5a7ff4d366001-part2 /dev/disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part2 /dev/disk/by-path/acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1-part2 /dev/disk/by-partuuid/162ba977-1a7d-4003-9d79-934396046d68 /dev/disk/by-id/wwn-eui.577f8d0aff944fa3b6e5a7ff4d366001-part2
E: DEVNAME=/dev/nvme0n1p2
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/80c97e1e-15c4-4c6d-93d1-e38402047b8d/pci15c4:00/15c4:00:00.0/nvme/nvme0/nvme0n1/nvme0n1p2
E: DEVTYPE=partition
E: ID_FS_TYPE=LVM2_member
E: ID_FS_USAGE=raid
E: ID_FS_UUID=KSMt1b-ZFz4-oAHv-yLIM-qLOt-SNPG-XzhZ21
E: ID_FS_UUID_ENC=KSMt1b-ZFz4-oAHv-yLIM-qLOt-SNPG-XzhZ21
E: ID_FS_VERSION=LVM2 001
E: ID_MODEL=MSFT NVMe Accelerator v1.0
E: ID_PART_ENTRY_DISK=259:0
E: ID_PART_ENTRY_NUMBER=2
E: ID_PART_ENTRY_OFFSET=2050048
E: ID_PART_ENTRY_SCHEME=gpt
E: ID_PART_ENTRY_SIZE=132165632
E: ID_PART_ENTRY_TYPE=e6d6d379-f507-44c2-a23c-238f2a3df928
E: ID_PART_ENTRY_UUID=162ba977-1a7d-4003-9d79-934396046d68
E: ID_PART_TABLE_TYPE=gpt
E: ID_PART_TABLE_UUID=28b3df8e-090e-47dc-8865-47ac2c596a5c
E: ID_PATH=acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1
E: ID_PATH_TAG=acpi-VMBUS_00-pci-15c4_00_00_0-nvme-1
E: ID_SCSI=1
E: ID_SERIAL=MSFT NVMe Accelerator v1.0_SN: 000001
E: ID_SERIAL_SHORT=SN: 000001
E: ID_WWN=eui.577f8d0aff944fa3b6e5a7ff4d366001
E: ID_WWN_WITH_EXTENSION=eui.577f8d0aff944fa3b6e5a7ff4d366001
E: MAJOR=259
E: MINOR=2
E: PARTN=2
E: SUBSYSTEM=block
E: SYSTEMD_ALIAS=/dev/block/259:2
E: SYSTEMD_READY=1
E: SYSTEMD_WANTS=lvm2-pvscan@259:2.service
E: TAGS=:systemd:
E: UDISKS_IGNORE=1
E: USEC_INITIALIZED=4888389

# udevadm info -q all /sys/class/block/nvme0n1p14
P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/80c97e1e-15c4-4c6d-93d1-e38402047b8d/pci15c4:00/15c4:00:00.0/nvme/nvme0/nvme0n1/nvme0n1p14
N: nvme0n1p14
S: disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part14
S: disk/by-id/nvme-eui.577f8d0aff944fa3b6e5a7ff4d366001-part14
S: disk/by-id/wwn-eui.577f8d0aff944fa3b6e5a7ff4d366001-part14
S: disk/by-partuuid/f33c8aeb-bac0-4383-ab97-2cc0ce5c88ed
S: disk/by-path/acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1-part14
E: DEVLINKS=/dev/disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part14 /dev/disk/by-id/nvme-eui.577f8d0aff944fa3b6e5a7ff4d366001-part14 /dev/disk/by-id/wwn-eui.577f8d0aff944fa3b6e5a7ff4d366001-part14 /dev/disk/by-path/acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1-part14 /dev/disk/by-partuuid/f33c8aeb-bac0-4383-ab97-2cc0ce5c88ed
E: DEVNAME=/dev/nvme0n1p14
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/80c97e1e-15c4-4c6d-93d1-e38402047b8d/pci15c4:00/15c4:00:00.0/nvme/nvme0/nvme0n1/nvme0n1p14
E: DEVTYPE=partition
E: ID_MODEL=MSFT NVMe Accelerator v1.0
E: ID_PART_ENTRY_DISK=259:0
E: ID_PART_ENTRY_NUMBER=14
E: ID_PART_ENTRY_OFFSET=2048
E: ID_PART_ENTRY_SCHEME=gpt
E: ID_PART_ENTRY_SIZE=8192
E: ID_PART_ENTRY_TYPE=21686148-6449-6e6f-744e-656564454649
E: ID_PART_ENTRY_UUID=f33c8aeb-bac0-4383-ab97-2cc0ce5c88ed
E: ID_PART_TABLE_TYPE=gpt
E: ID_PART_TABLE_UUID=28b3df8e-090e-47dc-8865-47ac2c596a5c
E: ID_PATH=acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1
E: ID_PATH_TAG=acpi-VMBUS_00-pci-15c4_00_00_0-nvme-1
E: ID_SCSI=1
E: ID_SERIAL=MSFT NVMe Accelerator v1.0_SN: 000001
E: ID_SERIAL_SHORT=SN: 000001
E: ID_WWN=eui.577f8d0aff944fa3b6e5a7ff4d366001
E: ID_WWN_WITH_EXTENSION=eui.577f8d0aff944fa3b6e5a7ff4d366001
E: MAJOR=259
E: MINOR=3
E: PARTN=14
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: UDISKS_IGNORE=1
E: USEC_INITIALIZED=4905915

# udevadm info -q all /sys/class/block/nvme0n1p15
P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/80c97e1e-15c4-4c6d-93d1-e38402047b8d/pci15c4:00/15c4:00:00.0/nvme/nvme0/nvme0n1/nvme0n1p15
N: nvme0n1p15
S: disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part15
S: disk/by-id/nvme-eui.577f8d0aff944fa3b6e5a7ff4d366001-part15
S: disk/by-id/wwn-eui.577f8d0aff944fa3b6e5a7ff4d366001-part15
S: disk/by-partlabel/EFI\x20System\x20Partition
S: disk/by-partuuid/e3c2f962-2cd1-4f50-942b-14e69ec6ca85
S: disk/by-path/acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1-part15
S: disk/by-uuid/D2F9-8D71
E: DEVLINKS=/dev/disk/by-path/acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1-part15 /dev/disk/by-uuid/D2F9-8D71 /dev/disk/by-id/wwn-eui.577f8d0aff944fa3b6e5a7ff4d366001-part15 /dev/disk/by-partlabel/EFI\x20System\x20Partition /dev/disk/by-id/nvme-eui.577f8d0aff944fa3b6e5a7ff4d366001-part15 /dev/disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part15 /dev/disk/by-partuuid/e3c2f962-2cd1-4f50-942b-14e69ec6ca85
E: DEVNAME=/dev/nvme0n1p15
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/80c97e1e-15c4-4c6d-93d1-e38402047b8d/pci15c4:00/15c4:00:00.0/nvme/nvme0/nvme0n1/nvme0n1p15
E: DEVTYPE=partition
E: ID_FS_TYPE=vfat
E: ID_FS_USAGE=filesystem
E: ID_FS_UUID=D2F9-8D71
E: ID_FS_UUID_ENC=D2F9-8D71
E: ID_FS_VERSION=FAT16
E: ID_MODEL=MSFT NVMe Accelerator v1.0
E: ID_PART_ENTRY_DISK=259:0
E: ID_PART_ENTRY_NAME=EFI\x20System\x20Partition
E: ID_PART_ENTRY_NUMBER=15
E: ID_PART_ENTRY_OFFSET=10240
E: ID_PART_ENTRY_SCHEME=gpt
E: ID_PART_ENTRY_SIZE=1013761
E: ID_PART_ENTRY_TYPE=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
E: ID_PART_ENTRY_UUID=e3c2f962-2cd1-4f50-942b-14e69ec6ca85
E: ID_PART_TABLE_TYPE=gpt
E: ID_PART_TABLE_UUID=28b3df8e-090e-47dc-8865-47ac2c596a5c
E: ID_PATH=acpi-VMBUS:00-pci-15c4:00:00.0-nvme-1
E: ID_PATH_TAG=acpi-VMBUS_00-pci-15c4_00_00_0-nvme-1
E: ID_SCSI=1
E: ID_SERIAL=MSFT NVMe Accelerator v1.0_SN: 000001
E: ID_SERIAL_SHORT=SN: 000001
E: ID_WWN=eui.577f8d0aff944fa3b6e5a7ff4d366001
E: ID_WWN_WITH_EXTENSION=eui.577f8d0aff944fa3b6e5a7ff4d366001
E: MAJOR=259
E: MINOR=4
E: PARTN=15
E: PARTNAME=EFI System Partition
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: UDISKS_IGNORE=1
E: USEC_INITIALIZED=4892775

VM2:

# udevadm info -q all /sys/class/block/nvme0n1
P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/29fb7be9-0227-4ed6-91bb-e03d510461de/pci0227:00/0227:00:00.0/nvme/nvme0/nvme0n1
M: nvme0n1
R: 1
U: block
T: disk
D: b 259:0
N: nvme0n1
L: 0
S: disk/by-diskseq/3
S: disk/by-id/nvme-eui.381e69dc168a4101b7c0f7db5a9b0001
S: disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001
S: disk/by-path/acpi-VMBUS:00-pci-0227:00:00.0-nvme-1
Q: 3
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/29fb7be9-0227-4ed6-91bb-e03d510461de/pci0227:00/0227:00:00.0/nvme/nvme0/nvme0n1
E: SUBSYSTEM=block
E: DEVNAME=/dev/nvme0n1
E: DEVTYPE=disk
E: DISKSEQ=3
E: MAJOR=259
E: MINOR=0
E: USEC_INITIALIZED=3955523
E: ID_SERIAL_SHORT=SN: 000001
E: ID_WWN=eui.381e69dc168a4101b7c0f7db5a9b0001
E: ID_MODEL=MSFT NVMe Accelerator v1.0
E: ID_REVISION=v1.00000
E: ID_SERIAL=MSFT_NVMe_Accelerator_v1.0_SN:_000001
E: ID_PATH=acpi-VMBUS:00-pci-0227:00:00.0-nvme-1
E: ID_PATH_TAG=acpi-VMBUS_00-pci-0227_00_00_0-nvme-1
E: ID_PART_TABLE_UUID=ea502af0-3a06-42ed-8ced-a9a3cbdeca9a
E: ID_PART_TABLE_TYPE=gpt
E: DEVLINKS=/dev/disk/by-diskseq/3 /dev/disk/by-id/nvme-eui.381e69dc168a4101b7c0f7db5a9b0001 /dev/disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:>
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

# udevadm info -q all /sys/class/block/nvme0n1p1
P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/29fb7be9-0227-4ed6-91bb-e03d510461de/pci0227:00/0227:00:00.0/nvme/nvme0/nvme0n1/nvme0n1>
M: nvme0n1p1
R: 1
U: block
T: partition
D: b 259:1
N: nvme0n1p1
L: 0
S: disk/by-id/nvme-eui.381e69dc168a4101b7c0f7db5a9b0001-part1
S: disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part1
S: disk/by-partuuid/3a85a75b-2534-435a-aa5c-13459c179463
S: disk/by-uuid/5ECB-01A9
S: disk/by-path/acpi-VMBUS:00-pci-0227:00:00.0-nvme-1-part1
S: disk/by-partlabel/EFI\x20System\x20Partition
Q: 3
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/29fb7be9-0227-4ed6-91bb-e03d510461de/pci0227:00/0227:00:00.0/nvme/nvme0/nvme0n1>
E: SUBSYSTEM=block
E: DEVNAME=/dev/nvme0n1p1
E: DEVTYPE=partition
E: DISKSEQ=3
E: PARTN=1
E: PARTNAME=EFI System Partition
E: MAJOR=259
E: MINOR=1
E: USEC_INITIALIZED=3978530
E: ID_SERIAL_SHORT=SN: 000001
E: ID_WWN=eui.381e69dc168a4101b7c0f7db5a9b0001
E: ID_MODEL=MSFT NVMe Accelerator v1.0
E: ID_REVISION=v1.00000
E: ID_SERIAL=MSFT_NVMe_Accelerator_v1.0_SN:_000001
E: ID_PATH=acpi-VMBUS:00-pci-0227:00:00.0-nvme-1
E: ID_PATH_TAG=acpi-VMBUS_00-pci-0227_00_00_0-nvme-1
E: ID_PART_TABLE_UUID=ea502af0-3a06-42ed-8ced-a9a3cbdeca9a
E: ID_PART_TABLE_TYPE=gpt
E: ID_FS_UUID=5ECB-01A9
E: ID_FS_UUID_ENC=5ECB-01A9
E: ID_FS_VERSION=FAT16
E: ID_FS_BLOCKSIZE=4096
E: ID_FS_TYPE=vfat
E: ID_FS_USAGE=filesystem
E: ID_PART_ENTRY_SCHEME=gpt
E: ID_PART_ENTRY_NAME=EFI\x20System\x20Partition
E: ID_PART_ENTRY_UUID=3a85a75b-2534-435a-aa5c-13459c179463
E: ID_PART_ENTRY_TYPE=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
E: ID_PART_ENTRY_NUMBER=1
E: ID_PART_ENTRY_OFFSET=2048
E: ID_PART_ENTRY_SIZE=409600
E: ID_PART_ENTRY_DISK=259:0
E: NVME_HOST_IFACE=none
E: UDISKS_IGNORE=1
E: DEVLINKS=/dev/disk/by-id/nvme-eui.381e69dc168a4101b7c0f7db5a9b0001-part1 /dev/disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part1 /de>
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

# udevadm info -q all /sys/class/block/nvme0n1p2
P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/29fb7be9-0227-4ed6-91bb-e03d510461de/pci0227:00/0227:00:00.0/nvme/nvme0/nvme0n1/nvme0n1>
M: nvme0n1p2
R: 2
U: block
T: partition
D: b 259:2
N: nvme0n1p2
L: 0
S: disk/by-uuid/a74140e5-2cc6-415e-a177-6037fba68c1c
S: disk/by-label/boot
S: disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part2
S: disk/by-partuuid/6b2706d8-7935-452e-bd93-3238fafe3d94
S: disk/by-path/acpi-VMBUS:00-pci-0227:00:00.0-nvme-1-part2
S: disk/by-id/nvme-eui.381e69dc168a4101b7c0f7db5a9b0001-part2
Q: 3
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/29fb7be9-0227-4ed6-91bb-e03d510461de/pci0227:00/0227:00:00.0/nvme/nvme0/nvme0n1>
E: SUBSYSTEM=block
E: DEVNAME=/dev/nvme0n1p2
E: DEVTYPE=partition
E: DISKSEQ=3
E: PARTN=2
E: MAJOR=259
E: MINOR=2
E: USEC_INITIALIZED=3974955
E: ID_SERIAL_SHORT=SN: 000001
E: ID_WWN=eui.381e69dc168a4101b7c0f7db5a9b0001
E: ID_MODEL=MSFT NVMe Accelerator v1.0
E: ID_REVISION=v1.00000
E: ID_SERIAL=MSFT_NVMe_Accelerator_v1.0_SN:_000001
E: ID_PATH=acpi-VMBUS:00-pci-0227:00:00.0-nvme-1
E: ID_PATH_TAG=acpi-VMBUS_00-pci-0227_00_00_0-nvme-1
E: ID_PART_TABLE_UUID=ea502af0-3a06-42ed-8ced-a9a3cbdeca9a
E: ID_PART_TABLE_TYPE=gpt
E: ID_FS_LABEL=boot
E: ID_FS_LABEL_ENC=boot
E: ID_FS_UUID=a74140e5-2cc6-415e-a177-6037fba68c1c
E: ID_FS_UUID_ENC=a74140e5-2cc6-415e-a177-6037fba68c1c
E: ID_FS_SIZE=519286784
E: ID_FS_LASTBLOCK=128000
E: ID_FS_BLOCKSIZE=4096
E: ID_FS_TYPE=xfs
E: ID_FS_USAGE=filesystem
E: ID_PART_ENTRY_SCHEME=gpt
E: ID_PART_ENTRY_UUID=6b2706d8-7935-452e-bd93-3238fafe3d94
E: ID_PART_ENTRY_TYPE=0fc63daf-8483-4772-8e79-3d69d8477de4
E: ID_PART_ENTRY_NUMBER=2
E: ID_PART_ENTRY_OFFSET=411648
E: ID_PART_ENTRY_SIZE=1024000
E: ID_PART_ENTRY_DISK=259:0
E: DEVLINKS=/dev/disk/by-uuid/a74140e5-2cc6-415e-a177-6037fba68c1c /dev/disk/by-label/boot /dev/disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_0>
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

# udevadm info -q all /sys/class/block/nvme0n1p3
P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/29fb7be9-0227-4ed6-91bb-e03d510461de/pci0227:00/0227:00:00.0/nvme/nvme0/nvme0n1/nvme0n1>
M: nvme0n1p3
R: 3
U: block
T: partition
D: b 259:3
N: nvme0n1p3
L: 0
S: disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part3
S: disk/by-partuuid/a2363165-fed3-4da5-8718-d34e4175141b
S: disk/by-id/nvme-eui.381e69dc168a4101b7c0f7db5a9b0001-part3
S: disk/by-path/acpi-VMBUS:00-pci-0227:00:00.0-nvme-1-part3
Q: 3
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/29fb7be9-0227-4ed6-91bb-e03d510461de/pci0227:00/0227:00:00.0/nvme/nvme0/nvme0n1>
E: SUBSYSTEM=block
E: DEVNAME=/dev/nvme0n1p3
E: DEVTYPE=partition
E: DISKSEQ=3
E: PARTN=3
E: MAJOR=259
E: MINOR=3
E: USEC_INITIALIZED=3970540
E: ID_SERIAL_SHORT=SN: 000001
E: ID_WWN=eui.381e69dc168a4101b7c0f7db5a9b0001
E: ID_MODEL=MSFT NVMe Accelerator v1.0
E: ID_REVISION=v1.00000
E: ID_SERIAL=MSFT_NVMe_Accelerator_v1.0_SN:_000001
E: ID_PATH=acpi-VMBUS:00-pci-0227:00:00.0-nvme-1
E: ID_PATH_TAG=acpi-VMBUS_00-pci-0227_00_00_0-nvme-1
E: ID_PART_TABLE_UUID=ea502af0-3a06-42ed-8ced-a9a3cbdeca9a
E: ID_PART_TABLE_TYPE=gpt
E: ID_PART_ENTRY_SCHEME=gpt
E: ID_PART_ENTRY_UUID=a2363165-fed3-4da5-8718-d34e4175141b
E: ID_PART_ENTRY_TYPE=21686148-6449-6e6f-744e-656564454649
E: ID_PART_ENTRY_NUMBER=3
E: ID_PART_ENTRY_OFFSET=1435648
E: ID_PART_ENTRY_SIZE=2048
E: ID_PART_ENTRY_DISK=259:0
E: UDISKS_IGNORE=1
E: DEVLINKS=/dev/disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part3 /dev/disk/by-partuuid/a2363165-fed3-4da5-8718-d34e4175141b /dev/dis>
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

# udevadm info -q all /sys/class/block/nvme0n1p4
P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/29fb7be9-0227-4ed6-91bb-e03d510461de/pci0227:00/0227:00:00.0/nvme/nvme0/nvme0n1/nvme0n1>
M: nvme0n1p4
R: 4
U: block
T: partition
D: b 259:4
N: nvme0n1p4
L: 0
S: disk/by-partuuid/213e673e-3af1-4952-9be3-485f239b5d64
S: disk/by-path/acpi-VMBUS:00-pci-0227:00:00.0-nvme-1-part4
S: disk/by-id/nvme-eui.381e69dc168a4101b7c0f7db5a9b0001-part4
S: disk/by-id/nvme-MSFT_NVMe_Accelerator_v1.0_SN:_000001-part4
S: disk/by-id/lvm-pv-uuid-o9WK5V-jX7C-bEfW-6XXe-dRbj-49Pw-bZzfy9
Q: 3
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/29fb7be9-0227-4ed6-91bb-e03d510461de/pci0227:00/0227:00:00.0/nvme/nvme0/nvme0n1>
E: SUBSYSTEM=block
E: DEVNAME=/dev/nvme0n1p4
E: DEVTYPE=partition
E: DISKSEQ=3
E: PARTN=4
E: MAJOR=259
E: MINOR=4
E: USEC_INITIALIZED=4052177
E: ID_SERIAL_SHORT=SN: 000001
E: ID_WWN=eui.381e69dc168a4101b7c0f7db5a9b0001
E: ID_MODEL=MSFT NVMe Accelerator v1.0
E: ID_REVISION=v1.00000
E: ID_SERIAL=MSFT_NVMe_Accelerator_v1.0_SN:_000001
E: ID_PATH=acpi-VMBUS:00-pci-0227:00:00.0-nvme-1
E: ID_PATH_TAG=acpi-VMBUS_00-pci-0227_00_00_0-nvme-1
E: ID_PART_TABLE_UUID=ea502af0-3a06-42ed-8ced-a9a3cbdeca9a
E: ID_PART_TABLE_TYPE=gpt
E: ID_FS_UUID=o9WK5V-jX7C-bEfW-6XXe-dRbj-49Pw-bZzfy9
E: ID_FS_UUID_ENC=o9WK5V-jX7C-bEfW-6XXe-dRbj-49Pw-bZzfy9
E: ID_FS_VERSION=LVM2 001
E: ID_FS_TYPE=LVM2_member
E: ID_FS_USAGE=raid
E: ID_PART_ENTRY_SCHEME=gpt
E: ID_PART_ENTRY_UUID=213e673e-3af1-4952-9be3-485f239b5d64
E: ID_PART_ENTRY_TYPE=e6d6d379-f507-44c2-a23c-238f2a3df928
E: ID_PART_ENTRY_NUMBER=4
E: ID_PART_ENTRY_OFFSET=1437696
E: ID_PART_ENTRY_SIZE=132777984
E: ID_PART_ENTRY_DISK=259:0
E: SYSTEMD_READY=1
E: LVM_VG_NAME_COMPLETE=rootvg
E: UDISKS_IGNORE=1
E: DEVLINKS=/dev/disk/by-partuuid/213e673e-3af1-4952-9be3-485f239b5d64 /dev/disk/by-path/acpi-VMBUS:00-pci-0227:00:00.0-nvme-1-part4 /dev/disk/b>
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

I do not see any similarities in device_ids across VMs. Outputs are slightly different across VMs since VM2 is RHEL 9 and VM1 is RHEL 8.

On similar note, does WALA needs to be updated too?

cc: @blackboxsw cc: @raharper

ani-sinha commented 1 year ago

You can add NVMe controllers using instructions in https://learn.microsoft.com/en-gb/azure/virtual-machines/enable-nvme-faqs#overview .

ani-sinha commented 1 year ago

Downstream RHEL ticket https://issues.redhat.com/browse/RHEL-7288 .

ani-sinha commented 1 year ago

This systemd patch is relevant https://github.com/systemd/systemd/pull/3136/commits/8a44b47bbbc07d5591d10148270818552e959901 .

Also this is the entire usev config from 60-persistent-storage.rules from systemd:

# NVMe
KERNEL=="nvme*[0-9]n*[0-9]", ATTR{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}"
KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}-part%n"

KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}"
KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{wwid}=="?*", ENV{ID_WWN}="$attr{wwid}"
KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{model}=="?*", ENV{ID_MODEL}="$attr{model}"
KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", \
  ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}"

KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}"
KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{model}=="?*", ENV{ID_MODEL}="$attr{model}"
KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", \
  ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}-part%n"

Not sure if the above will help as we also seem to need kernel support.

cjp256 commented 1 year ago

This is something I've been working on external to the cloud-init rules. I'm curious as you mention azure_root, what do you use it for?

ani-sinha commented 5 months ago

This is something I've been working on external to the cloud-init rules. I'm curious as you mention azure_root, what do you use it for?

It is used by /usr/lib/udev/rules.d/66-azure-ephemeral.rules

$ cat /usr/lib/udev/rules.d/66-azure-ephemeral.rules
# Azure specific rules
ACTION!="add|change", GOTO="cloud_init_end"
SUBSYSTEM!="block", GOTO="cloud_init_end"
ATTRS{ID_VENDOR}!="Msft", GOTO="cloud_init_end"
ATTRS{ID_MODEL}!="Virtual_Disk", GOTO="cloud_init_end"

# 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}="azure_root", GOTO="ci_azure_names"
ATTRS{device_id}=="?00000000-0001-*", ENV{fabric_name}="azure_resource", GOTO="ci_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"
# Do not create symlinks for scsi[1-3] or unmatched device_ids
ATTRS{device_id}=="{f8b3781b-1e82-4818-a1c3-63d806ec15bb}", ENV{fabric_scsi_controller}="scsi1", GOTO="cloud_init_end"
ATTRS{device_id}=="{f8b3781c-1e82-4818-a1c3-63d806ec15bb}", ENV{fabric_scsi_controller}="scsi2", GOTO="cloud_init_end"
ATTRS{device_id}=="{f8b3781d-1e82-4818-a1c3-63d806ec15bb}", ENV{fabric_scsi_controller}="scsi3", GOTO="cloud_init_end"
GOTO="cloud_init_end"

# Map scsi#/lun# fabric_name to azure_root|resource on Gen2 instances
LABEL="azure_datadisk"
ENV{DEVTYPE}=="partition", PROGRAM="/bin/sh -c 'readlink /sys/class/block/%k/../device|cut -d: -f4'", ENV{fabric_name}="$env{fabric_scsi_controller}/lun$result"
ENV{DEVTYPE}=="disk", PROGRAM="/bin/sh -c 'readlink /sys/class/block/%k/device|cut -d: -f4'", ENV{fabric_name}="$env{fabric_scsi_controller}/lun$result"

ENV{fabric_name}=="scsi0/lun0", ENV{fabric_name}="azure_root", GOTO="ci_azure_names"
ENV{fabric_name}=="scsi0/lun1", ENV{fabric_name}="azure_resource", GOTO="ci_azure_names"
GOTO="cloud_init_end"

# Create the symlinks
LABEL="ci_azure_names"
ENV{DEVTYPE}=="disk", SYMLINK+="disk/cloud/$env{fabric_name}"
ENV{DEVTYPE}=="partition", SYMLINK+="disk/cloud/$env{fabric_name}-part%n"

LABEL="cloud_init_end"
ani-sinha commented 5 months ago

@cjp256 ☝️