Hi everyone
I am in the process of developing a script to cleanup after our backup software.
One of the tasks will be to find snapshots of a certain name and remove them. This is pretty straight forward.
However, since we have several vCenters linked and since, when a backup job dies, there can be quite a number of of snapshots to work through AND people sometimes don't notice for a few days that something was amiss, I would like to optimise this in a few key aspects:
When a vm has nothing but backup snaps to be deleted, I would like to tell it to delete them all at once, which should be way easier than doing one at a time.
To do that, I need to check all snapshots per vm and group the vms and or their snapshots into either the "delete all" category or the "delete individually" category.
I would like to use views to drill down the data and only work with objects when it is clear what has to be done where. For this I need a way to find all snapshots of a certain vm. I have no trouble finding all vms with snapshots but I have so far only found a way to find the active snapshot and the root snapshot.
I can of course traverse the snapshot chains in code but I find this rather inelegant...
So in short: Is there a quick way in get-view to find all snapshots belonging to a vm? Or is there a much easier way to do what I want in the first place?
Regards,
Marco