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 ...

Get Learning PowerCLI - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.