Editing virtual machine templates

You can edit a virtual machine template in the web console.

You cannot edit a template provided by the Red Hat Virtualization Operator. If you clone the template, you can edit it.

Editing a virtual machine template in the web console

Edit select values of a virtual machine template in the web console by clicking the pencil icon next to the relevant field. Other values can be edited using the CLI.

You can edit labels and annotations for any templates, including those provided by Red Hat. Other fields are editable for user-customized templates only.

Procedure

  1. Click VirtualizationTemplates from the side menu.

  2. Optional: Use the Filter drop-down menu to sort the list of virtual machine templates by attributes such as status, template, node, or operating system (OS).

  3. Select a virtual machine template to open the Template details page.

  4. Click any field that has the pencil icon, which indicates that the field is editable. For example, click the current Boot mode setting, such as BIOS or UEFI, to open the Boot mode window and select an option from the list.

  5. Make the relevant changes and click Save.

Editing a virtual machine template will not affect virtual machines already created from that template.

Virtual machine template fields

The following table lists the virtual machine template fields that you can edit in the OKD web console:

Table 1. Virtual machine template fields
TabFields or functionality

Details

  • Labels

  • Annotations

  • Display name

  • Description

  • Workload profile

  • CPU/Memory

  • Boot mode

  • GPU devices

  • Host devices

YAML

  • View, edit, or download the custom resource.

Scheduling

  • Node selector

  • Tolerations

  • Affinity rules

  • Dedicated resources

  • Eviction strategy

  • Descheduler setting

Network Interfaces

  • Add, edit, or delete a network interface.

Disks

  • Add, edit, or delete a disk.

Scripts

  • cloud-init settings

Parameters (optional)

  • Virtual machine name

  • cloud-user password

Adding a network interface to a virtual machine template

Use this procedure to add a network interface to a virtual machine template.

Procedure

  1. Click VirtualizationTemplates from the side menu.

  2. Select a virtual machine template to open the Template details screen.

  3. Click the Network Interfaces tab.

  4. Click Add Network Interface.

  5. In the Add Network Interface window, specify the Name, Model, Network, Type, and MAC Address of the network interface.

  6. Click Add.

Adding a virtual disk to a virtual machine template

Use this procedure to add a virtual disk to a virtual machine template.

Procedure

  1. Click VirtualizationTemplates from the side menu.

  2. Select a virtual machine template to open the Template details screen.

  3. Click the Disks tab and then click Add disk.

  4. In the Add disk window, specify the Source, Name, Size, Type, Interface, and Storage Class.

    1. Optional: You can enable preallocation if you use a blank disk source and require maximum write performance when creating data volumes. To do so, select the Enable preallocation checkbox.

    2. Optional: You can clear Apply optimized StorageProfile settings to change the Volume Mode and Access Mode for the virtual disk. If you do not specify these parameters, the system uses the default values from the kubevirt-storage-class-defaults config map.

  5. Click Add.

Editing CD-ROMs for Templates

Use the following procedure to edit CD-ROMs for virtual machine templates.

Procedure

  1. Click VirtualizationTemplates from the side menu.

  2. Select a virtual machine template to open the Template details screen.

  3. Click the Disks tab.

  4. Click the Options menu kebab for the CD-ROM that you want to edit and select Edit.

  5. In the Edit CD-ROM window, edit the fields: Source, Persistent Volume Claim, Name, Type, and Interface.

  6. Click Save.