I've deployed vROps, I'm alerting on problems, but I'd like to automate some of the responses to those Alerts. How can we do this?
Actions! We can add automated Actions to Alert Recommendations to handle this. We'll explore VM Snapshot Alerts in this example, but this same idea applies to any vROps object that has available Actions. VMs have snapshots, they can get large, they can get old, we'd like to clean them up without manual intervention. Let's create an Alert/Symptom/Recommendation combination to automate the deletion of all VM snapshots more than seven days old. But first, let's see if we have an Action we can use. Looks like we have some possibilities:
Quick Disclaimer: I did this on vROps 8.2 and it isn't formally supported. As of vROps 8.4 it's no longer necessary however, as we can delete Snapshots with Automation Central.
I'm interested in these:
1. Delete Unused Snapshots for VM - prompts user for confirmation
2. Delete Unused Snapshots for VM Express - no prompt
As indicated by the Adapter Type, they are provided out of the box with vROps and the vCenter adapter. They are calls from vROps to vCenter (for the associated objects). All available vROps Actions can be found here: https://docs.vmware.com/en/vRealize-Operations-Manager/8.1/com.vmware.vcom.core.doc/GUID-0A1440B8-A34F-4FBD-8247-912EC2DB89D8.html
There are others Actions made available by other management packs, specifically the vRO management pack, but let's use the vCenter ones for now. The hierarchy is such that Actions are associated with Recommendations and Recommendations have associated Actions, so let's create a new Recommendation using the Delete Unused Snapshots for VM Express Action. We'll start by looking for an existing Recommendation.
Let's clone the second one in the list:
et's give it a new Description, point it at the vCenter Adapter and select the Action we want:
Now that we have a Recommendation with the Action we want, let's create the Symptom. Clone an existing Symptom related to VM Snapshots:
Adjust the Name, condition, value, and criticality. We'll keep the default Advanced Settings, trigger after 1 Wait Cycle is fine in this case:
Now that we have our Symptom, let's create the top level Alert. Clone an existing Alert related to VM snapshots:
Let's give it a new Name, Description, and change any other settings you might want to more accurately reflect the Alert:
After clicking NEXT you will remove the existing Symptom and drag the one you just created from the list on the right over to the left pane.
After clicking NEXT, remove the existing Recommendations and add the new Recommendation (with the associated Action to delete the snapshots) to the left pane. It'll look like this:
After clicking NEXT, you can select which policy's you'd like to enable this Alert in. I've selected the Default Policy:
The final step is to select a Notification (optional). It might be nice to receive an email notifying you that a VM snapshot has been deleted. You will be provided a list of available Notification Rules, I'm skipping this for now. Once done click CREATE. Your Alert, Symptom, Recommendation, and associated Action are now active!
To enable the Automation dropdown from within Policies, adjust the describe.xml on the master node, it's located here:
/usr/lib/vmware-vcops/user/plugins/inbound/vmwarevi_adapter3/conf
Adjust the highlighted line in the "Delete Unused Snapshots for VM Express" stanza:
Change automationPolicy="None" to automationPolicy="context", like this:
To pick up this change, you'll have to run a REDESCRIBE found in Administration - Support - Redescribe. You will now have an option to Enable Automation from within the policy for this new Alert. I've done so here by changing the values in the Automate colum:
Your vCenter adapter will need credentials to take the actions associated with this Alert too. Documentation showing what you need is available here: https://docs.vmware.com/en/vRealize-Operations-Manager/7.5/com.vmware.vcom.core.doc/GUID-3BFFC92A-9902-4CF2-945E-EA453733B426.html#GUID-3BFFC92A-9902-4CF2-945E-EA453733B426
Comments