New in vROPS 8.4 is an Automation Central section. Automation Central allows you to automate task such as rebooting VMs, reclaiming resources, and rightsizing VMs in a recurring schedule you choose. In this guide I will show you how to set a recurring job to delete old snapshots past 7 days using this feature. I will also show you how to filter VMs that I don’t want snapshots removed, for example Windows Templates.
Automation Central can schedule the following task
- Delete old snapshots
- Delete idle VMs
- Power off idle VMs
- Delete powered off VMs
- Downsize oversized VMs
- Scale-up undersized VMs
- Reboot VMs
How to Schedule a weekly deletion of VM Snapshots older than 7 days
As you can see using my Healthchecker Dashboard. I can see I have 3 VMs with Snapshots. I only want to delete anything past 7 days old, but I also want to leave the Windows 2016 VM alone since it is a template. If we do everything correctly, the ws1connect VM should be the only VM snapshot that gets deleted.
Go to Home > Automation Central
Select a date on the calendar and click on Add Job
Provide a name and select Delete Old Snapshots. Modify the days as needed. Click on Next
Add the clusters you want to apply the job too. And then click on Preview Scope to see what VMs will get effected.
After previewing you see that it will apply this to all VMs in the cluster. Even the three Windows Template that I don’t this to apply too. That is because we haven’t added a filter to tell it not to yet.
To remove the windows templates. I add a Filter Criteria of Object Name does not contain win. This will eliminate any VMs that has the word “win” in it. You can also filter it based on Tags and other properties as well.
Now I click on the Preview Scope again to verify that the Windows Templates are indeed removed. Click on Next
Below is a sample of how to do schedule this job to run weekly starting at every Monday morning at 3:45am. I set it to indefinitely which means this has no end date. Click on Create when done.
Click on Jobs to view the job you just created. You can also Disable and edit your job from this section as well.
After the time has elapsed, you can click on History to see that indeed the Automated did ran. It also deleted only the one VM that had over 7 day old snapshot and not our Windows Template that also had an old snapshot.
I also verified that in vCenter as well as the Healthcheck dashboard.
You can use this feature to reclaim CPU and memory as well, but make sure you test this feature on non-essential VMs before you push it out to production.