So I had a little adventure at work today and I am sure this is going to come up again. Imagine that you have an AWS instance with more than one EBS volume attached. On modern instance types, the EBS volumes appear as NVMe device files, but the naming of the device files is not stable — it depends on what PCI device is detected by the kernel first etc.
It turns out that providing stable names for the device files is a solved problem though! Specifically, CoreOS has udev rules which use a short script to lookup the EC2 EBS device name from the vendor-specific portion of the NVMe id-ctrl data, and provide an appropriate symlink.
This saved me a fair bit of mucking around providing stable UUIDs for EBS volume templates, because we can instead just set the device name in the launch template and then have udev enforce that device name on boot. So that’s nice.
There is of course no real equivalent for OpenStack, as OpenStack generally uses qemu virtual disks not fake NVMe disks. I should think about that some more sometime. For what its worth, GCE uses the device serial number it seems based on these udev rules and libvirt does allow us to set custom device serial numbers, so that might be an option?