Network Load Balancing (NLB) and virtual machines

There is a fair amount of confusion about the state of using Windows network load balancing (NLB) when it comes to Microsoft virtual machines.  Today I am (hopefully) going to set the record straight.  When using NLB with Microsoft virtual machines you need to be aware of the following issues:

  1. Virtual Server / Virtual PC will not utilize any NLB capabilities on the host operating system.  This is because Virtual Server / Virtual PC perform their network operations at a lower layer on the host network stack than NLB.  Note – Virtual Server and Virtual PC will function correctly when NLB is present on the host – they will just not benefit from it.

  2. Virtual Server / Virtual PC have some network optimizations that actually cause problems when running NLB systems inside of virtual machines.  These optimizations are simply that if we see a network packet that is going from the host to a virtual machine, or from a virtual machine to another virtual machine, we will send the packet directly to that virtual machine – without sending a copy of it on to the physical network connection.  Similarly if we see a network packet coming into the physical computer that is destined for the host operating system – we will not send it on to any of the virtual machines.

    Now – these optimizations cause problems with NLB because NLB creates its own virtual MAC address that is shared amongst all the NLB servers – which means that we cannot tell when a packet should go just to the host, a virtual machine or everyone.  Because of this we see the following results:

    1. NLB works with virtual machines – if everything (client and NLB servers) is on separate host systems.  It also works if some systems are physical computers, and some virtual machines – as long as each server / client is on a separate computer.

    2. NLB works when all the NLB servers are virtualized and placed on the same physical computer.  Obviously this is only useful for non-production environments.

    3. Any other configuration will fail (e.g. having a virtualized client hosted on a physical NLB server node, having a virtualized client and virtualized NLB server node on one box, with other NLB server nodes on remote systems)