Of all the thousands of emails I sent to customers in 2013, I sent this code to most. I think I sent it to over 150 people last year.
People do a really crappy job of monitoring their backup applications, and if they have old snapshots in VMware. It doesn’t matter if you use Veeam, NetBackup, BEX, SMVI/VSC, manual scripts, or what. Anything that automatically makes snapshots and then deletes them has the chance to totally screw that crap up!
Biggest issues happen when snapshots aren’t cleaned up if they are left around.
Imagine, you had a 1am power outage, how often do you go investigating afterwards if you had open snaps in vmware that were not cleaned up?
Everyone should have this scripted to a scheduled task to send an email notification nightly.
1 2 3 4 5 6 7 8 9 10 |
param ( $Age = 2 ) $vm = Get-VM $snapshots = Get-Snapshot -VM $vm Write-Host -ForegroundColor Red "Old snapshots found:" foreach ( $snap in $snapshots ) { if ( $snap.Created -lt (Get-Date).AddDays( -$Age ) ) { Write-Host "Name: " $snap.Name " Size: " $snap.SizeMB " Created: " $snap.Created } } |
Comments are closed.