Default MAC Address Settings Affecting Hyper-V Scalability

A colleague of mine was testing single server density in the lab and realized that he was having trouble with the server scaling to 300 running VMs.  Remember, Hyper-V on Windows Server 2012 has a scalability of 1024 running virtual machines per server.  So by Microsoft's admission we should have no problem scaling to 300 running VMs and beyond.  So why was there an issue in the lab?  The answer is the default MAC address settings are configured for a range of 255 addresses.  See an example of the default settings below.


"Optimizing and Troubleshooting Hyper-V Networking" by Mitch Tulloch does a good job of explaining Hyper-V MAC address management:
Hyper-V and MAC addresses
When you install the Hyper-V role, a MAC address range is created. When you look at the MAC address, it is simple to understand where the bytes come from:
  • 00-15-5D Microsoft IEEE Organizationally Unique Identifier
  • 01-66 These two bytes come from the first IPv4 Address of the host. The two lowest octets are convert hex. 01-66 maps to 1.102, so in this case the IP was 192.168.1.102.
  • 00 The last byte is 00 for minimum and FF for the maximum.

In this example, the MAC address range is:
  • 00-15-5D-01-66-00 Minimum MAC address
  • 00-15-5D-01-66-FF Maximum MAC address

You can evaluate your MAC address range by looking at the Windows Registry:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization
and the issues that was being experienced:
Duplicate MAC addresses
After you understand the basics, it’s time to learn how two or more virtual machines can have the identical MAC address. This can happen in the following scenarios:
  1. A Hyper-V host has more than 255 virtual machines, which means the pool is depleted. If one or more virtual machines are stopped or in saved state and a new virtual machine is created, one of those MAC addresses will be reused.
  2. During installation, a Hyper-V host is assigned the same first IP address that another host was assigned during installation. This results in the same MAC address range.
  3. Cloning a Hyper-V host for deployment will include the MAC address range in the registry. This results in a MAC address range overlapping across multiple hosts. Since Windows Server 2008 R2 Hyper-V is sysprep aware.

NOTE Hyper-V detects duplicate MAC addresses and prevents virtual machines from starting. This detection mechanism works for a single Hyper-V host.
The Microsoft management tool System Center Virtual Machine Manager solves these problems by using bare metal deployment and maintaining a global MAC address database for all virtual machines.
So the solution is the either manually modify the MAC address settings of each Hyper-V host, or add SCVMM into the mix and allow for it to maintain this assignment.  I guess the method you use is entirely up to you.

Comments