Virtual machines lose network after a host change
The virtual switch a machine expects does not exist on the host it is now running on, or the switch has lost its uplink.
What you see
A virtual machine has no network after a migration or a host rebuild. The virtual switch name in its settings is marked as configuration error.
What is actually wrong
Switch names must match exactly across every host in a cluster, including case and spacing. Beyond that, a SET team that has lost a member, or a VLAN not trunked to the new host's port.
Codes and articles
Fixes (2)
Make the switch names match across every host
Machines lose network on one host only.
Compare the switch names across every host in the cluster.
Get-ClusterNode | ForEach-Object { $n = $_.Name Get-VMSwitch -ComputerName $n | Select-Object @{n='Host';e={$n}},Name,SwitchType,NetAdapterInterfaceDescription} | Format-Table -AutoSize
A trailing space or a different capitalisation is enough. The comparison across all hosts in one command is the quickest way to see it, and it is almost always a typo made when a host was added.
Rename the switch on the odd host to match the others exactly.
Rename-VMSwitch -Name 'vSwitch-Prod ' -NewName 'vSwitch-Prod' -ComputerName HV03Reconnect any virtual machine whose adapter shows a configuration error.
Get-VM | Get-VMNetworkAdapter | Where-Object Status -ne 'Ok' | Format-Table VMName,Name,SwitchName,StatusGet-VM VM01 | Get-VMNetworkAdapter | Connect-VMNetworkAdapter -SwitchName 'vSwitch-Prod'
Check the VLAN assignment came across with the machine.
Get-VM | Get-VMNetworkAdapterVlan | Format-Table VMName,OperationMode,AccessVlanIdConfirm the physical switch port for the new host trunks the same VLANs as the others.
Get-VM | Get-VMNetworkAdapter | Format-Table VMName,SwitchName,Status,IPAddresses -AutoSizeRestore the switch's uplink
Everything on one host has lost connectivity.
Check the switch and its team members.
Get-VMSwitch | Format-List Name,SwitchType,NetAdapterInterfaceDescription,EmbeddedTeamingEnabledGet-VMSwitchTeam | Format-List Name,NetAdapterInterfaceDescription,TeamingMode,LoadBalancingAlgorithm
Check each physical member is up.
Get-NetAdapter | Format-Table Name,Status,LinkSpeed,InterfaceDescriptionGet-VMSwitchTeam | Select-Object -ExpandProperty NetAdapterInterfaceDescription
A SET team with one member down keeps working and gives no obvious sign. With the last member down the switch stays present and every virtual machine loses its network, which reads as a Hyper-V fault rather than a cable.
Re-add a member that has dropped out.
Add-VMSwitchTeamMember -VMSwitchName 'vSwitch-Prod' -NetAdapterName 'Ethernet 2'Check the management operating system's own adapter on that switch if the host itself has also lost connectivity.
Get-VMNetworkAdapter -ManagementOS | Format-Table Name,SwitchName,MacAddress,StatusGet-NetIPConfiguration -Detailed | Format-List InterfaceAlias,IPv4Address,IPv4DefaultGateway
Verify the physical switch ports are configured identically for every member of the team — a mismatch produces intermittent loss rather than a clean failure.
Get-VMSwitchTeam | Format-List Name,NetAdapterInterfaceDescriptionGet-VM | Get-VMNetworkAdapter | Format-Table VMName,Status,IPAddresses
Related faults
Where this stops. This write-up was written and checked by hand. It says what each step changes, how to confirm it worked and how to reverse it, and anything destructive is flagged before you reach it. If it does not match what your machine is doing, search the Support Centre for the exact code or message — and when something needs a person, get in touch.