In vSphere 7.0 and later, you can edit the contents of the VM templates by checking them out, making the necessary changes, and checking them in.

You can track history of changes over time by using the vertical timeline view. The vertical timeline view provides you with detailed information about the different VM template versions, the updates that privileged users have made, and when the last change was made. By using the vertical timeline, you can revert VM templates back to their previous state or delete the previous version of a VM template.

In addition, you can deploy a virtual machine from the latest version of the VM template without any disruptions while it is checked out for update. You can update the virtual machine and check it back in into the same VM template.

Templates in Content Libraries

Templates are primary copies of virtual machines that you can use to deploy virtual machines that are customized and ready for use. Templates promote consistency throughout your vSphere environment. You can use the content library to store and manage templates of virtual machines and vApps. You can use VM templates and vApp templates to deploy virtual machines and vApps to a destination object, such as a host or a cluster.

Content libraries support two types of templates, the OVF Template type and the VM Template type.

In a content library, you can store and manage virtual machine templates as OVF templates or VM templates. vApps are always converted to OVF templates in the content library.

VM Templates in Content Libraries and in the vCenter Server Inventory

A VM template is a template of a virtual machine. You create a VM template by cloning a virtual machine into a template.

A VM template can be managed by vCenter Server or by a content library.

In previous releases of vSphere, you can manage VM templates only through the vCenter Server inventory list. When you cloned a virtual machine or a VM template to a content library template, the resulting content library item was in an OVF format. Starting with vSphere 7.0 Update 1, local content libraries support both OVF templates and VM templates. You choose the type of template when you clone the virtual machine into the content library.

When you create a VM template in a content library, the library item is backed by a VM template in the vCenter Server inventory. The content library item and the corresponding inventory object are related in the following ways.
  • If you convert the VM template in the vCenter Server inventory to a virtual machine, the corresponding VM template library item is also deleted.
  • If you rename the VM template in the vCenter Server, the corresponding VM template library item is also renamed.
  • If you rename the VM template library item the associated VM template in the vCenter Server inventory is also renamed.
  • If you delete the VM template in the vCenter Server inventory, the corresponding VM template library item is also deleted.
  • If you delete the VM template library item, the associated VM template in the vCenter Server inventory is also deleted.

OVF Templates in Content Libraries

In a content library, an OVF template is either a template of a virtual machine, or a template of a vApp. When you clone a virtual machine into a template in a content library, you choose whether to create an OVF template or a VM template. However, if you clone a vApp into a template in a content library, the resulting content library item is always an OVF template. Because the OVF format is actually a set of files, if you export the template, all the files in the OVF template library item (.ovf, .vmdk, .mf) are saved to your local system.

Differencies Between VM Templates and OVF Templates in Content Libraries

You can use both VM templates and OVF templates to deploy new virtual machines in your vSphere environment. However, the two types of templates have different properties and support different deployment options.

See the following table for a detailed list of the differences between VM templates and OVF templates in a content library.
Table 1. VM Templates and OVF Templates Properties
Property VM Templates in Content Library OVF Templates in Content Library
Datastore VM templates can be stored on any datastore that you have privileges to.
Note: VM templates cannot be stored in a library that uses NFS or SMB storage.
OVF templates can only be stored on the datastore that is associated with the content library.
Footprint The default one. Compressed or Thin.
Host/Datastore Maintenance Mode

When the host becomes inaccessible, VM templates are automatically migrated to another host.

When either the host or the datastore becomes inaccessible, you must manually migrate the OVF templates to another host or datastore.
Associated with a Host Yes. No.
Storage DRS Supported. Not supported.
Cross-vendor Compatibility Not supported. Supported.
Software License Agreement Not supported. Supported.
Encryption Supported.

You can create encrypted VM templates.

Not supported.

While OVF templates cannot be encrypted themselves, you can still deploy an encrypted virtual machine from an OVF template.

Deployment Options During the deployment of a VM template, hardware customization and guest OS customization are both supported. During the deployment of an OVF template, only guest OS customization is supported. Hardware customization is not supported.

The supported operations on a content library template are different depending on the template type. You can edit the settings for both OVF and VM templates. However, you can update, export, and clone a template only if it is an OVF template.

Check Out a Virtual Machine from a Template

In the vSphere Client, you can edit the VM templates and monitor the changes that have been made by other privileged users. You can perform the checkout operation to update a virtual machine from the VM template. During this process, the VM template is not available for checkout from other users, but they can deploy a virtual machine from the VM template without any disruptions.

When you check out a VM template, you cannot convert the virtual machine to a template or migrate the virtual machine to a different vCenter Server inventory.

Prerequisites

Verify that you have the following privileges:
  • Content library.Check out a template
  • Resource.Assign virtual machine to resource pool
  • Datastore.Allocate space
  • Virtual machine.Edit inventory.Create from existing
  • Virtual machine.Change Configuration.Set annotation
  • If you want to power on the checked out virtual machine, verify that you have the Virtual machine.Interaction.Power On privilege.

