cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post

VMs with snapshots older than XX days

Jump to solution

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.

0 Kudos
1 Solution

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

View solution in original post

2 Replies

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

View solution in original post

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

0 Kudos