Alerting for snapshots not removed after backup

Last post 01-31-2020, 6:08 AM by Guy Heaton. 2 replies.
Sort Posts: Previous Next
  • Alerting for snapshots not removed after backup
    Posted: 01-30-2020, 2:55 AM

    Hi All,

    Is there a way within Commvault that I can setup an alert to notify me when a snapshot within Vmware or a hot clone within OVM (Oracle Virtual Machine Manager) is not removed after a backup. Have seen this happen a few times and have engineers checking on a weekly basis.

    I have seen information on how to setup a script for Vmware that will un on a seperate server but wanted to know if there was something that could alert from Commvault.

    Thanks

    Tom

  • Re: Alerting for snapshots not removed after backup
    Posted: 01-30-2020, 7:27 AM

    I've never found one, so I use powershell scripts to search for snaps with "gx-backup" in the name.


    Regards

    Guy
  • Re: Alerting for snapshots not removed after backup
    Posted: 01-31-2020, 6:08 AM

    #delete GX_BACKUP snapshots.

     

    $Vserverslist = ("XXX","XXXX")
    $mycol2 =@()

    foreach($Vserver in $Vserverslist)
    {

    $outputfile2 = "C:\scripts\Commvault\" + $vserver + "_deleted_GX_snaps.csv"
    if (Test-Path $outputfile2) {Remove-Item $outputfile2}
    else {}

    # connect to the VSserver
    Connect-VIServer $Vserver
    $vms = Get-VM | sort name

     ForEach ($vm in $vms){
      $snapshots = Get-SnapShot -VM $vm
      if ($snapshots.Name.Length -ige 1 -or $snapshots.length){
       ForEach ($snapshot in $snapshots) {
        $myObj = "" | Select-Object VM, Snapshot, Description, VSServer                            
        $myObj.VM = $vm.name
                    $myObj.Snapshot = $snapshot.name
                    $tmon = $snapshot.name                      
                    $myObj.Description = $snapshot.description
        $myObj.VSserver = $Vserver
                                                           
                    if ($tmon.Contains("GX_BACKUP") -And ($snapshot.Created -lt (Get-Date).AddHours(-12))) {               
                      Remove-snapshot -Snapshot $snapshot -Removechildren -Confirm:$false
                      #log the delete
                      $myCol2 += $myObj
                      }
        }
       }
              }
      
        $mycol2 | Export-Csv $outputfile2 -NoTypeInformation -UseCulture

    Disconnect-VIServer –Server * -Force -Confirm:$false

    $myCol2 = @()
    $vms = ""

    $theday=Get-Date -format D
    $emto="XXXXX"
    $emfrom="XXXXX"
    $emser="XXXXX"

    $emsub = "GX BACKUP Snapshots deleted for " + $vserver + "_" + $theday
    send-mailmessage -To $emto -From $emfrom -Subject $emsub -smtpserver $emser -Attachments $outputfile2


    Regards

    Guy
The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Close
Copyright © 2020 Commvault | All Rights Reserved. | Legal | Privacy Policy