This is a cache of https://docs.okd.io/latest/virt/creating_vm/virt-creating-vms-from-templates.html. It is a snapshot of the page at 2026-09-29T20:07:58.049+0000.
Managing VM <strong>template</strong>s - Creating virtual machines | Virtualization | OKD 4
×

About VM templates

VM templates define a reusable VM configuration. You can create a VM from a template to deploy a standardized VM quickly.

Speed up creation with boot sources

You can speed up VM creation by using templates that have an available boot source. A template with a boot source displays the Available boot source label if it does not have a custom label.

A template without a boot source displays the Boot source required label.

Customize before starting the VM

You can customize the disk source and VM parameters before you start the VM.

If you copy a VM template with all its labels and annotations, your version of the template is marked as deprecated when a new version of the Scheduling, Scale, and Performance (SSP) Operator is deployed. You can remove this designation. See "Removing a deprecated designation from a customized VM template by using the web console".

Single-node OpenShift

Due to differences in storage behavior, some templates are incompatible with single-node OpenShift. To ensure compatibility, do not set the evictionStrategy field for templates or VMs that use data volumes or storage profiles.

Creating a custom VM template in the web console

You can create a virtual machine template by editing a YAML file example in the OKD web console.

Procedure
  1. In the web console, click Virtualization → templates in the side menu.

  2. Optional: Use the Project drop-down menu to change the project associated with the new template. All templates are saved to the openshift project by default.

  3. Click Create template.

  4. Specify the template parameters by editing the YAML file.

  5. Click Create.

    The template is displayed on the templates page.

  6. Optional: Click Download to download and save the YAML file.

Enabling dedicated resources for a virtual machine template

You can enable dedicated resources for a virtual machine (VM) template in the OKD web console. VMs that are created from this template will be scheduled with dedicated resources.

Procedure
  1. In the OKD web console, click Virtualization → templates in the side menu.

  2. Select the template that you want to edit to open the template details page.

  3. On the Scheduling tab, click the edit icon beside Dedicated Resources.

  4. Select Schedule this workload with dedicated resources (guaranteed policy).

  5. Click Save.

Virtual machine template categories

You can assign a category to a virtual machine (VM) template to classify it by application type. Categories help you organize a growing template catalog and make it easier for VM consumers to find the right template.

Categories have the following characteristics:

  • A template can have only one category.

  • Category is optional. templates without a category display a blank Category field.

  • You can select a predefined category or create a custom category. The following predefined categories are available:

    • Databases

    • Operating-systems

    • Monitoring

    • Networking

    • Observability

    • Security

    • Storage

  • The cluster stores categories as the vm.kubevirt.io/category label on the VirtualMachinetemplate object.

  • The system normalizes custom category names to Kubernetes label-safe values. For example, it converts spaces to hyphens.

Category support by template type

OKD Virtualization supports three template types. Category support varies by type:

VirtualMachinetemplate (v1beta1)

Full category support. You can set a category when saving a VM as a template and edit the category after creation. The Category column on the templates list page displays the assigned application category.

VirtualMachinetemplate (v1alpha1)

Partial category support. You can edit the category after the template is created, but you cannot set a category during template creation. The v1alpha1 VirtualMachinetemplateRequest custom resource definition (CRD) does not support propagating labels to the created template. The Category column displays the assigned application category.

OpenShift template

Does not support categories. OKD templates use the workload profile instead. The Category column displays the workload profile, such as desktop or server.

Edit a VM template category

You can edit the category of a VirtualMachinetemplate object by using the OKD web console for either v1alpha1 or v1beta1 objects. Using the web console is the only way to assign a category to a v1alpha1 VirtualMachinetemplate object.

Prerequisites
  • You have access to the OKD web console.

  • You have edit or admin permissions on the template.

Procedure
  1. In the OKD web console, navigate to Virtualization → templates.

  2. Click the name of the VirtualMachinetemplate that you want to edit.

  3. On the template details page, click the Actions menu and select Edit category.

    You can also click the edit icon next to the Category field in the details grid.

  4. Select a category from the list, or type a custom category name.

  5. Click Save.

