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.
- 9/21/18 - PowerShell on the Veeam Backup server is where I ran this but you can run it from anywhere in your environment.
- 3/15/18 - testing and trying different scripts!
- 3/13/18 - complete.
=== END ===
4 thoughts on “Cleaning up Veeam temporary snapshots”
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.
Great idea. I will need to work on that. Thanks.
Hi, thank for you help.
Where I can run this command?
You would run this on the backup server in PowerShell. I will update the article with that info too.