WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Create vCenter Alarms for monitoring HCX migration events

Create vCenter Alarms for monitoring HCX migration events

09.20.2018 by William Lam // 2 Comments

With the Hybrid Cloud Extension (HCX) solution, customers can migrate workloads immediately or have them scheduled at a later date and time of their choosing. Most customers will most likely not migrate all their workloads at once, but instead migrate them in different phases or waves based on their own internal schedules. The HCX "Migration" tab in the vSphere Client is a great place to get an overview of all the active, failed, planned and completed migrations and you can get additional details for each migration such status, percentage, amount of data transferred, etc.

Having said that, you probably also do not want to just sit there and constantly watch for progress, especially if something fails. The good news is that HCX already includes some default vCenter Alarms that are generated when a migration fails. There is one for vMotion/Cloud Motion, Cold Migration as well as Bulk Migration and currently these alarms only trigger a UI indication that something is wrong using the red critical icon on the VM in question.

Since these are vCenter Alarms, you also have the option of adding additional actions such as sending an email alert to a particular user or group, an SNMP trap which can then be monitored by your operations team or even run a command within the vCenter Server. Simply updating the default alarm which is defined at the vCenter Server level, you can proactively get notified when an HCX migration fails without having to constantly watch the UI. You may have also noticed the alarm definition is using a numeric ID which is highlighted in the screenshot above. This maybe useful if you wish to leave the default alarms alone and create a brand new alarm, you just need to use those IDs.

Another useful scenario to consider is getting notifications for a successful migration which can then help with transitioning users to the new VM running on VMC or even trigger automated VM and application verification before end users are even notified. Along these similar lines, you can imagine another scenario to consider is with using Bulk Migration and/or Cloud Motion with vSphere Replication. Both methods initially start off by replicating the VM's data from the source vCenter Server to the destination vCenter Server and then either a Cold Migration or vMotion is performed based on the configured scheduled.

You could augment the workflow slightly as scheduling the exact switch over window may not always be possible for customers at the time of setting up the replication and you want that to start as soon as possible, so you can witch over when you are ready. Instead, you could configure a switch over date/time that is further out in the future, which basically would not migrate the VM. You can then setup a vCenter notification to alert you when the replication has completed and then you can configure an updated date/time to actually perform the switch over.

To do so, we would need to create some additional vCenter Alarms to be able to trigger on these specific HCX events. The table below summarizes the current default HCX Events as well as additional HCX Events that can be used to create additional vCenter alarms:

EventId Description
hbr.primary.DeltaCompletedEvent Replication Completed
hbr.primary.SyncStartedEvent Replication Started
50001 vMotion or Cloud Motion of a VM failed
50002 vMotion or Cloud Motion of a VM was successful
50003 Cold Migration of a powered off VM failed
50004 Cold Migration of a powered off VM was successful
53001 Cloud Motion with vSphere Replication failed
55001 Bulk Migration of a VM failed
55002 Bulk Migration of a VM was successful

Below is an example of creating a new vCenter Alarm to alert us when the initial replication has completed.

Step 1 - Create a new Virtual Machine alarm, provide a name and select the "specific event occurring ..."


Step 2 - Enter the EventID found in the table above and specify what the status should be. In the example here, I am simply using a "normal" UI indicator option but you can choose others.


Once the alarm has been created, when I perform either a Bulk Migration or Cloud Motion, once the initial replication has completed, you should see the alarm get triggered for the given VM as shown in the screenshot below.

In my opinion, I think being able to generate alerts or notification for particular HCX Events can be useful for a number of use cases, including some of the ones I have discussed above to even general auditing purposes. I think it would be really cool if we had all of these HCX Alarms created out of the box for customers and you can simply modify them based on their use case.

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
  • Quick Tip - How to clear all Hybrid Cloud Extension (HCX) Migrations in the vSphere UI

Categories // Automation, HCX, VMware Cloud on AWS Tags // alarm, event, HCX, Hybrid Cloud Extension, VMware Cloud on AWS

Comments

  1. *protectedsimon says

    10/02/2018 at 8:00 am

    In vCenter 6.7 I can not select "specific event occurring ...". Any ideas?

    Reply
  2. *protectedapplicationha says

    03/05/2020 at 6:25 pm

    Thanks! its Great content. Good luck

    Reply

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