Downloading vmdk from ESXi without stopping the virtual machine

vmware-esxivmware-vsphere

As the title says I want to download vmdk file from ESXi host without stopping the virtual machine. I tried to download the file from vSphere Client, from the data store browser, however it said that the file operation filed, later I was able to find that this is caused by the fact that the virtual machine is running, however I can't stop it, since the component is critical. Any ideas how to get the vmdk file?

Best Answer

Official way:

According to VMware specs, before copying, moving or downloading a VM (vmdk files), you need to consolidate/remove all existing VM snapshots and then power off the VM, no shortcuts here.

Unofficial way:

A potential alternative (unsupported by VMware) works only if you have an ACID-compliant file system with snapshot support underneath it (for example ZFS). For more details, see explanation and example in case of FreeNAS and for the VMware-related part also the old ghettoVCB backup script. The general idea is as follows:

  1. Commit all old snapshots (can take a long time) to have a clean starting point
  2. Quiesce your guest system if possible
  3. Create a VM snapshot
  4. Create a file system block-level snapshot
  5. Delete/consolidate the VM snapshot
  6. Store the file system snapshot offsite

Restore steps are the same, but in reverse order. Advantage of this solution is that you can test the restore for each image offsite without disturbing your initial VM in any way.

It depends on your situation if this is good enough for you. In my opinion there are certain cases where it is good:

  • If you want to quickly clone test systems that are automatically deleted afterwards
  • If you want to do frequent backups of very large systems where a restore is better than no restore, it seems to be the only way to avoid the downtime
  • Moving a large VM from system A to system B with minimal downtime (leveraging incremental snapshots)