Just a quick post to show how you can monitor Recovery Point Objective (RPO) compliance of a virtual machines protected with vSphere Replication.
Option 1: vCenter Server Alarm
When vSphere Replication Appliance is registered to vCenter Server multiple new vSphere Replication Event Types become available and can be used for creation of custom alarms.
List of all these event types can be queried with the following one-line PowerCLI command:
(get-view eventManager).get_Description()| select -expand Eventinfo |where FullFormat -like “*Hms*”
The following example will show how to set alarm for event “RPO violated”
Description: RPO violated
FullFormat: com.vmware.vcHms.rpoViolatedEvent|Virtual machine vSphere Replication RPO is violated by [data.currentRpoViolation] minute(s)
- In vCenter Server go to Manager, Alarm Definitions and add new alarm
- Set alarm name, monitor VMs and specific events.
- Enter the trigger (com.vmware.vcHms.rpoViolatedEvent)
- Add Alarm actions (email, SNMP trap, run command etc.) as necessary.
Note that this alarm applies only to VMs replicated from the particular vCenter Server. So it will not be triggered on VMs replicated to this vCenter Server.
Option 2: vCloud API
This options applies only for VM replications to or from a cloud provider who uses vCloud Availability add-on. The vCloud Director tenant APIs are extended with replication APIs. The state of each replication can be retrieved with:
Where list of all replications and their replication-ids is retrieved at org level with these two API calls:
An example of VM1 replication state (RPO 15 mins, not active with 16 min RPO violation):
The following tables describes all the elements of the API response: