Ever since the release of vCenter Server 8.0 Update 3, a new feature has been available: scheduled removal of snapshot.

This is the result of a frequent request to allow for deletion of snapshots after (manual) creation. In normal circumstances, these snapshots are removed manually after a day. However, we all know this sometimes gets forgotten. VMware Broadcom has listened.

This blog post shows how to schedule snapshots (yes, this is possible now), and consequently remove snapshots that are older than a certain amount of days. Difficulty: low 😀

Documentation: How do I Schedule Tasks for Snapshot Deletion

In vSphere, navigate to the Virtual Machine, and click Snapshots. From here you can find the current snapshots. As you can see, currently none are available

From the Snapshot Management Interface, please click on Snapshot Deletion

From the Schedule a Task link you are sent to the VMs Configuration page, and the Scheduled Tasks are opened. Click New Scheduled Task.

The options appear. Select the Take Snapshot link

In the appearing wizard you can specify the tasks’ details. Fill out the description, and choose a frequency that matches your schedule best

I would prefer a weekly snapshot (and later: removal after the sixth snapshot has been created). You can even get informed after the task has completed. Click Next >

Give the Task a name and fill choose whether or not to snapshot the VM’s memory, quiesce the system prior the snapshot takes place

Click Schedule the Task. You have now created a task that frequently creates a new snapshot

It is also possible to schedule a task to automatically remove snapshots after a certain snapshot age has passed. This basically follows the same pattern as the creation phase. Instead of Take a Snapshot from the dropdown box, simply select Delete Snapshots

From here you can schedule the task and eventually define the age after which the snapshot is deleted. Click Create the Task.

You will find an overview of the VM’s (snapshot) tasks here

When navigating back to the Snapshots page in vSphere, you will find the scheduled task that allows for deletion

Nice feature, right?

For those who are interested in automating this: you can also control the number of days by specifying the retentionDays property in the RemoveAllSnapshots_Task() vSphere API method, which can be consumed through PowerCLI or another implementation of the vSphere SDK.

By DM