title: How do I compact a virtual disk using pyVmomi?
body: <p>In VirtualBox I have been using the command:</p>
  
  <pre><code>VBoxManage.exe modifymedium disk disk.vdi --compact
  </code></pre>
  
  <p>In order to reduce the size of .vdi files after running zerofree.  I'd like to do the same for vSphere virtual disks using pyVmomi.  I've seen you can use the command</p>
  
  <pre><code>vmkfstools --punchzero disk.vmdk
  </code></pre>
  
  <p>But this seems to require ESXi host shell access which I don't have.</p>