Contributor
Contributor

How to clone a VM on a ESXI 6.5 server?

Jump to solution

I tried to copy the vmdk and vmx file from a original vm folder to a new vm folder on the web interface. But the size of vmdk file is only 561B. If I boot the VM I get the error "couldn't find disk file".

I also tried use the command "vmkfstools -i /vmfs/volumes/datastore/BaseVM/BaseVM.vmdk /vmfs/volumes/datastore/NewVM/newvm.vmdk", but I get a flat.vmdk in the newVM folder. And the VM could't boot, too.

I want to know what is the right way to clone a VM on a ESXI 6.5 server. Thanks.

Tags (1)
1 Solution

Accepted Solutions
Enthusiast
Enthusiast

Refer the link, it will be useful

6- Clone A virtual machine without vCenter in ESXI Free edition - YouTube  .....

Please consider marking this answer "correct" or "helpful" if you think your query have been answered correctly. Thanks, Srini

View solution in original post

0 Kudos
11 Replies
Immortal
Immortal

Do you know about the host client? https://<fqdn>/ui. Right-click a VM and clone.

0 Kudos
Contributor
Contributor

I'm using the https://Server_IP/ui. But I didn't find the "clone" button. I right click on a VM I see "Power, Guest OS, Snapshots, Console, Export, Unregister, Delete......" , but no "clone". menu.jpg

0 Kudos
Immortal
Immortal

My mistake, I could have sworn that was in the 6.5 host client. Are you using vCenter Server or no?

0 Kudos
Contributor
Contributor

No, I don't have vCenter Server. How can I do it?

0 Kudos
Immortal
Immortal

Probably the simplest way is to use the vmkfstools command with the -i flag. Make sure to specify the disk type with the -d flag at the end. Pre-create your destination directory, then issue the command that clones the source disk to the destination directory. When complete, you should have <name>.vmdk and a <name>-flat.vmdk files in that directory. Create a new VM using the wizard in the host client, delete the default blank disk, and select to use an exist disk. Browse and locate the cloned disk making sure to create your new VM with the same type of storage controller, otherwise it may not boot. You should be successful at that point.

0 Kudos
Enthusiast
Enthusiast

Refer the link, it will be useful

6- Clone A virtual machine without vCenter in ESXI Free edition - YouTube  .....

Please consider marking this answer "correct" or "helpful" if you think your query have been answered correctly. Thanks, Srini

View solution in original post

0 Kudos
Contributor
Contributor

I have tried this way on web client  yesterday but failed. The size of vmdk was only 561B in the new VM folder.

I tried it with vSphere client 6.0 on my ESXI 6.5 server just now. It works this time. I think the web client has some bugs.

Thanks for all of your helps.

0 Kudos
Immortal
Immortal

I tried this myself yesterday on an ESXi 6.5 U1 system using the method I outlined, and I had no problems. the .vmdk file is supposed to be very small as it's metadata descriptor only. The *-flat.vmdk is the disk extent (i.e., where the data is stored).

0 Kudos
Contributor
Contributor

I get two vmdk files, too. But it can't find disk when I boot the VM. I run ESXI 6.5a.

I success with Vsphere Client and fail with web client on the same way.

Anyway, thank you for your answer. Smiley Happy

0 Kudos
Contributor
Contributor

From my own experience, using the vCenter Converter Standalone is the simplest method.  Point it to your existing ESXi server, select the VM you want to clone, tell it to create it on the same (or different ESXi server), verify config of the new VM, and let if fly.  It will do P2V and V2V conversions, quite easily.  No need to copy files around, rename files, etc.  Let the tool do the work for you.

Contributor
Contributor

Does the Converter still work on 6.7? I just tried it on Ubuntu 18.04 VM and while the cloning was fast and convenient, the outcome was a seriously broken VM, missing eth adapter, VMware tools and who knows what.

0 Kudos