Quick tip today on a static MAC address assignement, How to set a static MAC address in VMware Environment? Or rather what to look after when having alarms showing VM MAC conflict. MAC address “Spoofing” if you prefer, is well known…. Sometimes you may need to “mess” with MAC address, and assign a static one, when for example using a software which is tighten to the MAC address. If not your license will be voided.
So far I had this case only once for some old software. If I remember right it was an Architecting software. As you might know, the MAC addresses are assigned via vCenter server, they are generated for VM's NICs and VMkernel adapters. They are created automatically when youi create a VM, Add a NIC or Add a VMkernel adapter to a VM.
First few words about OUI. What is OUI? Each network adapter manufacturer is assigned a unique three-byte prefix called an Organizationally Unique Identifier (OUI). VMware has 3 different ways to allocate MAC addresses, where each one of those is with separate OUI.
- Generated MAC Adresses – those addresses can be further be separated in two groups, where:
- Group 1 – Assigned by vCenter server
- Group 2 – Assigned by ESXi host
- Manual – in this case you can define the value of the MAC address manually
- Generated for legacy VMs – those VMs are no longer userd with ESXi.
The whole MAC address is composed of:
- VMware OUI
- A SMBIOS UUID or the unique ID of the host
- Hash based on the name of the entity that the MAC address is being generated for.
When a MAC address conflicts occurs?
There might be a situation where you're using replication software to replicate your VMs. As the replicas do have the same VMX file, basically you'll have an alarms in your vCenter telling you that you have a MAC address conflict. The alert gets triggered on the initial run, after the collision is detected, vCenter Server changes the MAC address of the VM that's why it doesn't match with the original one.
As a solution to this problem you might want to specify a resolving event for this alarm, so once MAC address is changed, you no longer see this alarm in an opened state. For Veeam Backup for example, the default suffix is “_replica”. So If you add a trigger condition to each of the alarm triggers (VM MAC conflict, VM static MAC conflict) with as a value = “VM name” and operator = “does not end with”, and Value = “_replica” you can get rid of the alarm without completely deactivating the MAC address conflict alarm. Thing that is not recommended, indeed.
When Multiple Static MAC addresses are used in your environment
If you do have two VMs with the same static MAC addresses, an alarm shows it off..
vCenter Instance ID – What is that?
If you're running multiple vCenters, make sure that you configure theme with the same vCenter server Instance ID, which is a number between 0 and 63 that is randomly generated at installation time, but can be reconfigured after installation. If you deploy virtual machines from multiple vCenter Server systems to the same network, these vCenter Server systems must have unique instance IDs. When you change the vCenter Server Unique ID, the autogenerated MAC addresses are different.
When you change the vCenter Server Unique ID, the autogenerated MAC addresses are different.
Where to look for vCenter instance ID?
And then you see the value in the Runtime settings….
You must restart vCenter Server for the change to take effect.
You can also force vCenter Server to generate a new MAC address for the virtual network adapter of your VMs by configuring the virtual network adapter to use a Manual MAC address, and then reconfiguring it to Automatic.
Source: VMware KB – Virtual machine MAC address conflicts or have a duplicate MAC Address when creating a virtual machine