Is onboard SATA controller passthrough safe/stable to use?

apoorv569

Member
Sep 3, 2022
3
0
6
I wanna create a VM for my new TrueNAS server and I decided to passthrough the onboard SATA controller to the VM. I have 4 SATA ports on the onboard SATA controller and I have a 2 port PCI SATA expansion card, which I have connected an SSD to, for installing Proxmox.

The ids I'm using here are not real, just an example.

I edited /etc/default/grub and added,
Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt vfio-pci.ids=1234:5678,4321:8765"

Then, I added these modules to /etc/modules
Code:
vfio
vfio_iommu_type1
vfio_pci

Then, I added this to /etc/modprobe.d/iommu_unsafe_interrupts.conf
Code:
options vfio_iommu_type1 allow_unsafe_interrupts=1

Then, I added this to /etc/modprobe.d/vfio.conf
Code:
options vfio-pci ids=1234:5678,4321:8765

Finally I update the GRUB configuration and initramfs
Code:
update-grub
update-initramfs -u -k all

and rebooted. I could not blacklist the ahci driver as the PCI expansion card also uses that.

After rebooting, the onboard SATA controller was still using ahci driver and I could still see the drives in Proxmox. However, I noticed, when the TrueNAS VM is started, it shows its using vfio-pci driver, but when its not started it uses the ahci driver. So I search online and found that I could add a softdep, so I added this to /etc/modprobe.d/ahci.conf
Code:
softdep ahci pre: vfio-pci

Then, I rebuilt the initramfs and rebooted again and now I have the vfio-pci driver loaded for the onboard SATA controller from boot, so Proxmox could not see the drives anymore from startup, which is good I think, as I have heard Proxmox taking over the ZFS pool, corrupting the data, for people who have similar setup where they virtualize TrueNAS.

So my question here is, is this passthrough thing safe/stable to use? Could it break on any future updates to Proxmox or something else, where its not able to passthrough any more and Proxmox takes over the pool or something?
 

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!