Disk Passthrough in Proxmox

Configuring disk passthrough in proxmox by disk-id

Introduction

In the given case where a vm requires direct access to the disk -- such as when one's about to monitor disk stats from inside the vm or just to take the most out of it -- it's a must to pass the disk device directly to the guest instead of creating a virtual disk over it.

Find disk id

Looking for the disk id

root@atlas:~# ls -n /dev/disk/by-id/ | grep sdc
lrwxrwxrwx 1 0 0  9 Aug 13 20:23 ata-ST4000VN006-3CW104_ZW6114RK -> ../../sdc
lrwxrwxrwx 1 0 0 10 Aug 13 20:23 ata-ST4000VN006-3CW104_ZW6114RK-part1 -> ../../sdc1
lrwxrwxrwx 1 0 0 10 Aug 13 20:23 ata-ST4000VN006-3CW104_ZW6114RK-part2 -> ../../sdc2


  • ata-ST4000VN006-3CW104_ZW6114RK

Add disk to vm

It can be added as scsi, virtio or sata

root@atlas:~# qm set 201 -sata2 /dev/disk/by-id/ata-ST4000VN006-3CW104_ZW6114RK
update VM 201: -sata2 /dev/disk/by-id/ata-ST4000VN006-3CW104_ZW6114RK


qm set <VM-ID> -<sataN|virtioN|scsiN> /dev/disk/by-id/<disk-id>