When exporting a VM, it needs to update the lease with a percentage. In order to calculate the percentage, total size of vmdk files has to be extracted. httpNfcLeaseInfo.getTotalDiskCapacityInKB() doesn't report the actual size of all vmdk files, is there any other way? Noticed that in vSphere client, the percentage report during VM export is pretty accurate, so I assumed that there should be some way to get an accurate total size of vmdk files of a VM.
Hi Vmal,
I found the same issue while working on the OVF export sample. The disk capacity could be many times more than the actual size downloaded. This makes the progress monitoring not quite accurate as you would expect. It doesn't make any substantial impact on the exporting. The following sample works just fine.
If you very much care about the accuracy, you could find other ways to add up sizes.
Steve JIN
Author of VMware VI and vSphere SDK (Prentice Hall)
Creator of open source vSphere (VI) Java API(Tutorial, Testimonials, Download, Samples, Forum)
Blog: DoubleCloud.ORG ( Top 10 Best Practices,[Object Model|http://www.doublecloud.org/2010/02/object-model-of-vmware-vsphere-api-a-big-picture-in-2-minutes/],[Common Mistakes|http://www.doublecloud.org/2010/01/31/common-mistakes-using-vmware-vi-and-vsphere-sdk/], Tiny REST API, Cloud Application Architecture)
Thanks Steve. Yes, we do care about the accurancy because we need to report the progress similar to what's in vSphere client. What's "the other ways" to add up sizes?
Hi Steve,
Can you elaborate on "the other ways" described in your reply ealier?
Thanks!