WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • 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. simon says

    10/02/2018 at 8:00 am

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

    Reply
  2. applicationha 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

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023
  • Is my vSphere Cluster managed by vSphere Lifecycle Manager (vLCM) as a Desired Image or Baseline? 03/10/2023
  • Interesting VMware Homelab Kits for 2023 03/08/2023

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 © 2023

 

Loading Comments...