Copy vmware vmdk files while vm is running

copyingvmware-esxvmware-vmdk

I need to copy some VMs from one datastore to another. I'm running ESX 3.5 U3, VMs are mostly Windows-based. I don't care about data integrity since it's only to test NetApps deduplication on the target destination and the VMs will never be running from this files. Since the VMs are used, i cannot shut them down. If I try to copy it with 'cp' of course I get errors complaining about locked files.

E.g.: "cp: cannot open ....vmdk' for reading: Device or resource busy"

Is there a trick to do this? With dd or cpio?

Regards

Best Answer

See this article and this one, seems like what you're looking for.

here's the process:

Taking a snapshot of the source VM using vmware-cmd.

Create a new VM and delete all vmdks in it

Copy the vmdk files from your snapshot into your new using vmkfstools.

Fix your configurations files accordinately.

Hope this helps.