Appendix G: Configuring a Host for PCI Passthrough
Enabling PCI passthrough allows a virtual machine to use a host device as if the device were directly attached to the virtual machine. To enable the PCI passthrough function, you need to enable virtualization extensions and the IOMMU function. The following procedure requires you to reboot the host. If the host is attached to the Engine already, ensure you place the host into maintenance mode before running the following procedure.
- Ensure that the host hardware meets the requirements for PCI device passthrough and assignment. See Chapter 2: System Requirements for more information.
Configuring a Host for PCI Passthrough
Enable the virtualization extension and IOMMU extension in the BIOS.
Enable the IOMMU flag in the kernel by selecting the Hostdev Passthrough & SR-IOV check box when adding the host to the Manager or by editing the
grubconfiguration file manually.
To enable the IOMMU flag from the Administration Portal, see "Adding a Host to the oVirt Engine" and "Kernel Settings Explained" in the Administration Guide.
To edit the
grubconfiguration file manually, see Enabling IOMMU Manually below.
For GPU passthrough, you need to run additional configuration steps on both the host and the guest system. See "Preparing Host and Guest Systems for GPU Passthrough" in the Administration Guide for more information.
Enabling IOMMU Manually
Enable IOMMU by editing the grub configuration file.
Note: If you are using IBM POWER8 hardware, skip this step as IOMMU is enabled by default.
For Intel, boot the machine, and append
intel_iommu=onto the end of the
GRUB_CMDLINE_LINUXline in the
# vi /etc/default/grub ... GRUB_CMDLINE_LINUX="nofb splash=quiet console=tty0 ... intel_iommu=on ...
For AMD, boot the machine, and append
amd_iommu=onto the end of the
GRUB_CMDLINE_LINUXline in the
# vi /etc/default/grub ... GRUB_CMDLINE_LINUX="nofb splash=quiet console=tty0 ... amd_iommu=on ...
amd_iommu=onworks, you can try replacing them with
ptoption only enables IOMMU for devices used in passthrough and will provide better host performance. However, the option may not be supported on all hardware. Revert to previous option if the
ptoption doesn't work for your host.
If the passthrough fails because the hardware does not support interrupt remapping, you can consider enabling the
allow_unsafe_interruptsoption if the virtual machines are trusted. The
allow_unsafe_interruptsis not enabled by default because enabling it potentially exposes the host to MSI attacks from virtual machines. To enable the option:
# vi /etc/modprobe.d options vfio_iommu_type1 allow_unsafe_interrupts=1
grub.cfgfile and reboot the host for these changes to take effect:
# grub2-mkconfig -o /boot/grub2/grub.cfg # reboot
Prev: Appendix F: Installing the Websocket Proxy on a Separate Machine Next: Appendix H: Preparing a Host for vGPU Installation
Adapted from RHV 4.2 documentation - CC-BY-SA