Cleaning up Veeam temporary snapshots

Hi all,

It is quite uncommon for Veeam temporary snapshots to remain around.  In fact, there is code in Veeam Backup & Replication that when it starts a job, it looks for any associated snapshots and cleans them up.

However, there can come a time when there are Veeam snapshots littered about.  I have Veeam customers that help our R&D with things and in return I help them out.  So when several of them had a power outage that ended up with a bunch of VMs with Veeam snapshots that were not being cleared up properly I shared a script to help with the clean up.  So I thought to share the script with you just in case it helps out.

Warning – make sure no backup jobs are in operation.  All jobs should be done for the day and in idle mode.

First, lets confirm you have some of those temporary snapshots.

Get-Snapshot -vm * -name “VEEAM BACKUP*” | Format-Table -property VM,Name

Good, we can see that some exist.  But what does this look like in the UI?

So we have some.  Howe to we clean them up easily?

 Get-Snapshot -vm * -name “VEEAM BACKUP*” | remove-snapshot

We answer the question with A for cleaning all VMs of their snapshot.

And they will be gone.  Depending how many, and how big, will determine how long, and you will see a progress bar if it takes a while. In my last test I had four and it only took a minute or two.  Storage speeds can impact this time as well as busy vCenters.

Thanks to Johan for help with the script!

So I hope that this helps, if you need it, and let me know if you have questions or comments.

Updates

  • 3/15/18 – testing and trying different scripts!
  • 3/13/18 – complete.

Michael

=== END ===

2 thoughts on “Cleaning up Veeam temporary snapshots

  1. Michael, helpful script.

    But it might be useful to add a parameter to show/remove snapshots older than X.
    That why snapshots of still running jobs won’t be affected.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.