I've searched the VMware Community, looking for the key to getting the whole snapshots' size for a single VM via vSphere SDK such as Perl or Java Edition, instead of using the powerCLI command 'Get-VM | Get-Snapshot ' (it's meaningless to me namely).
And I do get some ideas from the existing discussions in this community, although there's no API to getting the whole snapshots' size directly.
Here's the useful link with core code displayed in JAVA style:
In the discussion,
I think it's a good way to gathering the whole snapshots size indirectly.
What I actually want to know is, is it accurate enough to summary the snapshots' size for one VM.
Here's my demo code of getting the whole snapshots' size via vSphere Perl SDK. You can run it like this: ./calaSnapshotSizeForVM.pl --vm vm_name --server vc_ip --username account_name --password account_pwd
I hope someone else can help to give me some advise/suggestion, or another way of getting the data.
Thank you all in advance!
Jin Rong 2016/09/05.