This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

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!

Thanks,

Dave

  • Hello,

    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.

    Thanks,

    Greg

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

    sum(
      for $datastoreFilename in /datastore/file/name
          return
            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:

    string-join(
        (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, ', '))), '')