Procedure

  1. To check out a VM template
    Option Action
    From a content library
    1. Navigate to Menu > Content Libraries.
    2. To open a local library, click its name.
    3. On the Templates tab, select a VM template and click the Check out VM from this template button.
    From the vSphere Client inventory
    1. Navigate to Menu > VMs and Templates and click the VM template.
    2. Click the Versioning tab and in the vertical timeline view, click Check out VM from this template.
    The Check out VM from VM Template dialog box opens.
  2. On the Name and location page, enter a virtual machine name, select the virtual machine location, and click Next.
  3. On the Select compute resource page, select the compute resource for the checked out virtual machine and click Next.
  4. On the Review page, review the configuration.
  5. Choose whether to power on the virtual machine after checkout by selecting the Power on VM after checkout check box.
  6. Click Finish.

Results

The checked out virtual machine appears in the selected location marked with a blue circle icon. You can perform the necessary configuration changes.

What to do next

After you complete the virtual machine updates, you can check in the virtual machine back to the template.

Check In a Virtual Machine to a Template

After you check out a virtual machine from a template and update the virtual machine, you must check the virtual machine back into the VM template. When you check in the virtual machine to a template, you create a new version of the VM template containing the updated state of the virtual machine.

When you check in the virtual machine to the VM template, you allow the deployment of the last changes that you make to the virtual machine.

Prerequisites

Verify that the virtual machine is powered off or suspended. You cannot check in a powered on virtual machine to a VM template.

Required privileges:
  • Content library.Check in a template

Procedure

  1. To check in a virtual machine to a template:
    Option Action
    From a content library
    1. Navigate to Menu > Content Libraries.
    2. To open a content library, click its name.
    3. On the Templates tab, select a VM template and click Check in VM to template.
    From the vSphere Client inventory
    1. Navigate to Menu > VMs and Templates and click the VM template.
    2. Click the Versioning tab and in the vertical timeline view, click Check in VM to template.
    The Check in VM dialog box opens.
  2. To describe the change, enter a comment in Check in notes .
  3. Click Check in.

Results

The updated version of the VM template appears in the vertical timeline. You can see the check-in comment, the name of the user who made the changes, and the date of the change.

Discard a Checked Out Virtual Machine

If you check out a VM template and make no updates to the virtual machine or perform an update that you do not want to keep, you can discard the checked out virtual machine. Each time you check in the virtual machine back to the template, you create a new version of the VM template. You can discard the checked out virtual machine to avoid creating new versions or to prevent other users from using a faulty version.

Prerequisites

Required privileges:
  • Virtual machine.Inventory.Delete

Procedure

  1. To discard a checked out virtual machine:
    Option Action
    From a content library
    1. Navigate to Menu > Content Libraries.
    2. To open a local library, click its name.
    3. On the Templates tab, select a VM template.
    4. From the vertical timeline, click the horizontal ellipsis icon (horizontal ellipsis icon) that appears in the checked out VM template box and select Discard Checked Out VM.
    From the vSphere Client inventory
    1. Navigate to Menu > VMs and Templates and click the VM template.
    2. Click the Versioning tab in the vertical timeline.
    3. Click the horizontal ellipsis icon (horizontal ellipsis icon) that appears in the checked out VM template box, and select Discard Checked Out VM.
    The Discard Checked Out VM dialog box opens.
  2. To delete the checked out virtual machine and discard all changes, click Discard.

Results

You deleted the virtual machine from the inventory and discarded all changes.

Revert to a Previous Version of a Template

If the latest VM template contains changes that you no longer want to keep or you made a mistake during your last checkin, you can revert the VM template to the previous version.

Prerequisites

Required privileges:
  • Content library.Check in a template

Procedure

  1. To revert to a previous version of a template:
    Option Action
    From a content library
    1. Navigate to Menu > Content Libraries.
    2. To open a local library, click its name.
    3. On the Templates tab, select a VM template.
    From the vSphere Client inventory
    1. Navigate to Menu > VMs and Templates and click the VM template.
    2. Click the Versioning tab.
  2. From the vertical timeline, navigate to the previous state of the VM template, click the horizontal ellipsis icon (horizontal ellipsis icon), and select Revert to This Version.
    The Revert to Version dialog box opens.
  3. Enter a reason for the revert operation and click Revert.

Results

The VM template that you revert to becomes the current VM template.

Delete a Previous Version of a VM Template

Delete a previous version of a VM template if you no longer want to allow the use of the template. Deleting a VM template removes the template and its content from the inventory.

Prerequisites

Required privileges:
  • Content Library.Delete library item

Procedure

  1. To delete a previous version of a template:
    Option Action
    From a content library
    1. Navigate to Menu > Content Libraries.
    2. To open a local library, click its name.
    3. On the Templates tab, select a VM template.
    From the vSphere Client inventory
    1. Navigate to Menu > VMs and Templates and click the VM template.
    2. Click the Versioning tab.
  2. From the vertical timeline, navigate to the previous state of the VM template, click the horizontal ellipsis icon (horizontal ellipsis icon), and select Delete Version.
    The Confirm Delete dialog box opens.
  3. To delete permanently the VM template and its contents, click Yes.