Virtualization

I’ve been tinkering with Proxmox VE for holding my Linux NAS and media file server (OpenMediaVault [OMV]) in addition to some other Linux containers.  As OMV would be the only VM to access some of these disks I scoured the web for how to add a physical disk to a VM (http://forum.proxmox.com/archive/index.php/t-6192.html).

The problem with using /dev/sdX to pass through is that oftentimes the hard drives will change their X value (sometimes my primary will be on /dev/sda and othertimes /dev/sdg).  I couldn’t find an easy way to point it to the disk itself rather than its symbolic link that didn’t involve messing with udev & udevadm in the Proxmox forums or documentation, but I did discover that you can point QM (in the vm.conf file such as 101.conf, 102.conf, etc.).

Basically, do this in the Proxmox Console or an SSH session:

ls -l /dev/disk/by-id
# Look for the hard drive disk (not the partitions which will be appended with part-1 and so forth).
#In my example I found scsi-SATA_ST5000VN000-1H4_Z111111
#Then go into your vm.conf file (i.e. nano /etc/pve/qemu-server/101.conf) and add it manually to the device type and number that you want to passthrough.
#Here is what you would add to have it on the 6th SCSI device (scsi5)
scsi5: /dev/disk/by-id/scsi-SATA_ST5000VN000-1H4_Z111111
#Save the file and you should now see the disk when you look at the VM in Proxmox.

Such an easy solution but it took me a few hours of messing with udev to figure out.