In this next post I will explain how to enable some actions for “Automation” which are not available officially for automation in the policy….
While I like to fly by the seat of my pants and don’t like to play by the rules.. I can’t stress enough that this is not supported by VMware, they didn’t show me how to do this and you perform the steps at your own risk.
Now that I have the ass cover out of the way… let’s get too the juicy bits!!
This was done on vRops 7.5…. (for vRops 8.0+ check out this post)
Start off by creating a custom Recommendation and attaching the action “Delete Unused Snapshots for VM Express” to it.
Then I will just clone the alert definition “Virtual machine is running on snapshots for more than 2 days” and link my new recommendation to it…
Now we go an browse the policy to enable automation…
oh snap it’s “Not Applicable” DAM YOU vROPS GODS!!! oh well down the GSS not supported route once again…
SCP to each vROPS node and make a backup of describe.xml located in /usr/lib/vmware-vcops/user/plugins/inbound/PythonRemediationVcenterAdapter3/conf and make the following modifications to the original one… in the XML search for the node below
Action key="Delete Unused Snapshots For VM Express" actionType="update"
And change
automationPolicy="none">
to
automationPolicy="context">
Save the file and nagivate to Administration –> Support –> Redescribe and click the button, wait for it to finish and then go back into the policy and enable automation.
Jackpot!! More automation that the man didn’t wantz you to have!!
And yes I can confirm the automation works… but you can check for your self when an alert fires navigate to Administration –> History –> Recent Tasks and check out the automation goodness…
Now jokes aside be sure you understand what you are doing as it says it’s an express snapshot delete so it might cleanup other snapshots you don’t want it to in the process…. it all depends on your need / setup.
This method can be used to enable other actions in the policy too…
Hope you found this post helpful.
vMan
Thank you vMAN on this detailed article.
Thanks!!
How vROPS will delete the snapshot in the vCenter. By default (vROPS) will not have user with write permission to delete the snapshot in the vCenter. Should the user needs to be created with required permission ?
You must enable actions in the vCenter solution / MP. Check the vRops documentation on how to enable actions.
Sir, when will you do one for vROPs, please?
What do you mean? This is for vRops.
Hi vMan!
I followed this guide to try and automate an SS removal task (on a custom Alarm), but even after performing the Redescribe action, I still see the Automate field on my policy as “Not Applicable”.
Any idea what I’m missing?
Thanks.
Which version of vRops are you running? This was tested on 7.5
8.1
I have not tested it on 8.1 yet maybe something changed…. I will have to look into it.
Try this new file: /usr/lib/vmware-vcops/user/plugins/inbound/vmwarevi_adapter3/conf …. I have not tested it but Kim over @ vmusketeers.com found it 🙂 I will post a new blog post once I fully test it.
Thanks! Can confirm it works 🙂
Is there any way you know to delete specific Snapshots? More specifically, of a certain “Age”.
There is the “Delete Unused Snapshots for VM” (not Express) – which prompts for the age. Would love to automate that to use a custom predefined Age, like with your example, but only delete the “older” snapshot (e.g: my alert is for snapshots older than 7 days, but if a VM has 2 snapshots, one created 8 days ago and one 2 days ago, it’ll only delete the one created 8 days ago).
If you find a way (without vRA/vRO) that would be super useful! 🙂
Great glad to hear it! Let me look into your request in the next few days and see what I can come up with… there might be a way.
Yep I wanted to do this without vRO /vRA thats why I originally looked into the work around.
Hi man,
Did you ever get a chance to look into this? I got a solution working using vRO (similar to waht Luke posted on the post for v8.x)- but now I’m working with a company that doesn’t have vRO and would still want to implement this solution (using only vROPS).
Thanks!
Hello Martin,
No I didn’t get a chance but will try to find time to take a look.
Cheers
vMan
Hi vMAN,
I am trying to create a new Actions through a Script and Automate Colum Inherits Disabled through the Base Setting. While going through the VMware documentation i realized that “By default, automation is disabled in policies” https://docs.vmware.com/en/vRealize-Operations-Manager/8.1/com.vmware.vcom.core.doc/GUID-8838DA32-0055-4BD2-9C0F-51A182857F51.html. Is there a way to enable all new Actions by default in policies. Any idea or suggestion will help me a lot.
Thanks!
Hello Aman, not as far as I am aware. This is because not all actions are enabled for automation… you need set the config to allow the actions and then go in run a redescribe and enable them in the policy…
hi vMAN any update for vROPs 8.2 please?
It still works, checkout https://vman.ch/vrops-8-2-enabling-automation-for-deleted-snapshot-action-and-others/
Is there a way to create exceptions? About 90% of our VM snaps can be purged after 3 days, but there are some exceptions. I was thinking maybe of putting a tag in the VM properties. i just don’t know how I can code the action to “skip” over VMs that have this particular tag in it.
You should be able to add it as a symptom, clone the alert and add additional symptoms where is looks for a tag.
Can you please let me know which policy I should edit?
From your statement in the snapshot automation
Now we go an browse the policy to enable automation. Do I have to create a new policy? Or should I edit the default one?
We have multiple vCenter linked can I limit it to one vCenter for snapshot deletion? Not sure if this is possible, just here to take your suggestion.
You can edit the existing policy assigned to the VM’s or create a new one, its really up to you.
Yes you can limit it by having a policy per vCenter or even based off tags or custom groups and enabling automation in the specific policies.
The link for the instructions on VROPS 8.x doesn’t work, do you have an updated link?
Thanks for letting me know, I finally fixed this.