Microsoft

How to Clone a Virtual Machine Without vCenter

Virtual machine cloning is a feature exclusive to vCenter Server but there is a workaround to this restriction . In this post, I will explain how to clone VMs on ESXi without vCenter Server using a vSphere client and shell commands.

Steps are very simple

First create a target VM with identical hardware and resources as assigned to the one you’re cloning ,source VM.

Copy the source VMDK files (disks) to the target VM’s folder.

Finally, attach the copied VMDKs to the target VM and verify that the clone boots up and works properly.

Note: If the VM being cloned includes snapshots, you must delete them first before using the cloning procedure here covered. Alternatively, try using vmksftools as per this KB.

Enable SSH on ESXi

Shell access is enabled from DCUI. Alternatively, you can start the TSM-SSH service using the embedded host client for recent releases of ESXi such as 6.5 or via the legacy vSphere client for older versions. PowerCLI is one more tool to Manage ESXi services  .

Determine the datastore, folder and VMDK names

Obtaining this information should be easy, since a standalone ESXi, more often than not, comes with a single local datastore. Regardless, you can get the details using a vSphere client or PowerCLI.

Using the host client, pull the settings for the VM and expand Hard Disk taking note of the Disk File value as you do. The bit enclosed by the square brackets corresponds to the datastore where the VM files reside. The bit immediately following the datastore name, is the VM folder name; it could be the case that the VM has multiple disks residing on different datastores and folders as per the example listed below. Finally, take note of all the VMDK filenames.

The same details can also be obtained from the Hardware Configuration pane while the VM is selected.

If you wish to use PowerCLI, you can execute either of the one-liner statements next listed. Both will return a list all the datastores associated with a given VM. In the example given, I’ve targeted a VM called Windows 7 which has three VMDKs (disks) spread across two datastores.


Rajesh Radhakrishnan

Share
Published by
Rajesh Radhakrishnan

Recent Posts

NAKIVO Backup & Replication v10.8 Released With New Features

Nakivo has released its new Backup and Replication solution Nakivo v10.8, which includes support for…

2 years ago

Oracle Cloud VMware Solution and Features

Oracle Cloud VMware Solution (OCVS) provides a customer-managed, native VMware-based cloud environment hosted in Oracle…

2 years ago

Vinchin Backup and Recovery Review

Vinchin is a professional provider of data protection solutions for enterprises. It provides a series…

2 years ago

VMware Cloud Disaster Recovery (VCDR) Solution Deployment And Configuration Part 2

In my previous blog post, I have explained about VMware Cloud Disaster Recovery (VCDR) Onboarding and…

2 years ago

How to Deploy vRNI Cloud With VMC on AWS

vRealize Network Insight helps you build an optimized, highly available, and secure network infrastructure across…

2 years ago

This SysAdmin Day, WIN with Hornetsecurity!

Can you believe it's here again? SysAdmin Day is back, and with it comes endless gratitude…

2 years ago