How to avoid duplicate MAC addresses when migrating to a new vCenter Server

When moving VM’s from one vCenter server to another or moving ESXi hosts (with VM’s) to another vCenter there’s an aspect which is easily overseen: MAC address usage!!!

First a little bit of background information. When you create a VM the MAC address assigned to it is generated by vCenter. The MAC address of a VM created on a VMware 5.5 platform will always start with 00:50:56. But how are the other octets determined?

Each vCenter server has an installation ID. This is generated randomly during installation of vCenter (ranges from 0 to 63). Based on this installation ID the fourth octet is determined. To calculate the fourth octet we take the installation ID number, add 128 to it and the convert it from decimal to hexadecimal.

You can view the installation ID by going to the webclient, select the vCenter, click on the Manage tab and choose settings. Now click Edit and go to Runtime Settings. The Installation ID is now displayed.

So suppose the installation ID is 34. We take 34 (installation ID) and add 128 to it. This gives us a decimal value of 162. If we convert this to hexadecimal we get A2.

The MAC address of a VM created on a vCenter with installation ID 34 now starts with 00:50:56:A2. The last two octets are generated by vCenter automatically.

Normally you never have to worry about MAC addresses because vCenter handles this for you. But let’s assume we are building a new vCenter environment and want to migrate the VM’s (or ESXi with the VM’s) to this new vCenter environment or you are consolidating multiple environments to one vCenter.

If you don’t check the MAC addresses of the VM’s you are moving to the new vCenter a rare problem can occure when you create a new VM. This new virtual machine could get the same MAC address of one of the VM’s you migrated to this vCenter.

Before you migrate VM’s to your vCenter check if the MAC address of the VM is in the same range as the vCenter you are migrating to. If we look back at the above example I should not migrate VM’s which have MAC addresses starting with 00:50:56:A2.

You could migrate this VM and then delete the network adapter and create a new one (with a new MAC offcource). If this is problematic another solution could be to change the Installation ID and restart the vCenter service. This way you force vCenter to issue MAC addresses with a other fouth octet.

There are more solutions possible, bottom line of this blog is: check the MAC addresses and MAC address assignment to avoid duplicate MAC addresses!!!

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 )

Facebook photo

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

Connecting to %s