Find rogue snapshots within VMware

Requirements:

VMware vSphere PowerCLI

– VMware Virtual Center 4.0 +

Command:

Connect-VIServer <virtual center name or IP>

Get-VM  | Get-Snapshot | Where {$_.Name –match “<name of snapshots”} | <what to do with snapshots>

At the end I usually put:

Export-CSV <file path to csv>

After looking over the CSV you realize they all need to be removed, run the following:

Remove-Snapshot

Feel free to substitute the name matching part as I used this primarily for left over backup snapshots.

If you want to know the name of the server the snapshot is residing on, run the following:

Get-VM | foreach {if ($_ | Get-Snapshot) {$_.Name} }


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 )

Connecting to %s