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'm pretty new to all the VMware world, so this is probably mainly a question about the right set of documentation to look at. I'm trying to clone/copy a VM that I installed on an ESXi installation.

I was trying to follow along with the top example here: http://serverfault.com/questions/16320/is-there-a-way-to-clone-an-existing-vm-on-an-esxi-server-without-having-to-re-imp

However, I'm using the vSphere client to connect to the ESXi box and manage it, and the vSphere client is telling me it won't let me rename the vmdk file.

The real answer I want is how do I clone the VM I installed if I want to spin up 5 copies. Is there another utility I can use to copy the vmdk file, then create a new virtual machine using it? Any idea why they nerfed the feature in vSphere client?

share|improve this question
    
did you shutdown the source vm first? –  Zypher May 5 '10 at 3:09
add comment

7 Answers

up vote 7 down vote accepted
+100

The best way to do this, is to enable SSH access. You may then use the normal compliment of CLI utilities, such as vmkfstools, or simply copy the folder. Shut down the VM, then perform the copy. Once the copy is complete, browse the datastore, enter the new folder, right-click on the new .vmx file and select 'Add to inventory'.

share|improve this answer
    
Thank you, this is what I was looking for. –  Zak May 24 '10 at 18:05
1  
the datastore is under /vmfs/volumes/DATASTORENAME - usually /vmfs/volumes/datastore1 –  Stefano May 27 '11 at 14:11
add comment

You could download the file using the vSphere client: Open Configure tab on the host, go to Storage, Find the storage device the source is on, right click, and select browse, browse to the location, and then download the file using the download button at the top.

Once downloaded to your OS, rename the file, and re-upload to the new location using the same method as above, but upload, instead of download.

Hope this helps

share|improve this answer
add comment

If the VM is running you cannot simply copy or rename the .VMDK files any more than you could rename an SQL .MDF database file while the database is mounted. The only simple way around this short of cloning using converter, or shutting down the VM is to take a snapshot using the Create Snapshot button on the toolbar in the vSphere client. This will create a changes only VMDK that is locked and unlock the exclusive access to the original VMDK file. Then you can copy the file to another location, then delete (not roll back) the snapshot to get rid of it. If you don't delete the snapshot it will grow forever as more blocks change on the VM disk.

I hope that helps.

share|improve this answer
    
The VM is powered off. I created a snapshot on 4-30, and copied the disk file after that. I'm still unable to rename the copied vmdk file. –  Zak May 5 '10 at 17:28
    
You don't need a snapshot if the VM is powered off. –  Skyhawk May 20 '10 at 1:31
add comment

Cloning is apparently considered an enterprise feature, making it a selling point of vCenter. The best options are Converter, as mentioned by lrosa, or using the vmkfstools command to clone only the VM. vmkfstools requires the Command Line Interface, and is documented here:

www.vmware.com/pdf/vsphere4/r40/vsp_40_vcli.pdf

share|improve this answer
add comment

It is a long process, but you can use vmware Converter to download and upload the vm

share|improve this answer
add comment

As Joe suggested, if you are planning to do this regularly you should probably enable SSH access and use the tools available there. One other possibility would be using NFS/iSCSI for remote storage of VMs, and handle file operations from the file server or any other host with access to the volume.

share|improve this answer
add comment

simple and powerfull http://www.pgregg.com/projects/vmclone/

share|improve this answer
add comment

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.