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.
Refer the link, it will be useful
6- Clone A virtual machine without vCenter in ESXI Free edition - YouTube .....
Do you know about the host client? https://<fqdn>/ui. Right-click a VM and clone.
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".
My mistake, I could have sworn that was in the 6.5 host client. Are you using vCenter Server or no?
No, I don't have vCenter Server. How can I do it?
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.
Refer the link, it will be useful
6- Clone A virtual machine without vCenter in ESXI Free edition - YouTube .....
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.
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).
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.
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.
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.
Hi all,
If you turn on the setting so you can SSH into the ESXi server, I wrote a shell script that clones VMs and works pretty well:
https://grangerx.wordpress.com/2020/09/23/vmware-esxi-script-to-clone-a-vm/
I placed the file in /vmfs/volumes/datastore/_scripts_/clonevm
Thus, the usage is:
/vmfs/volumes/datastore1/_scripts_/clonevm.sh <servertoclone> <nameofclone>
It also lets you change the format of the VMDKs (thin, thick-eager, etc) as part of the clone operation if you desire.
Thanks,
GrangerX
Thanks,
GrangerX
Outstanding! Thank you very much for this, found it searching around.
Tried saving file in Windows and WINSCPing it over but it wouldn't work.
Found the note about the CRLF in the file.
Created the file using WINSCP and pasting it there and it worked like a charm.