WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Automating the retrieval & reclamation of VM MAC address blocklist for vCenter Server using the vSphere MOB

Automating the retrieval & reclamation of VM MAC address blocklist for vCenter Server using the vSphere MOB

07.16.2024 by William Lam // Leave a Comment

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

More from my site

  • Does vCenter Server recycle VM MAC Addresses after Cross vCenter vMotion?
  • How to deploy the vCenter Server Appliance (VCSA) with a custom MAC Address?
  • An update on how to retrieve useful information from a vSphere login?
  • How to easily disable vMotion & Cross vCenter vMotion for a particular Virtual Machine?
  • How to automate vSphere MOB operations using PowerShell?

Categories // Automation, vSphere 7.0, vSphere 8.0 Tags // mac address, vSphere MOB

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...