Verification
  • On the template details page, verify that the Category field displays the updated category.

  • Navigate to Virtualization → templates and verify that the Category column displays the updated category for the template.

Remove a category from a VM template

You can remove the category from a VirtualMachinetemplate object by using the OKD web console.

Prerequisites
  • You have access to the OKD web console.

  • You have edit or admin permissions on the template.

Procedure
  1. In the OKD web console, navigate to Virtualization → templates.

  2. Click the name of the VirtualMachinetemplate that you want to edit.

  3. On the template details page, click the edit icon next to the Category field.

  4. In the Edit category dialog, click the clear icon (x) in the Category field to remove the current category.

    The Category field displays the Select or create new placeholder text.

  5. Click Save.

Verification
  • On the template details page, verify that the Category field displays None.

Filter VM templates by category

You can filter virtual machine (VM) templates by category to quickly find templates that match a specific application type. You can filter by category from the templates list page or the Create VM wizard catalog.

Prerequisites
  • You have access to the OKD web console.

  • One or more templates have categories assigned.

Procedure
  1. In the OKD web console, navigate to one of the following locations:

    • Virtualization → templates to filter from the templates list page.

    • Virtualization → VirtualMachines → Create → Create from template to filter from the Create VM wizard catalog.

  2. In the filter toolbar, select the Category filter.

  3. Select one or more categories to narrow the template list.

Verification
  • Verify that only templates matching the selected categories are displayed.

Set a category when saving a VM as a template

You can optionally set a category when saving a virtual machine (VM) as a v1beta1 VirtualMachinetemplate. The category is stored as the vm.kubevirt.io/category label on the new template.

Setting a category during template creation is supported only for v1beta1 VirtualMachinetemplate objects. For v1alpha1 VirtualMachinetemplate objects, you must edit the category after the template is created.

Prerequisites
  • You have access to the OKD web console.

  • You have edit or admin permissions in the project.

  • You have a running or stopped VM.

Procedure
  1. In the OKD web console, navigate to Virtualization → VirtualMachines.

  2. Click the name of the VM that you want to save as a template.

  3. Click Actions → Save as template.

  4. In the template creation dialog, configure the template details.

  5. Optional: In the Category field, select a category from the list or type a custom category name.

  6. Click Save.

Verification
  • Navigate to Virtualization → templates and verify that the new template is displayed with the assigned category in the Category column.

VM template category column

The Category column on the Virtualization → templates list page displays different information depending on the template type.

Table 1. Category column behavior
template type Category support Category column value

VirtualMachinetemplate (v1beta1)

Full (set on creation or edit)

Shows the assigned category, such as Database or Web Server. Blank if no category is assigned.

VirtualMachinetemplate (v1alpha1)

Edit only (after creation)

Shows the assigned category. Blank if no category is assigned.

OpenShift template

Not supported

Shows the workload profile, such as desktop or server.

The cluster stores categories as the vm.kubevirt.io/category label on VirtualMachinetemplate objects. The system normalizes category values to Kubernetes label-safe strings. For example, "Operating systems" becomes operating-systems.

Removing a deprecated designation from a customized VM template by using the web console

You can customize an existing virtual machine (VM) template before you start the VM, by modifying the VM or template parameters, such as data sources, cloud-init, or SSH keys.

If you customize a template by copying it and including all of its labels and annotations, the customized template is marked as deprecated when a new version of the Scheduling, Scale, and Performance (SSP) Operator is deployed. You can remove the deprecated designation from the customized template.

Procedure
  1. Navigate to Virtualization → templates in the web console.

  2. From the list of VM templates, click the template marked as deprecated.

  3. Click Edit next to the pencil icon beside Labels.

  4. Remove the following two labels:

    • template.kubevirt.io/type: "base"

    • template.kubevirt.io/version: "version"

  5. Click Save.

  6. Click the pencil icon beside the number of existing Annotations.

  7. Remove the following annotation:

    • template.kubevirt.io/deprecated

  8. Click Save.