After you create a virtual machine, you can clone it to a template. Templates are primary copies of virtual machines that let you create ready-for-use virtual machines. You can make changes to the template, such as installing additional software in the guest operating system, while preserving the original virtual machine.
You cannot modify templates after you create them. To alter an existing template, you must convert it to a virtual machine, make the required changes, and convert the virtual machine back to a template. To preserve the original state of a template, clone the template to a template.
Prerequisites
If a load generator is running in the virtual machine, stop it before you perform the clone operation.
Verify that you have the following privileges:
- Virtual machine .Provisioning.Create template from virtual machine on the source virtual machine.
- Virtual machine .Inventory.Create from existing on a virtual machine folder where the template is created.
- Resource.Assign virtual machine to resource pool on the destination host, cluster, or resource pool.
- Datastore.Allocate space on all datastores where the template is created.
Procedure
- Start the Clone Virtual Machine To Template wizard.
Option Description Start the Clone Virtual Machine To Template wizard from any object in the inventory - Right-click any inventory object that is a valid parent object of a virtual machine, such as a data center, folder, cluster, resource pool, or host, and select New Virtual Machine > New Virtual Machine.
- On the Select a creation type page, select Clone virtual machine to template and click Next.
- On the Select a virtual machine page, select the virtual machine that you want to clone and click Next.
Start the Clone Virtual Machine To Template wizard from a template Right-click the virtual machine and select Clone > Clone to Template.
- On the Select a name and folder page, enter a name for the template and select a data center or a folder in which to deploy it.
The template name determines the name of the files and folder on the disk. For example, if you name the template win8tmp, the template files are named win8tmp.vmdk, win8tmp.nvram, and so on. If you change the template name, the names of the files on the datastore do not change.
Folders provide a way to store virtual machines and templates for different groups in an organization and you can set permissions on them. If you prefer a flatter hierarchy, you can put all virtual machines and templates in a data center and organize them a different way.
- On the Select a compute resource, select a host or a cluster resource for the template.
The Compatibility pane shows the result from the compatibility checks.Important:
If the virtual machine that you clone has an NVDIMM device and uses Pmem storage, the destination host or cluster must have available PMem resource.
If the virtual machine that you clone does not have an NVDIMM device but it uses Pmem storage, the destination host or cluster must have available PMem resource. Otherwise, all the hard disk of the template uses the storage policy and datastore selected for the configuration files of the source virtual machine.
- On the Select storage page, select the datastore or datastore cluster in which to store the virtual machine configuration files and all of the virtual disks. Click Next.
- Select the format for the virtual machine's disks.
Option Action Same format as source Use the same format as the source virtual machine. Thick Provision Lazy Zeroed Create a virtual disk in a default thick format. Space required for the virtual disk is allocated during creation. Any data remaining on the physical device is not erased during creation, but is zeroed out on demand at a later time on first write from the virtual machine. Thick Provision Eager Zeroed Create a thick disk that supports clustering features such as Fault Tolerance. Space required for the virtual disk is allocated at creation time. In contrast to the thick provision lazy zeroed format, the data remaining on the physical device is zeroed out during creation. It might take longer to create disks in this format than to create other types of disks. Thin Provision Use the thin provisioned format. At first, a thin provisioned disk uses only as much datastore space as the disk initially needs. If the thin disk needs more space later, it can grow to the maximum capacity allocated to it. - (Optional) Select a storage policy from the VM Storage Policy drop-down menu.
Storage policies specify storage requirements for applications that run on the virtual machine.
- Select the datastore location where you want to store the virtual machine files.
Your selection affects the storage creation process.
Option Action Store all virtual machine files in the same location on a datastore. - (Optional) Apply a virtual machine storage policy for the virtual machine home files and the virtual disks from the VM storage policy drop-down menu.
The list shows which datastores are compatible and which are incompatible with the selected virtual machine storage policy.
- Select a datastore and click Next.
Store all virtual machine files in the same datastore cluster. - (Optional) Apply a virtual machine storage policy for the virtual machine home files and the virtual disks from the VM storage policy drop-down menu.
The list shows which datastores are compatible and which are incompatible with the selected virtual machine storage profile.
- Select a datastore cluster.
- (Optional) If you do not want to use Storage DRS with this virtual machine, select Disable Storage DRS for this virtual machine and select a datastore within the datastore cluster.
- Click Next.
Store virtual machine configuration files and disks in separate locations. - Click Advanced.
- For the virtual machine configuration file and for each virtual disk, click Browse and select a datastore or datastore cluster.
- Apply a virtual machine storage policy from the VM storage profile drop-down menu.
The list shows which datastores are compatible and which are incompatible with the selected virtual machine storage policy.
- (Optional) If you selected a datastore cluster and do not want to use Storage DRS with this virtual machine, select Disable Storage DRS for this virtual machine and select a datastore within the datastore cluster.
- Click Next.
Store all virtual machine files in the same non-volatile memory disk - (Optional) Apply a virtual machine storage policy for the virtual machine home files and the virtual disks from the VM storage policy drop-down menu.
- Select a non-volatile memory disk and click Next.
- (Optional) Apply a virtual machine storage policy for the virtual machine home files and the virtual disks from the VM storage policy drop-down menu.
Important: You cannot change the storage policy if you clone an encrypted virtual machine. For information about cloning an encrypted virtual machine, see vSphere Security. - Select the format for the virtual machine's disks.
- On the Ready to complete page, review the template settings and click Finish.
The progress of the clone task appears in the Recent Tasks pane. When the task completes, the template appears in the inventory.