title: Getting an instance's actual used (allocated) disk space in vmware with pyvmomi
body: <p>I've recently started using pyvmomi to get a detailed inventory of vmware servers prior to migrating instances into AWS.</p>
  
  <p>In the vcenter web interface, or vsphere client, I can inspect an instance and see its disks, and it'll tell me the disk size (provisioned), and how much of it is in use (used storage).</p>
  
  <p>From the samples github repo (<a href="https://github.com/vmware/pyvmomi-community-samples" rel="nofollow noreferrer">https://github.com/vmware/pyvmomi-community-samples</a>) I could quickly learn how to get information on the instances, so getting the disk size is trivial (there's even a question in SO that shows an easy way to get the drives - <a href="https://stackoverflow.com/questions/36026470/how-to-get-sizes-of-vmware-vm-disks-using-pyvmomi">How to get sizes of VMWare VM disks using PyVMomi</a>), but I can't figure out how to get the actual used storage the web/client can show.</p>
  
  <p>So, how do I get the used space for a given instance disks?</p>