2 Replies Latest reply on Jul 23, 2015 1:24 AM by tomas.kuty

    Excluding a folder from phantom snapshots query


      Hey everyone,


      Our NetApp SAN has the ability / option to show snapshots on the volume from within the volume.  For instance, we have an NFS share called Vol001, and it has a snapshot from 30 days ago.


      When browsing the volume, there is a .snapshot folder where I can actually go and view the files contained within the snapshot.  My SolarWinds Virtualisation Manager is picking up VMware shapshot files from within these folders and telling me some VM's may have phantom snapshot files.  I understand it's doing what it's meant to, but I'd like to be able to filter out snapshot files located within the .snapshot folder if possible.


      The original query is: sum(for $datastoreFilename in /datastore/file/name return if (matches($datastoreFilename, '-\d{6}\.vmdk')) then (if (/datastore/virtualMachine/snapshotSummary/file[name=$datastoreFilename]/name) then 0 else 1) else 0)


      I'm not entirely sure on how to modify this to exclude files within .snapshot.


      Any help would be greatly appreciated!




        • Re: Excluding a folder from phantom snapshots query



          We have exactly the same issue with NetApp NFS volumes.

          All array-based snapshots located in .snapshot folder are being reported by vMan as phantom snaps.


          Kindly let us know how we can remove .snapshot folder from reporting/discovery.




          • Re: Excluding a folder from phantom snapshots query

            To exclude a .snapshot folder you can modify the alert this way (see highlighted parts):


              for $datastoreFilename in /datastore/file/name
                    if (matches($datastoreFilename, '-\d{6}\.vmdk')
                    and not(matches($datastoreFilename, '\.snapshot')) )
                    then (
                        if (/datastore/virtualMachine/snapshotSummary/file[name=$datastoreFilename]/name)
                        then 0
                        else 1)
                    else 0)

            And here's the notification query:

                (for $datastoreFilename in /datastore/file[
            matches(h9:name,  '-\d{6}\.vmdk')
                        and not(matches(h9:name, '\.snapshot'))]/name
                    return (
                      if (/datastore/virtualMachine/snapshotSummary/file[name=$datastoreFilename]/name)
                      then ''
                      else concat($datastoreFilename, ', '))), '')