Hyper V Mac Address Manual Staticdwnloadblock



The final eight bits of the MAC address are set to a hash value based on the name of the virtual machine’s configuration file. For example, if a machine's IP address was 192.34.14.81 (or in hex, 0xc0220e51) and the configuration file was hashed to the value of 95, the MAC address would have the following value: 00:05:69:0e:51:95.

In this post I’m going to talk about the MAC Address Pools in Hyper-V / VMM and the actual way they work.
It seems easy to setup and never look at it again but this can cause some serious issues.
There are many threads on technet forums about virtual machines changing MAC addresses and especially Linux virtual machines losing network connection.

Lets start at the beginning.
In the Hyper-V Manager you can set a specific range what addresses are allocated to the VM’s.
You can see/edit the range under the “Virtual Switch Manager”.

  • In MAC Address Range specify the start and end addresses. In Summary review the settings and click Finish. When the job shows as Completed verify pool in MAC Pools. Release IP addresses. In some circumstances you might want to remove addresses from the MAC pool. For example if a host that was assigned an IP address during bare metal deployment.
  • On a Windows Server 2008 or Windows Server 2008 R2 Hyper-V host, an Event ID 12565 from source 'Microsoft-Windows-Hyper-V-Worker' is logged, as described in the TechNet documentation. Cause This problem occurs because the default number of dynamic MAC addresses for virtual machines (256) has been exceeded.

So every new VM gets a MAC address in this range specified on the Hyper-V host.
You can view the MAC of a VM under “Settings > Network Adapter > Advanced Features”

Hyper-v Mac Address Dynamic Or Static

As you can see the allocated MAC is within the specified MAC range.
You could set your own MAC here, using the static MAC option.

But what happens when you have more than 1 host??

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.
Make sure you do not use the same range on different Hyper-V hosts!!

NOTE:
Once the MAC address pool is created when the Hyper-V role is installed, imaging the host will cause each Hyper-V server deployed using the image to have the same MAC address pool. Even if you sysprep the host before you image it, the registry values are not reset.

MAC Address Regeneration

When Live Migrating VM’s to a different host there’s no problem and the VM will keep the same MAC.
If there’s a different MAC range allocated on the new host the MAC changes when:
– VM is turned on from off state
– VM is restored from save state (Quick migration!)
– Antoher VM uses the same MAC.

If you’ve set a static MAC, the MAC moves between hosts.

Linux

Unlike Windows, Linux VM’s (Redhat, Centos, Ubuntu etc.) have the MAC address hardcoded in configuration files.
When the above situation occurs the VM will get a new MAC and loses network connectivity.
You will need to edit the network cfg’s and enter the new MAC to get the VM online.
Make sure you use static MAC addresses in this situation!

VMM – Virtual Machine Manager

In VMM a default MAC Address Pool is created with range 00-1D-D8-B7-1C-00 to 00-1D-D8-F4-1F-FF (3998720 addresses).

VM’s deployed with VMM can make use of this default pool when the NIC settings are set right.

Dynamic = Get your MAC from the Hyper-V host
Static = Get your MAC from the VMM MAC address pool

Hyper-v Static Mac Address

Select static (also in templates and hardware profiles!) to make use of the default MAC Address Pool and overcome any MAC problems.
Once you allocated a MAC from the MAC pool the MAC stays static on all your Hyper-V hosts.
When you select “Static” and leave the value “00:00:00:00:00:00” it will allocate a MAC from the MAC pool for you, you dont have to make up one 😉

When deploying a virtual machine using the Hyper-V Manager 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 when selecting “Dynamic”.
When selecting static here, you will need to make up a MAC.

Read more:

Address

In most network deployments, generated MAC addresses are a good approach. However, you might need to set a static MAC address for a virtual machine adapter with unique value.

The following cases show when you might set a static MAC address:

  • Virtual machine adapters on different physical hosts share the same subnet and are assigned the same MAC address, causing a conflict.
  • Ensure that a virtual machine adapter always has the same MAC address.

By default, VMware uses the Organizationally Unique Identifier (OUI) 00:50:56 for manually generated addresses, but all unique manually generated addresses are supported.

Note: Make sure that no other non-VMware devices use addresses assigned to VMware components. For example, you might have physical servers in the same subnet, which use 11:11:11:11:11:11, 22:22:22:22:22:22 as static MAC addresses. The physical servers do not belong to the vCenter Server inventory, and vCenter Server is not able to check for address collision.




Comments are closed.