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.

VMs with snapshots older than XX days

We've been using the widget: "Top XX VMs by Snapshot Disk Usage" for a while now.  It was working good until we started doing replication jobs which create replicas and snapshots all the time.

Does anyone have an example or can create a custom SWQL to create the same thing but either filtering out anything with "replica" which is what we add to the VM names for the replicas?.

Thanks for any help that is given.

  • Simplified version (it doesn't list "first" related datastore as the canned widget) of query you can use in custom SWQL widget

    SELECT TOP 20

    vm.VirtualMachineID,

    vm.DetailsUrl,

    vm.Name,

    vm.SnapshotStorageSize,

    vm.PlatformID,

    vm.Status,

    vm.IPAddress,

    vm.Host.Hostname

    FROM Orion.VIM.VirtualMachines vm

    WHERE vm.Name NOT LIKE '%YOUR_REPLICA_NAME_PATTERN%'

    ORDER BY vm.SnapshotStorageSize DESC

  • Awesome, thanks for the help on this.

    I modified it a bit for what data we want and removed any with a size of ZERO and ended up with this:

    SELECT TOP 20

    vm.Name,

    vm.SnapshotStorageSize,

    vm.IPAddress,

    vm.Host.Hostname

    FROM Orion.VIM.VirtualMachines vm

    WHERE vm.Name NOT LIKE '%_replica%' AND

    vm.SnapshotStorageSize <> 0

    ORDER BY vm.SnapshotStorageSize DESC

    Appreciate the help lukas.vondruska