Having a duplicate VM MAC Address in your environment can lead to an extremely painful day of troubleshooting and it can also be tough to prevent depending on how and where you provision your VMs.
There are two cases that I can think of where a duplicate MAC Address can potentially occur:
- You manually assign a static MAC Address versus using dynamic assignment (includes VM import) and it conflicts with an already assigned MAC Address
- You migrate a VM from one vCenter Server to another and the destination vCenter Server has already assigned the MAC Address of the migrated VM
In both of these scenarios, when a duplicate MAC Address occurs, time is of the essence to quickly pin-point the source of the duplicated entry and quickly resolving the conflict. What would be nice is to be able to automatically detect that a MAC Address conflict has occurred and provide the necessary information of the offending VMs.
UPDATE (4/22) - Thanks to Petr, it turns out there is another MAC Address conflict event which I did not know about specifically for detecting duplicate entries for manually assigned MAC Addresses called "VM static MAC conflict". I definitely recommend creating an alarm for both Events for the vCenter Alarm.
While performing some research in my lab environment the other day, I accidentally stumbled onto this little tidbit in vCenter Server. It turns out there is an out of the box event called "VM Mac conflict" which can be triggered using a vCenter Server alarm when a duplicated MAC Address is detected for a VM. I was actually surprised that this was not one of the pre-created default alarms in vCenter Server as I can see this being extremely useful to have out of the box. In any case, it is simple enough to create a new vCenter Server Alarm and in the example below I called it "Dupe VM Mac Address".
To test our new alarm, I created a new VM called "VM1" which has been configured with static MAC Address that matches "VM2". Once the VM has been created, we can see that the alarm is immediately triggered and by clicking into the alarm details, it provides the details of the MAC Address and the offending VMs.
In my opinion this is an alarm that everyone should create in their environment to ensure that if this problem ever occurs, you can quickly get notified and resolve the problem. I have also reported this internally and asked if we can have this alarm created by default, so hopefully this will not be necessary in the near future 🙂
Fouad says
Hello,
I neeeeeeed this alarm but i don't see how to create it ?
Thanks for all
William Lam says
Here's the documentation on creating an alarm https://pubs.vmware.com/vsphere-55/index.jsp?topic=%2Fcom.vmware.vsphere.monitoring.doc%2FGUID-79AC1262-D701-4BC8-8F8D-F046AE0578CF.html
Zach Dickinson says
This looks like it might be only available in one of the later updates for 5.5 New vSAN cluster for DR has it, but my "old" production cluster does not. In fact there are only a few VM checks in production, with many dozens available in DR.
Petr says
Hello William,
just in addition to your post. In our environment (5.1U3) we are using event "VM static MAC conflict" which work as expected.
Event "VM MAC conflict" doesnt trigger any alarm when manually/auto assigned MAC addresses confilcts between VMs ...
William Lam says
Hi Petr,
Thank you very much for sharing this tidbit. I didn't know we had a different event for static MAC Address assignment. I've gone ahead and updated the blog post to reflect this additional information.
virtigogo says
Thanks for this, William. I want to do the opposite - I want to ignore the VM MAC conflict alarm in my testing. With vSphere 6.5, is there a way to do that?