Sata HDD Passthrough to VM - gorect/Proxmox GitHub Wiki
In the event that you want to pass an entire disk through to a vm instead of creating a virtual hard disk you will need to know the following.
Run the following command in the Proxmox Node's shell (either through the web gui or by ssh'ing into the host)
ls /dev/disk/by-id/
This will out put the hard drive's Hardware ID. This is important as using /dev/sd* will work but is not fault tolerant in the event that a disk gets moved or otherwise reassigned.
The output will look something like this:
root@pve:~# ls /dev/disk/by-id/
ata-Samsung_SSD_860_EVO_250GB_S3Y9NX0M509446L
ata-Samsung_SSD_860_EVO_250GB_S3Y9NX0M509446L-part1
ata-Samsung_SSD_860_EVO_250GB_S3Y9NX0M509446L-part2
ata-Samsung_SSD_860_EVO_250GB_S3Y9NX0M509446L-part3
ata-WDC_WD20EARX-00ZUDB0_WD-WMC1H0037415
ata-WDC_WD20EARX-00ZUDB0_WD-WMC1H0037415-part1
ata-WDC_WD20EARX-00ZUDB0_WD-WMC1H0037415-part2
So what you will want to grab from this is the main drive's ID and not the IDs of any of the partitions. ex. ata-WDC_WD20EARX-00ZUDB0_WD-WMC1H0037415
You can check that the ID matches the disk that you want to use by checking these IDs against what is found in Node > Disks > Model and Serial
Now that we know the Hardware ID You just need the Proxmox VM's ID (100, 111, 300, etc)
and use it in the following terminal command:
qm set VM-ID -virtio2 /dev/disk/by-id/DISK-ID
replace VM-ID with the number of the VM and DISK-ID with the disk ID. In my case I will end up with ‘qm set 100 -virtio2 /dev/disk/by-id/ata-WDC_WD20EARX-00ZUDB0_WD-WMC1H0037415‘.
After doing this you should be able to see the disk in the Hardware tab for your VM.