vmCalgary
Enthusiast
Enthusiast

Deleting snapshots with exclusions

I'm looking for an efficient method of executing the following:

Make a variable ($vms) that is: VMs where snapshot name is not like "_GX_BACKUP_" or VM tag name is not "Keep Snaphot" and snapshot is older than 3 days.

I then want to report on what is going to be deleted to a csv (name of vm, vcenter, snapshot name, size, creator, age).

Then I want the snapshots deleted.

 

Our users in our lab env are keeping snapshots to go back and forth with vendors on projects and the 3 days best practices interferes with their projects. We also want to investigate why the backup tools didn't auto delete the GX_BACKUP snapshots.

 

I'll be testing this then scheduling it according to http://www.virtu-al.net/2009/07/10/running-a-powercli-scheduled-task/.

0 Kudos
1 Reply
LucD
Leadership
Leadership

What do you already have?

Btw, although Alan's script was great in 2009, we don't use PSSnapin anymore since quite some time.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos