VPort creation failed with Hyper-V 2022 with VMQ
VPort creation failed with Hyper-V 2022 with VMQ
I setup Windows 2022 Server and enabled the Hyper-V role. All been working good. I recently decided to take things to the next level so to speak. Have a combination of Windows 7, Windows 10/11, Windows 2022 server, and various Linux virtuals.
My Intel SFP+ 10Gb NIC is a dual nic so enabled the second port on the NIC and used SET to set that up.
This was basically my setup with some things that may be redundant as I changed as I went. Like think using set-netadapterrss is the same as Set-NetAdapterVMQ in it's results? Anyway, below is what I did in general to set this up with the expectation I wanted to use SR-IOV and also where I can't VMQ.
Note I'm running on a Ryzen 7950x with 16 cores with hyperthreading enabled.
Steps to setup:
Rename-NetAdapter "Ethernet 4" 10GNIC1
Rename-NetAdapter "Ethernet 3" 10GNIC2
#think these get overridden later
set-netadapterrss -name 10GNIC1 -BaseProcessorNumber 2 -MaxProcessorNumber 31
set-netadapterrss -name 10GNIC2 -BaseProcessorNumber 2 -MaxProcessorNumber 31
Enable-NetAdapterSriov "10GNIC1","10GNIC2"
Set-NetAdapterAdvancedProperty -Name 10GNIC1 -RegistryKeyword VlanID -RegistryValue "0"
Set-NetAdapterAdvancedProperty -Name 10GNIC2 -RegistryKeyword VlanID -RegistryValue "0"
get the 10gb NICs
$LOMNICs = Get-NetAdapter -Name 10GNIC -physical
create vSwitch
$SetSwitch = New-VMSwitch -Name 'Hyper-V Switch' -AllowManagementOS $true -EnableIov $true -EnableEmbeddedTeaming $true -NetAdapterName $LOMNICs.name
Grab management vNIC, assign details
$MasterAdapter = Get-NetAdapter -Name "vEthernet ($($SetSwitch.name))"
$MasterAdapter | New-NetIPAddress -IPAddress ###.##.##.## -PrefixLength 24 -DefaultGateway ###.##.##.##
$MasterAdapter | Set-DnsClientServerAddress -ServerAddresses ###.##.##.##,###.##.##.##
$MasterAdapter | Set-DnsClient -ConnectionSpecificSuffix <domain>.local -RegisterThisConnectionsAddress $true -UseSuffixWhenRegistering $true
Get-NetIPAddress -InterfaceAlias "vEthernet ($($SetSwitch.name))" | ft IPAddress
assign global DNS
Set-DnsClientGlobalSetting -SuffixSearchList <domain>.local
Set-VMSwitchTeam -Name "Hyper-V Switch" -LoadBalancingAlgorithm Dynamic
set-netadapterrss -name "vEthernet ($($SetSwitch.name))" -BaseProcessorNumber 2 -MaxProcessorNumber 31
See switch settings
Restart nics:
Restart-NetAdapter 10GNIC2
Restart-NetAdapter 10GNIC1
Set-NetAdapterVMQ -Name 10GNIC1 -BaseProcessorNumber 2 -MaxProcessors 8
Set-NetAdapterVMQ -Name 10GNIC2 -BaseProcessorNumber 9 -MaxProcessors 8
When I try setting up a device with SR-IOV that works and install the virtual driver on the VM. When I try setting VMQ instead in the NIC I get:
Failed to allocate VMQ for NIC. Bla bla bla. Reason - VPort creation failed. Status = An invalid parameter was passed to a service or function.
In the host event logs. The NIC just shows a status of OK. Note the first virtual I fired up after doing this had VMQ enabled already in the settings and did show OK and that VMQ was on. Other than that which I have since changed to use SR-IOV give the above error. I have some output from powershell command but don't want to overload this first post to much. Woops to late.
Thoughts?
Thanks.
JR