3

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?

georgiev
  • 31
  • 1
  • 1
  • 2
  • 1
    Can you give us some more context on why you're doing this? What are you downloading the VMDK for? And where are you "downloading" it to? – ewwhite Sep 29 '16 at 17:18
  • 2
    But the file will be open and in-flux - you could clone the VM and then copy off the clone - but I suspect whatever it is you're trying to do could be done in a wildly better and more obvious way if you tell us what it is. – Chopper3 Sep 29 '16 at 17:22
  • @Chopper3 Do as Chopper3 suggested! – Orphans Sep 29 '16 at 17:54
  • Why You Need It? Backup? – Smithson Sep 30 '16 at 12:15

1 Answers1

4

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)
user121391
  • 2,502
  • 13
  • 31