Cleaning up NetApp SnapManager for Virtual Infrastructure snapshots in VMware vSphere

NetApp_Logo

Cleaning up NetApp SnapManager for Virtual Infrastructure snapshots in VMware vSphere can be a pain if you have large number of VMs being backed up by SMVI. In my case there are snapshots that are consistently left behind like so:

Cleaning_up_NetApp_SMVI_snapshots_in_VMware_vSphere_1

which just pile up as the days go on. I think this is some sort of bug in either vSphere API or the way NetApp handles snapshotting during the backup window.

To have these snapshots cleared up after the backup jobs run I have written the following PowerShell script to deal with the situation:

My scripts are saved under D:\Scripts on the vCentre server so that’s where everything runs from.

Before executing the script you will need to run the following to save vCenter hostname, username and password in a credentials file:

For email alert section to work you need to modify $emailFrom and $emailTo variables.

All that’s left is to schedule the script to run on a daily basis and never have this problem again!

Example email you should get in your inbox once the script has done its job:

Cleaning_up_NetApp_SMVI_snapshots_in_VMware_vSphere_2

2 thoughts on “Cleaning up NetApp SnapManager for Virtual Infrastructure snapshots in VMware vSphere

  1. virgilio gonzales

    HI Adrian, thank you very much and this script worked perfectly and as described, and ran it via powershell ISe

  2. Adrian Kielbowicz Post author

    Virgilio, you are more than welcome – I am glad the script worked for you and did what was necessary 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.