You can use PowerCLI to create virtual machines templates and convert them to virtual machines on vSphere.


A virtual machine template is a reusable image created from a virtual machine. The template, as a derivative of the source virtual machine, includes virtual hardware components, an installed guest operating system, and software applications.

Connect to a vSphere server.


Create a template from the VM1 virtual machine.

New-Template -VM VM1 -Name VM1Template -Location (Get-Datacenter DC )

Convert the VM1Template template for use by a virtual machine named VM3.

Get-Template VM1Template | Set-Template -ToVM -Name VM3

Create a template from the VM2 virtual machine.

New-Template -VM VM2 -Name VM2Template -Location (Get-Datacenter DC )

Convert the VM2Template template to a virtual machine named VM4.

Get-Template VM2Template | Set-Template -ToVM -Name VM4

Convert the VM4 virtual machine to a template.

Set-VM –VM VM4 –ToTemplate –Name “VM4Template”

Create a template called VM3Template by cloning VM2Template.

Get-Template VM2Template | New-Template -Name VM3Template –VMHost $targetVMHost