VMware Cloud Community
eos11
Contributor
Contributor

Any way to clone a vm with vsphere client or cli?

Hi, surprisingly, the vshpere client doesnt seem to have a  VM clone feature. Even workstation has this feature!

Are there recommended workarounds, e.g. using snaphost, ovfs, vcli or similar?    Im guessign we can remote desktop into a production Windows Machine in the DC, export an OVF to it, then reimport it back into vsphere using the vsphere client?  Is there a way to do it using the data store explorer without having to transfer the vm out of and back into the host?

We are trying to avoid vcenter, as we dont have a spare windows machine, AD servers, MS SQL lienses etc, and running it as a vm insde the one host its managing would seem like a less than optional solution (but somethign we could do if we had to).

Thanks,

0 Kudos
2 Replies
mwpreston
Hot Shot
Hot Shot

You can clone certain disks in the cli using the following command

vmkfstools -i <path to to old vmdk> <path to new vmdk>

Once you are done cloning the disks you can simply build a new VM, delete the disk that it creates by default, and attach your new cloned disks instead....Should fire up.  I've done this quite a few times!

0 Kudos
drooks
Contributor
Contributor

As you may already know, templates and cloning are available when the client is connected to a vCenter server.  Before we had the latter, we simply logged into the NFS server hosting the datastores and did a niced copy of the VM directory and its files.  We found that using nice and pushing the priority down to the bottom eliminated disk contention issues which would cause VMs to experience nasty hangs etc.

By the way, running vCenter on a VM is pretty standard practice.  You should be fine without a domain controller (AD server), no special MS SQL license is needed, and if the VM is down you can always manage the host by a direct session to the host itself.  In a one-host environment like yours there are really no downsides (other than cost).  As you add more hosts, it becomes more attractive.  We are now at six hosts in our QA lab and it's the only way to fly.

0 Kudos