Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

up vote 7 down vote accepted

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.

share|improve this answer
    
I've done this a few times, works a treat. You will need to go digging in the config files (vmx/.vmdk's) on the target system if you actually want to be able to power up the resulting VM's but if all you want to do is test dedupe then it shouldn't matter a lot if the resulting files can be used to power up a VM or not. –  Helvick Aug 11 '09 at 22:24

For anyone reading this thread that has VMware Workstation, then to produce an independent functioning copy (ie a backup) is not possible according to the user guide without shutting down the VM first. The Uranium backup application will copy VMs while they are running but it is not cheap (150 Euro's) for a small startup like mine. I found in practice that simply suspending the VM and copying the files to a backup location works fine; giving a fully independent copy. The VM is only offline during the copy phase, and will resume its programs and files state after the copy is done. When you start the backed up VM it will ask whether you have moved it or copied it. Copying the files of an active VM is understandably risky, as the backup may not function due to state changes during the backup. So I wrote a very basic script to suspend the VM, copy the files to another location, then Resume the VM. Send me an email if you would like a copy.

share|improve this answer

Try using the VMWare Standalone Converter and use it's "Copy a running machine" option. It will temporarily install an agent; but that should take care of your need to make sure the VM stays running during the conversion.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.