As shared in this blog post HERE and HERE, vCenter Server has a built-in mechanism for managing VM MAC addresses where the original VM has been migrated to a different vCenter Server (regardless of the vCenter SSO Domain) using a VM MAC Address blocklist.
The VM MAC address blocklist functionality is still only available using a private API and the only way to find out what VM MAC addresses are currently in the list is by interactively using the vSphere MOB and the fetchRelocatedMACAddress API.
Recently, I had a question from a customer who was looking to clear the VM MAC address blocklist and was wondering if that was possible and whether there was an API to perform this operation?
Simliar to the fetchRelocatedMACAddress API for retrieving the current VM MAC address blocklist, there is another private API, that will reclaim all VM MAC addresses within the blocklist called reclaimMac. While you can manually call either of these private APIs using the vSphere MOB interactively through the browser, you can also automate the vSphere MOB as described in this 2016 blog post.
Retrieve VM MAC Address blocklist
To demonstrate the retrieval of the VM MAC address blocklist, I have created the fetch-vc-mac-address-blocklist-via-mob.ps1 script which you will need to update three variables that contains your vCenter Server FQDN/IP address and its credentials.
If you run the script where no VMs have been migrated to another vCenter Server, the results will be empty as shown in the screenshot below.
Lets now Cross vCenter vMotion (xVC-vMotion) two VMs (VM-1 and VM-2) which contains 3 MAC addresses in total between my source and destination vCenter Server.
If we now re-run the script, we can see the 3 MAC addresses are now listed in the VM MAC address blocklist of the originating vCenter Server.
Reclaim VM MAC Address blocklist
To demonstrate the reclamation of the VM MAC address blocklist, I have created the reclaim-vc-mac-address-blocklist-via-mob.ps1 script which you will need to update the variables for your vCenter Server FQDN/IP address, credentials and its Instance UUID.
The easiest way to find your vCenter Server Instance UUID is connect using PowerCLI and running the following snippet:
$global:DefaultVIServer.ExtensionData.Content.About.InstanceUuid
If you run the reclamation script, it should reclaim all VM MAC addresses on that vCenter Server that was on the blocklist and you should see output simliar to the example shown below.
Note: The reclaimMAC private API will remove all VM MAC address entries from the vCenter Server VM MAC address blocklist, there is not a way to reclaim a specific VM MAC address
Thanks for the comment!