Over the weekend, I was trying to export a virtual machine from vSphere using ovftool command line. To my surprise, it was extremely slow. In fact, I wasn’t patient enough to wait for its finish and “Contrl+C” it. Initially I was thinking it could be ovftool issue, so I tried exporting from vSphere Client directly. Still very slow and I had to cancel it as it would run for a few hours according to the progress dialog box.
To root cause the problem, I tried:
Lost VMs or Containers? Too Many Consoles? Too Slow GUI? Time to learn how to "Google" and manage your VMware and clouds in a fast and secure HTML5 App.
- Restart the vCenter vpxd service
- Reboot vCenter server
- Connect vSphere Client directly to the ESXi server
- Reboot ESXi
Nothing changed – still extremely slow.
I had similar virtual machine exported consistently within 10 minutes before. The virtual machine is configured with two disks, one of which is pretty small and the other is 1TB. Both virtual disks are thin provisioned. When successfully exported as before, the OVA file size should be 800MB or less.
As I posted a question on the vExpert forum, I got helps from Steve Kaplan who thought it’s a VM related issue. It reminded me to go on another test: deploy the previously exported OVA to a VM, and export it again to OVA. The magic happened – the export was done in 10 minutes.
Now, what is the difference of the my current VM and the newly deployed? After comparing the datastore folders of both VMs, I found that my current VM has a snapshot and the newly deployed does not. It then started to make sense: when a virtual disk has a snapshot, it will have to first combine the original disk and snapshot delta disk into current one. Regardless the thin provisioned format, the combination process may have been done as if it were normal disk. In my case, the exporting of the VM is like exporting a thick provisioned 1TB VM.
So I decided to consolidate the virtual disks and see whether it could make any difference. Luckily, it worked.
The key takeaway from reading this post is:
MAKE SURE NO SNAPSHOT when exporting a VM regardless it’s thin provisioned.