VMware Cloud Community
jamesmanning
Contributor
Contributor

Fastest way to get all snapshots on a vcloud server?

Get-CIVM gets the VMs quickly enough, but to get the snapshots I'm currently accessing $vm.ExtensionData.GetSnapshotSection().Snapshot which is taking around 600ms per VM because of the API calls it needs to do, and there's thousands of VMs so that takes awhile

Is there a faster way of just getting the snapshots and the VMs that have them? I tried seeing if I could do so with Search-Cloud but haven't had any luck yet.

It looks like there used to be a Get-CISnapshot cmdlet but I can't find it in PowerCLI now, not sure if it would have helped or not.

0 Kudos
1 Reply
Macleud
Enthusiast
Enthusiast

$vm = Search-Cloud -QueryType AdminVM -Filter "IsVAppTemplate==false" | get-ciview
$vm | where {$_.GetSnapshotSection().Snapshot -ne $null}

But it’s not fast either.

Perhaps it is better to do it in the vcenter?

0 Kudos