Windows Server  ·  high  ·  Failover clustering & Hyper-V

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

Event 12610Event 26130failed to allocatevirtual switch missingSET teamCannot connect virtual machine

Fixes (2)

Make the switch names match across every host
Elevated PowerShell40 minutesmedium riskreversible

Machines lose network on one host only.

  1. Compare the switch names across every host in the cluster.

    PowerShell
    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.

  2. Rename the switch on the odd host to match the others exactly.

    PowerShell
    Rename-VMSwitch -Name 'vSwitch-Prod ' -NewName 'vSwitch-Prod' -ComputerName HV03
  3. Reconnect any virtual machine whose adapter shows a configuration error.

    PowerShell
    Get-VM | Get-VMNetworkAdapter | Where-Object Status -ne 'Ok' | Format-Table VMName,Name,SwitchName,StatusGet-VM VM01 | Get-VMNetworkAdapter | Connect-VMNetworkAdapter -SwitchName 'vSwitch-Prod'
  4. Check the VLAN assignment came across with the machine.

    PowerShell
    Get-VM | Get-VMNetworkAdapterVlan | Format-Table VMName,OperationMode,AccessVlanId
  5. Confirm the physical switch port for the new host trunks the same VLANs as the others.

Confirm it workedThe machine migrates to any host and keeps its network.
PowerShell
Get-VM | Get-VMNetworkAdapter | Format-Table VMName,SwitchName,Status,IPAddresses -AutoSize
If you need to undo itSwitch names can be renamed back.
Restore the switch's uplink
Elevated PowerShell on the host45 minutesmedium riskreversible

Everything on one host has lost connectivity.

  1. Check the switch and its team members.

    PowerShell
    Get-VMSwitch | Format-List Name,SwitchType,NetAdapterInterfaceDescription,EmbeddedTeamingEnabledGet-VMSwitchTeam | Format-List Name,NetAdapterInterfaceDescription,TeamingMode,LoadBalancingAlgorithm
  2. Check each physical member is up.

    PowerShell
    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.

  3. Re-add a member that has dropped out.

    PowerShell
    Add-VMSwitchTeamMember -VMSwitchName 'vSwitch-Prod' -NetAdapterName 'Ethernet 2'
  4. Check the management operating system's own adapter on that switch if the host itself has also lost connectivity.

    PowerShell
    Get-VMNetworkAdapter -ManagementOS | Format-Table Name,SwitchName,MacAddress,StatusGet-NetIPConfiguration -Detailed | Format-List InterfaceAlias,IPv4Address,IPv4DefaultGateway
  5. Verify the physical switch ports are configured identically for every member of the team — a mismatch produces intermittent loss rather than a clean failure.

Confirm it workedVirtual machines have connectivity and every team member is up.
PowerShell
Get-VMSwitchTeam | Format-List Name,NetAdapterInterfaceDescriptionGet-VM | Get-VMNetworkAdapter | Format-Table VMName,Status,IPAddresses
If you need to undo itRemove-VMSwitchTeamMember reverses an added member.

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.