Enable SR-IOV support for Hyper-V virtual machines.

SR-IOV (Single Root Input/Output Virtualization) is a host hardware device virtualization technology that allows virtual machines to have direct access to devices. The technology allows you to virtualize various types of devices, but is most often used to virtualize network adapters. In this article, we'll show you how to properly enable and configure SR-IOV for virtual machine network adapters on a Hyper-V server.

SRV-IOV has been supported in Hyper-V since version 2012, including the free Hyper-V Server. We will not dive into the theory of SR-IOV, you can find a detailed description of the technology on the net. For a practical understanding, it is enough to know that SR-IOV allows you to provide access to virtual machines directly to the host's physical network adapters, bypassing traffic processing by Hyper-V virtual switches. One physical network adapter in SR-IOV mode can serve multiple virtual machines.

By using SR-IOV for Hyper-V virtual machines, you will significantly increase throughput , reduce network latency , and reduce the CPU load caused by the need to process network traffic with Hyper-V software tools.

SR-IOV is not compatible with NIC teaming.
For SRV-IOV to work on your Hyper-V host, a number of conditions must be met.

The first step is to enable SR-IOV and virtualization support in your server's BIOS. Depending on the vendor and server model, these settings may differ.

  • Virtualization: Intel (Virtualization Technology, Intel VT, VT-d, Vanderpool), AMD (SVM, AMD-V)
  • IOMMU
  • SR-IOV
  • ASPM

Some points may not be, even the SR-IOV point. But this does not mean that SR-IOV is not supported by the server. For example, Supermicro motherboards may not have an SR-IOV entry, but have an ASPM entry disabled by default. If you enable ASPM and virtualization support, then SR-IOV will be enabled automatically.

Please note that if the host OS is installed with SR-IOV disabled in the BIOS, then after enabling it, for the operating system it looks like replacing the network adapter (with resetting the current static IP address).
You can check if SR-IOV technology is supported by your Hyper-V server at the hardware level using PowerShell:

(get-vmhost).IovSupport
(get-vmhost).IovSupportReasons

If your server supports this feature, then the IovSupport field will be set to True. If not supported, then False. In this case, the IovSupportReasons item will contain a description of the reason why SR-IOV is not supported. The reason is usually stated in some detail. Here are the typical reasons:

  • Ensure that the system has chipset support for SR-IOV and that I/O virtualization is enabled in the BIOS.
  • To use SR-IOV on this system, the system BIOS must be updated to allow Windows to control PCI Express. Contact your system manufacturer for an update.
  • To use SR-IOV on this computer, the BIOS must be updated because it contains incorrect information describing the hardware capabilities. Contact your computer manufacturer for an update.
  • SR-IOV cannot be used on this computer because the processor does not support second-level address translation (SLAT). For Intel processors, this feature might be referred to as Extended Page Tables (EPT). For AMD processors, this feature might be referred to as Rapid Virtualization Indexing (RVI) or Nested Page Tables (NPT).
  • The chipset on the system does not do interrupt remapping, without which SR-IOV cannot be supported.
  • The chipset on the system does not do DMA remapping, without which SR-IOV cannot be supported.
  • SR-IOV cannot be used on this system as it has been configured to disable the use of I/O remapping hardware.
  • SR-IOV cannot be used on this system as it is reporting that there is no PCI Express Bus. Contact your system manufacturer for further information.
  • SR-IOV cannot be used on this system as the PCI Express hardware does not support Access Control Services (ACS) at any root port. Contact your system vendor for further information.

The full output of the command get-vmswitch | fl *iov* provides a number of useful information. For example:

IovVirtualFunctionCount : 6
IovVirtualFunctionsInUse : 3

Such numbers will immediately show how many virtual IOV devices are available and how many have already been used by virtual machines.

When creating a Hyper-V virtual switch, you need to check the SR-IOV support checkbox - Enable single-root I / O virtualization (SR-IOV) .


Or enable the EnableIOV option when creating the switch from the PowerShell command line:

New-VMSwitch -Name "Ext_network" -NetAdapterName "Ethernet 2" -EnableIov 1

Important. You cannot enable SR-IOV support after creating a virtual switch. If you didn't do it right away, you'll have to delete it and recreate it.

Moreover, the presence of SR-IOV support on the hypervisor host itself does not mean at all that it will work on a specific virtual switch. It is necessary that this switch be tied to a network adapter with SR-IOV support.

There is one more nuance. There may be multiple NICs on a motherboard, but SR-IOV may only be supported on a subset of them. Moreover, the support of SR-IOV by the adapter itself according to the datasheet does not mean at all that it works on this particular motherboard!

Therefore, after assembling the switch, check it with the command:

get-vmswitch | select IovSupport, IovSupportReasons, IovEnabled
The IovEnabled parameter indicates whether it is enabled. The list of network adapters with SR-IOV support can be displayed using PowerShell:
Get-NetAdapterSriov | sort name | ft Name, InterfaceDescription, SriovSupport
Once SR-IOV is enabled at the hypervisor and virtual switch levels, it can now be enabled in virtual machines (disabled by default). The Enable SR-IOV option is available in the Hardware Acceleration section of the virtual machine's network card.

Alternatively, you can enable SR-IOV for the VM network adapter via PowerShell:

Set-VMNetworkAdapter -VMName testvm -VMNetworkAdapterName “Network Adapter” -IovWeight 100

To disable SR-IOV, change the IovWeight value to 0.

Errors during SR-IOV operation are written on Hyper-V to a separate log in the Event Viewer:

Application and Services Logs -> Microsoft -> Windows -> Hyper-V-SynthNic -> Admin.

If SR-IOV is working properly, then when the virtual machine starts, the following entries will be in the log:

12597 Network adapter (%NIC_ID%) Connected to virtual network.
12582 Network adapter (%NIC_ID%) started successfully.
12584 Network adapter (%NIC_ID%) allocated a virtual function.
12588 Network adapter (%NIC_ID%) assigned a virtual function.
SR-IOV technology gives a good boost to the network performance of virtual machines and the hypervisor as a whole. You will notice the maximum results from using SR-IOV on Hyper-V hosts with high virtual machine traffic, which causes a heavy load on the host CPUs.

Отправить комментарий

Добавлять новые комментарии запрещено.*

Новые Старые