WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / HCX / Quick Tip - How to clear all Hybrid Cloud Extension (HCX) Migrations in the vSphere UI

Quick Tip - How to clear all Hybrid Cloud Extension (HCX) Migrations in the vSphere UI

10.11.2018 by William Lam // Leave a Comment

During the development of my Cloud Motion with vSphere Replication automation script for Hybrid Cloud Extension (HCX), I extensively used the HCX vSphere UI for testing and debugging purposes.


Under the Migration view, you can see all active and completed migrations, including any failed migration attempts. In my particular environment, there had been a few hundred migrations and with my additional testing, that added quite a few more. Although you can filter by name or sort by the type of operation, it was still not very convenient for me while developing the script. I wanted a quick way to view the details after calling the HCX APIs and by the time I jumped to the UI, I would have missed a few of those updates.

In speaking with one of the HCX Engineers, I found out that you could simply drop all migration history from the internal database (this would remove all the history for past migrations including failures). In general, I do not see this being something customers would have a need for in Production, as you would want to keep all the history for auditing or debugging purposes. This is probably more for demo or testing purposes and below are the instructions on how to clear all migrations from your HCX Manager.

Disclaimer: This is not officially supported by VMware, please use at your own risk

Step 1 - SSH to the on-prem HCX Manager using 'admin' account and the credentials.

Step 2 - Connect to the HCX Mongo DB by running the following command:

mongo hybridity

Step 3 - Next, run the following command which will drop all migration history from database:

db.VmMigrations.remove({})

Step 4 - Lastly, you can run the following command to exit from the Mongo DB:

q

At this point, you can now refresh the HCX Migration tab in the vSphere UI to confirm all migrations have been successfully removed.

You can also confirm the operation was succesful by running the following command connected to the Mongo DB:

db.VmMigrations.find()

More from my site

  • Automating HCX Multi-Site Service Mesh configuration using the new HCX PowerCLI cmdlets
  • Automating HCX Add On for VMware Cloud on AWS
  • Automating complete HCX deployment and configuration to first cloud migration using PowerCLI
  • Automating Hybrid Cloud Extension (HCX) Manager initial configuration for VMC
  • Create vCenter Alarms for monitoring HCX migration events

Categories // HCX, Not Supported, VMware Cloud on AWS Tags // HCX, Hybrid Cloud Extension, MongoDB, VMware Cloud on AWS

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

  • VMUG Connect 2025 - Minimal VMware Cloud Foundation (VCF) 5.x in a Box  05/15/2025
  • 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

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...