Editing virtual machine templates

You can update a virtual machine template in the web console, either by editing the full configuration in the YAML editor or by selecting a custom template in the Templates tab and modifying the editable items.

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.

Labels and annotations are editable for both preconfigured Red Hat templates and your custom virtual machine templates. All other values are editable only for custom virtual machine templates that users have created using the Red Hat templates or the Create Virtual Machine Template wizard.

Procedure

  1. Click WorkloadsVirtualization from the side menu.

  2. Click the Templates tab.

  3. Select a virtual machine template.

  4. Click the VM Template Details tab.

  5. Click the pencil icon to make a field editable.

  6. Make the relevant changes and click Save.

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

Editing virtual machine template YAML configuration in the web console

You can edit the YAML configuration of a virtual machine template from the web console.

Some parameters cannot be modified. If you click Save with an invalid configuration, an error message indicates the parameter that cannot be modified.

Navigating away from the YAML screen while editing cancels any changes to the configuration that you made.

Procedure

  1. In the OKD Virtualization console, click WorkloadsVirtualization from the side menu.

  2. Click the Templates tab.

  3. Select a template to open the VM Template Details screen.

  4. Click the YAML tab to display the editable configuration.

  5. Edit the file and click Save.

A confirmation message, which includes the updated version number for the object, shows that the YAML configuration was successfully edited.

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 WorkloadsVirtualization from the side menu.

  2. Click the Templates tab.

  3. Select a virtual machine template to open the VM Template Details screen.

  4. Click the Disks tab.

  5. In the Add Disk window, specify the Source, Name, Size, Type, Interface, and Storage Class.

    1. Advanced: 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: In the Advanced list, specify 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.

  6. Click Add.

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 WorkloadsVirtualization from the side menu.

  2. Click the Templates tab.

  3. Select a virtual machine template to open the VM Template Details screen.

  4. Click the Network Interfaces tab.

  5. Click Add Network Interface.

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

  7. Click Add.

Editing CD-ROMs for Templates

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

Procedure

  1. Click WorkloadsVirtualization from the side menu.

  2. Click the Templates tab.

  3. Select a virtual machine template to open the VM Template Details screen.

  4. Click the Disks tab.

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

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

  7. Click Save.