Home > Virtualization > MAC address pool duplication in Hyper-V

MAC address pool duplication in Hyper-V

December 28, 2009 Leave a comment Go to comments
Hyper-V has an algorithm to deal with duplicate MAC addresses on a single host, but not across multiple hosts.
So, if you not take care it is possible to accidentally deploy hosts with duplicate MAC address pools.
How to modify the default pool and how to detect it, if you are experiencing a duplicate MAC address situation with virtual machines, and how to use SCVMM 2008 to manage your Hyper-V hosts that can prevent duplicate MAC addresses ?
Hyper-V allows a virtual machine to be created with a static or dynamic MAC address. A static MAC address is one that the Hyper-V administrator assigns to the virtual machine. A dynamic address is one that Hyper-V assigns from its MAC address pool. When Hyper-V is installed, a MAC address pool is created and stored in the registry at HKLMSoftwareMicrosoftWindows NTCurrentVersionVirtualization. It is stored as a range of 256 values defined by two key values: MinimumMacAddress and MaximumMacAddress.

Since the MAC address pool is created when the Hyper-V role is installed, attempting to install the role and image the physical machine will cause each Hyper-V server deployed using the image to have the same MAC address pool. Even if you sysprep the machine before you image it, the registry values are not reset.

There are a some steps to avoid this situation:

  • Do not install the Hyper-V role before you sysprep the machine, but have it install as part of the post mini-setup process.
  • Before you sysprep the machine, delete the following two key values under HKLMSoftwareMicrosoftWindows NTCurrentVersionVirtualization
    • MinimumMacAddress
    • MaximumMacAddress

Using the first option will force unique values for the MAC address pool when you install the Hyper-V. The second option will force the keys to be recreated when the VMMS service starts during boot.

Using SCVMM 2008 to deal with MAC issue

System Center Virtual Machine Manager 2008 uses a different approach when managing virtual machines and MAC addresses by using static MAC addresses from a defined pool. This pool is used across all hosts that it manages regardless of host type (Virtual Server 2005 R2 SP1, Hyper-V, or VMware). By default the pool is in the range of 00-1D-D8-B7-1C-00 to 00-1D-D8-F4-1F-FF for 3,998,719 available MAC addresses. You can define your own range if you like, but you must follow these rules:

  1. The first three octets must be the same for the Minimum and Maximum addresses.

  2. You cannot use octets that are already in use by Microsoft or VMware.

Steps to modify the default range in the SCVMM 2008:

  1. Go to the SCVMM Administration console.
  2. Click on the Administration View button.
  3. Click Networking.
  4. Click Global Static MAC address Range.
  5. In the actions pane, click Modify.
  6. Change the range values.
  7. Click OK.

Now all virtual machines deployed using the System Center Virtual Machine Manager 2008 administration console or using SCVMM PowerShell cmdlets will get a static MAC address from the global pool.

Be carefull : do not 

deploy a virtual machine using the Hyper-V Manager MMC on a host managed by SCVMM, the virtual machine will not use the SCVMM static MAC address pool, but will use the locally defined dynamic MAC address pool on the Hyper-V host and then you can have the MAC duplication issue.



Categories: Virtualization
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: