When starting a Juniper vMX router you may get a warning from the vMX.sh
script that shows that the IOMMU status is disabled. It will look like this:
Intel IOMMU status................................[Disabled] Warning! IOMMU disabled. Pl enable in /boot/grub/grub.cfg
This seems to occur if the host OS is CentOS – the shell script to detect the IOMMU does not validate this correctly for CentOS hosts.
To verify that IOMMU is indeed enabled use the virt-host-validate
command:
QEMU: Checking for device assignment IOMMU support : PASS QEMU: Checking if IOMMU is enabled by kernel : PASS
This warning can be ignored if the IOMMU status passes. If the IOMMU status does not pass, you will need to enable IOMMU. I have included the instructions to do this for CentOS and Ubuntu KVM hosts below.
Enable IOMMU – CentOS
- Edit the file
/etc/default/grub
. - Look for the
GRUB_CMDLINE_LINUX
variable. In my case the line looked like this by default:
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos_netvirt1/root rd.lvm.lv=centos_netvirt1/swap rhgb quiet"
- Add the
intel_iommu=on
option to the end of thatGRUB_CMDLINE_LINUX
variable. In my case I also have huge pages enabled due to the amount of RAM for the vFP, so the modified line looks like this:
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos_netvirt1/root rd.lvm.lv=centos_netvirt1/swap rhgb quiet default_hugepagesz=1G hugepagesz=1G hugepages=64 processor.max_cstates=1 idle=poll pcie_aspm=off intel_iommu=on"
- Save the updated configuration file.
- Generate the new Grub configuration with
grub2-mkconfig
:
grub2-mkconfig -o /boot/grub2/grub.cfg
- Reboot the host to apply the changes.
Note: The pcie_aspm
and processor.max_cstates
settings are not required but they are recommended by Juniper for best performance. The intel_iommu setting is required for SR-IOV support.
Enable IOMMU – Ubuntu
- Edit the file
/etc/default/grub
. - Look for the two
GRUB_CMDLINE_LINUX
lines that look like this by default:
GRUB_CMDLINE_LINUX_DEFAULT="" GRUB_CMDLINE_LINUX=""
- Add the
intel_iommu=on
option to the end of theGRUB_CMDLINE_LINUX_DEFAULT
variable. In my case I also have huge pages enabled due to the amount of RAM for the vFP, so the modified lines look like this:
GRUB_CMDLINE_LINUX_DEFAULT="processor.max_cstates=1 idle=poll pcie_aspm=off intel_iommu=on" GRUB_CMDLINE_LINUX="default_hugepagesz=1G hugepagesz=1G hugepages=64"
- Save the updated configuration file.
- Generate the new grub configuration file:
update-grub
- Reboot the host to apply the changes.
Note: The pcie_aspm
and processor.max_cstates
settings are not required but they are recommended by Juniper for best performance. The intel_iommu setting is required for SR-IOV support.