搜索

8.2. Editing virtual machine templates

download PDF

You can update a virtual machine template in the web console, either by editing the full configuration in the YAML editor or by editing a subset of the parameters in the Virtual Machine Template Overview screen.

8.2.1. Editing a virtual machine template in the web console

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

Procedure

  1. Click Workloads Virtualization from the side menu.
  2. Click the Virtual Machine Templates tab.
  3. Select a virtual machine template to open the Virtual Machine Template Overview screen.
  4. Click the 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.

8.2.2. 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.

Not all parameters can 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 OpenShift Virtualization console, click Workloads Virtualization from the side menu.
  2. Click the Virtual Machine Templates tab.
  3. Select a template.
  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 the modification has been successful.

8.2.3. Adding a virtual disk to a virtual machine template

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

Procedure

  1. From the Virtual Machine Templates tab, select your virtual machine template.
  2. Select the Disks tab.
  3. Click Add Disks to open the Add Disk window.
  4. In the Add Disk window, specify Source, Name, Size, Interface, and Storage Class.

    1. 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 ConfigMap.
  5. Use the drop-down lists and check boxes to edit the disk configuration.
  6. Click OK.

8.2.4. Adding a network interface to a virtual machine template

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

Procedure

  1. From the Virtual Machine Templates tab, select the virtual machine template.
  2. Select the Network Interfaces tab.
  3. Click Add Network Interface.
  4. In the Add Network Interface window, specify the Name, Model, Network, Type, and MAC Address of the network interface.
  5. Click Add to add the network interface.
  6. Restart the virtual machine to enable access.
  7. Edit the drop-down lists and check boxes to configure the network interface.
  8. Click Save Changes.
  9. Click OK.

The new network interface displays at the top of the Create Network Interface list until the user restarts it.

The new network interface has a Pending VM restart Link State until you restart the virtual machine. Hover over the Link State to display more detailed information.

The Link State is set to Up by default when the network interface card is defined on the virtual machine and connected to the network.

8.2.5. Editing CD-ROMs for Virtual Machine Templates

Use the following procedure to configure CD-ROMs for virtual machines.

Procedure

  1. From the Virtual Machine Templates tab, select your virtual machine template.
  2. Select the Overview tab.
  3. To add or edit a CD-ROM configuration, click the pencil icon to the right of the CD-ROMs label. The Edit CD-ROM window opens.

    • If CD-ROMs are unavailable for editing, the following message displays: The virtual machine doesn’t have any CD-ROMs attached.
    • If there are CD-ROMs available, you can remove a CD-ROM by clicking -.
  4. In the Edit CD-ROM window, do the following:

    1. Select the type of CD-ROM configuration from the drop-down list for Media Type. CD-ROM configuration types are Container, URL, and Persistent Volume Claim.
    2. Complete the required information for each Type.
    3. When all CD-ROMs are added, click Save.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.