Address Hyper-V VM network issues for peak performance
Microsoft Hyper-V can sometimes experience poor network performance or connectivity problems. When that happens, there are several things you can do to resolve the problem.
All connections go through rough patches, but it is worth the effort to maintain a strong and stable network connection to your Hyper-V VMs. Microsoft Hyper-V is generally reliable, but it isn't immune to network performance issues or connectivity problems.
When those situations arise, several different trouble spots could be to blame. If connections are spotty, check for hardware issues and apply firmware updates. When VMs lose network connection altogether, the fix might require more effort.
Troubleshoot intermittent network connectivity loss
Check networking hardware. If your Hyper-V VMs experience intermittent connectivity loss, the first step is to look at the networking hardware. Faulty ports, cables and other hardware can cause networking problems for Hyper-V VMs, just as they can for physical machines.
Examine hosts. Next, check where the problematic VMs are hosted. If all the VMs reside on a single host, then the problem is almost certainly tied to either a hardware issue or to a configuration problem on that host. You can narrow down the scope of the problem by migrating a VM to a different host. If the problem follows the VM, then it might be related to the VM's configuration. If migrating the VM solves the problem, then the issue is likely hardware related or a problem with the Hyper-V virtual switch on the VM's previous host server.
If you find the network problems are tied to a specific host, make sure the host's hardware -- especially the network adapters -- adhere to the Windows Server hardware compatibility list. Microsoft only officially supports servers that use logo-tested network interface cards.
Check for updates. Install any available firmware updates on the Hyper-V host. You may find that firmware updates are available for the server's system board and network adapters. As you work to update the host, remember to also install any updated device drivers and any available updates for the Windows operating system.
Turn off VMQ. Consider disabling the Virtual Machine Queues (VMQ) for the network adapters that are present on the Hyper-V host.
To do so, open the Hyper-V Manager, right-click on a VM, and select the Settings command from the shortcut menu.
When the VM's settings page appears, expand the network adapter and then select Hardware Acceleration.
The Hardware Acceleration page contains a checkbox that can enable or disable the Virtual Machine Queue.
Total loss of network connectivity
If a VM fully loses its ability to communicate across the network, ping the VM to see if it is responsive. A failed ping test does not automatically mean that the VM has lost its network connectivity, however. Many firewalls block ping tests by default, so a ping failure might be caused by something as simple as a firewall rule. When a VM loses network connectivity completely, there are three things that you should check right away, outlined below.
Which virtual switch is the VM connected to?
Hyper-V includes three different types of virtual switches, and only external virtual switches provide access to the physical network. If the VM is connected to an internal or private virtual switch, it can only access resources that live on the Hyper-V host. The VM cannot access the internet or the physical network.
If the VM is connected to an external virtual switch, check if other VMs that are connected to the virtual switch can access the network. If none of those VMs can access the network, there might be a problem with the network adapter that the switch uses or the virtual switch could have been corrupted, in which case you will need to delete and recreate it.
Does the VM have an IP address?
Hyper-V makes it easy to create large numbers of VMs, but in doing so, you can accidentally deplete your Dynamic Host Configuration Protocol server's pool of IP addresses. To find out if your VM has been assigned an IP address, open a command prompt window and enter the IPConfig /All command.
Has the VM migrated to another host recently?
When you migrate a Hyper-V VM, it will look for a switch on the new host that has the same name as the switch that it used on the old host. Hyper-V does not check to see if the two switches are configured in the same way. It's possible for a virtual switch on a destination host to connect to a different network segment, which might fall within a different subnet and may even be inaccessible to those machines that need to access to the VM.