---
title: Creating virtual machines from templates
---

# Creating virtual machines from templates {#virt-creating-vms-from-templates}

You can create virtual machines (VMs) from Red Hat templates by using the OpenShift Container Platform web console.

## About VM templates {#virt-about-templates}

You can use VM templates to help you easily create VMs.

Expedite creation with boot sources
:   You can expedite VM creation by using templates that have an available boot source. Templates with a boot source are labeled **Available boot source** if they do not have a custom label.

    Templates without a boot source are labeled **Boot source required**. See "Managing automatic boot source updates" for details.

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

> [!NOTE]
> 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 VM from a template {#virt-creating-vm-from-template_virt-creating-vms-from-templates}

You can create a virtual machine (VM) from a template with an available boot source by using the OpenShift Container Platform web console. You can customize template or VM parameters, such as data sources, Cloud-init, or SSH keys, before you start the VM.

You can choose between two views in the web console to create the VM:

- A virtualization-focused view, which provides a concise list of virtualization-related options at the top of the view
- A general view, which provides access to the various web console options, including **Virtualization**

**Procedure**

1. From the OpenShift Container Platform web console, choose your view:

   - For a virtualization-focused view, select **Administrator** → **Virtualization** → **Catalog**.
   - For a general view, navigate to **Virtualization** → **Catalog**.
2. Click the **Template catalog** tab.
3. Click the **Boot source available** checkbox to filter templates with boot sources. The catalog displays the default templates.
4. Heterogeneous clusters only: To filter the search results to show templates associated with a particular architecture, click **Architecture Type** .
5. Click **All templates** to view the available templates for your filters.

   - To focus on particular templates, enter the keyword in the `Filter by keyword` field.
   - Choose a template project from the **All projects** dropdown menu, or view all projects.
6. Click a template tile to view its details.

   - Optional: If you are using a Windows template, you can mount a Windows driver disk by selecting the **Mount Windows drivers disk** checkbox.
   - If you do not need to customize the template or VM parameters, click **Quick create VirtualMachine** to create a VM from the template.
   - If you need to customize the template or VM parameters, do the following:

     1. Click **Customize VirtualMachine**. The **Customize and create VirtualMachine** page displays the **Overview**, **YAML**, **Scheduling**, **Environment**, **Network interfaces**, **Disks**, **Scripts**, and **Metadata** tabs.
     2. Click the **Scripts** tab to edit the parameters that must be set before the VM boots, such as `Cloud-init`, `SSH key`, or `Sysprep` (Windows VM only).
     3. Optional: Click the **Start this virtualmachine after creation (Always)** checkbox.
     4. Click **Create VirtualMachine**.

        The **VirtualMachine details** page displays the provisioning status.

## Removing a deprecated designation from a customized VM template by using the web console {#virt-customizing-vm-template-web_virt-creating-vms-from-templates}

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.

> [!NOTE]
> 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**.

### Creating a custom VM template in the web console {#virt-creating-template_virt-creating-vms-from-templates}

You can create a virtual machine template by editing a YAML file example in the OpenShift Container Platform 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 {#virt-dedicated-resources-vm-template_virt-creating-vms-from-templates}

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

**Procedure**

1. In the OpenShift Container Platform 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**.

**Additional resources**
{._additional-resources}

- [Managing automatic boot source updates](/openshift-docs-markdown/virt/storage/virt-automatic-bootsource-updates#virt-automatic-bootsource-updates)
