This section will discuss the configuration of network cards in the Hyper-V host.
Network Card Power Management
Disable any network adapter power management to ensure consistent performance, especially if using network-based storage such as iSCSI.
Settings are often specific to a vendor's network adapter. Use the documentation in Microsoft learn for the PowerShell cmdlet Disable-NetAdapterPowerManagement to see which options are available for disabling any power management settings present. Note that the use of this command could temporarily restart the network adapter and interrupt server connectivity. Below is an example execution that disables all power management features on a NIC named Ethernet 1.
Disable-NetAdapterPowerManagement -Name "Ethernet 1"
Single Root I/O Virtualization
Single Root I/O Virtualization (SR-IOV) is an extension of the PCI Express (PCIe) specification that allows a device, including network adapters, to separate access to its resources among various hardware functions and differentiate between different traffic streams. It allows traffic streams to be delivered directly to the Hyper-V or VM layers separately. It enables networking traffic to bypass the software-defined virtual networking switch layer of Hyper-V and directly into the guest OS to provide for bare-metal networking stack performance. Physical server firmware, physical NIC, and network drivers must all support enabling SR-IOV.
SR-IOV must be enabled in UEFI/BIOS. To check that this has been set, issue the following PowerShell command on each Hyper-V host:
(Get-VMHost).IovSupport
This should return a value of True if it is available and False if it is not or just not enabled.
Enabling SR-IOV on a NIC can be done via PowerShell. An example is shown below.
Enable-NetAdapterSriov -Name "Ethernet 1"
Figure 3 also shows it enabled in the driver for a NIC.
Figure 3. SR-IOV enabled on a NIC
To enable SR-IOV on the Hyper-V vSwitch, open the Virtual Switch Manager. Select or create the virtual switch, and next to the External network connection type, select “Enable single-root I/O virtualization (SR-IOV)”, as shown in Figure 4.
Figure 4. Single-Root I/O Virtualization in Hyper-V Manager
Alternatively, use PowerShell to enable SR-IOV when creating a new virtual switch. An example is shown below.
New-VMSwitch <virtual-switch-name> -NetAdapterName <network-adapter-name> -EnableIov $true
Finally, Figure 5 shows enabling SR-IOV on a VM's vNIC.
Figure 5. Single-Root I/O Virtualization for a vNIC in Hyper-V Manager
Remote Direct Memory Access
The use of Remote Direct Memory Access, or RDMA, is highly encouraged for high-speed interconnects between Hyper-V hosts for functionality such as Live Migration. RDMA requires both RDMA-enabled NICs and switches that support RDMA to exchange data in main memory without requiring the CPU or operating system to act as an intermediary. RDMA-enabled server adapters boost performance because it reduces the overhead of resource consumption (mainly CPU) and increases network throughput rates and lower latency.
RDMA is currently not supported between a Hyper-V host and a FlashArray. Therefore, RDMA cannot be used for storage communication.
Receive Side Scaling
Receive Side Scaling (RSS) enables NICs to provide more consistent resource consumption across multiple CPUs on multiprocessor platforms. By default, Windows Server usually picks a single CPU to process network traffic handling on. With RSS enabled, Windows Server will more widely distribute the I/O data across more than one deferred procedure call (DPC) for more concurrent traffic handling.
To enable RSS for all physical adapters in the Hyper-V host, the following script can be used. First, RSS is enabled for use globally, then enabled per physical network adapter.
Command Line example enabling RSS globally.
netsh interface tcp set global rss=enabled
Using PowerShell to enable RSS on each adapter.
foreach($NIC in (Get-NetAdapter -Physical)) {
Enable-NetAdapterRSS -name $NIC.name
}
Figure 6 shows RSS enabled on a NIC.
Figure 6. RSS enabled
Virtual Machine Queue
Virtual Machine Queue (VMQ) can be enabled on the physical NICs on the Hyper-V host. VMQ is a network adapter offload technology that can extend Native RSS to the Hyper-V layer. The goal is to allow for Hyper-V to manage the network traffic processing queues in the host hypervisor layer and both reduce host CPU consumption and improve guest network throughput by spreading out the CPU load across multiple host processors and by using direct memory access to transfer network packets directly into a VM’s shared memory. This feature must be supported by the physical network adapter, and once enabled at the host as shown in Figure 7, can be enabled per vNIC.
Figure 7. VMQ enabled on a NIC
RSS cannot be enabled on network adapters where SR-IOV or VMQ is enabled.
NIC Teaming
Microsoft has natively supported NIC teaming, or the ability to combine multiple NICs as a single NIC, since Windows Server 2012. Prior to that, teaming was achieved with proprietary software and did not always work well with features like a WSFC. Teaming can enhance both performance and availability depending on the configuration if employed. To understand the teaming in Windows Server, reference Windows Supported Networking Scenarios at Microsoft Learn.
There are two types of teaming:
● Switch independent – This type is independent of the network switch.
● Switch dependent – This type requires a network switch configuration. Link Aggregation Control Protocol (LACP) is a core aspect of switch dependent. This means LACP must be configured on the physical switch. Consult the switch vendor’s documentation for information on how to achieve this task.
For Windows Server 2016 and above, Switch Embedded Teaming (SET) is recommended to be enabled for Hyper-V hosts. SET was introduced with Windows Server and System Center Virtual Machine Manager (SCVMM) 2016 as a new method to simplify the teaming of multiple network adapters. SET is managed at the Hyper-V switch level and not at a network team level. Physical NIC teaming is no longer required to allow more concurrent traffic across multiple network adapters. SET is specifically integrated with Packet Direct, Converged RDMA vNICs, and software defined networking (SDN) quality of service (QoS) configurations. SET can be enabled within SCVMM by configuring a logical switch with an embedded team uplink mode.
Examples of enabling SET using PowerShell on vSwitch are below. Change the names of your network adapters to match your hardware.
New Switch
New-VMSwitch -Name "VMSETSwitch" -NetAdapterName "Ethernet 3", "Ethernet 4" -EnableEmbeddedTeaming $true
Existing Switch
Get-VMSwitch | FL Name, EmbeddedTeamingEnabled, NetAdapterInterfaceDescriptions, SwitchType
For more information on SDN, refer to the article Software Defined Networking (SDN) in Azure Stack HCI and Windows Server in Microsoft Learn.
For more on NIC teaming and iSCSI, see the upcoming section iSCSI Configuration Best Practices.