Converting virtual machines into templates
You have already learned how to deploy a virtual machine from a template in the Creating virtual machines from templates section. You will now learn how to create a template. You begin by creating a virtual machine and installing the operating system, application software, and patches you need for all the virtual machines you want to deploy. After you have finished creating your new virtual machine, you have to convert it into a template using the Set-VM
cmdlet, which you have already seen in the Modifying the settings of virtual machines section. Let's convert the VM1
virtual machine into a template:
PowerCLI C:\> Get-VM -Name VM1 | Set-VM -ToTemplate -Confirm:$false
The output of the preceding command is as follows:
Name ---- VM1
To confirm that VM1
is now a template, you can use the Get-Template
cmdlet to view all the templates:
PowerCLI C:\> Get-Template
The output of the preceding command is as follows:
Name ---- VM1
The Get-Template
...