Proxmox Serial Number passthrough

Here’s a solution/work-around that works regardless of the hypervisor or hdd source.

  1. Create a file /etc/udev/rules.d/10-local.rules
  2. For each drive, add a line like so:
    DEVPATH==“/devices/vbd-51792/block/xvdf” ENV{ID_SERIAL}=“vbd-51792” ENV{ID_SERIAL_SHORT}=“vbd-51792”

suppose your device is /dev/xvdf, you can get the DEVPATH with this command udevadm info --name=xvdh. ID_SERIAL and ID_SERIAL_SHORT are something you can set to anything unique. Obviously, this assumes that /dev/xvdf doesn’t change name upon reboot. I think for testing purposes you should be fine with this. And if your hypervisor assures static device names, this method is no longer a work-around but a simple solution.

After creating the udev rules above, reload them with udevadm control --reload-rules. Then rescan your drives from the web-ui and see if that helps. If not, reboot and try again.

2 Likes