Passthrough a HDD without iommu

lxiosjao

Member
Mar 21, 2021
63
1
13
Hi,

I have a question about iommu.

When I do things like :
Code:
qm set 107 -scsi0 /dev/disk/by-id/ata-Western.......


Why is it possible to passthrough this sata hdd to the vm without enabling IOMMU ?
Whats the difference between passthrough a hdd and passthrough an entire controler ?
Am I supposed to enable IOMMU to passthrough a HDD to a VM ?
And add this in /etc/modules :
Code:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd


Thanks for the help
 
Last edited:
Why is it possible to passthrough this sata hdd to the vm without enabling IOMMU ?
Whats the difference between passthrough a hdd and passthrough an entire controler ?
Am I supposed to enable IOMMU to passthrough a HDD to a VM ?
It is possible because you are not passing through a PCI(e) device, such as a SATA controller. If you passthrough a controller, then all drives connected to it are also removed from the host because the controller is moved to the VM, and hopefully the VM will see those connected drives.
The difference is that you do not passthrough a device, it only provides the VM access to a block storage area, like a (whole) disk drive or just a partition of a drive. This is also the reason you won't see any SMART information in the VM or the serial number of the HDD and it will show as a QEMU HARDDISK.
PCI(e) passthrough and disk passthrough are entirely separate concepts (although they sound similar). You do not need to enable IOMMU to passthrough a single disk or partition. You do need IOMMU to passthrough entire PCI(e) devices, like GPUs and USB, network and SATA controllers
 
  • Like
Reactions: lxiosjao
Thanks for your answer.
So we can admit that it's not a "real passthrough" when the command : "qm set 107 -scsi0 /dev/disk/by-id/ata-Western" is used ?
- What about performance ? (pci passthrough vs provide a disk access to a vm)
- Can I backup the whole disk I provide to the vm from the GUI in the option ?
 
Thanks for your answer.
So we can admit that it's not a "real passthrough" when the command : "qm set 107 -scsi0 /dev/disk/by-id/ata-Western" is used ?
That is basically like using a virtual disk, so it is still virtualized by KVM/virtio, but instead of storing the virtual disk on a LV/Zvol it will store the blockdata directly on that physical disk/partition.
So using PCI passthrough should be faster because the VM can directly and physically access the drives without any virtualization in between so there should be no overhead at all. But atleast with virtio SCSI the overhead should be quite low so "qm set" passthrough should be fine in most cases.
 
Last edited:
  • Like
Reactions: lxiosjao

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!