This is a cache of https://docs.openshift.com/container-platform/4.7/virt/virtual_machines/virtual_disks/virt-creating-and-using-boot-sources.html. It is a snapshot of the page at 2024-11-29T22:30:56.686+0000.
Creating and using boot sources - Virtual machines | OpenShift Virtualization | OpenShift Container Platform 4.7
×

A boot source contains a bootable operating system (OS) and all of the configuration settings for the OS, such as drivers.

You use a boot source to create virtual machine templates with specific configurations. These templates can be used to create any number of available virtual machines.

Quick Start tours are available in the OpenShift Container Platform web console to assist you in creating a custom boot source, uploading a boot source, and other tasks. Select Quick Starts from the Help menu to view the Quick Start tours.

Prerequisites
  • To add a boot source, you must be logged in as a user with the os-images.kubevirt.io:edit RBAC role or as an administrator. You do not need special privileges to create a virtual machine from a template with a boot source attached.

For information about requirements for Microsoft Windows, refer to Creating installation media for Windows boot sources.

Adding a boot source for a virtual machine template

A boot source can be configured for any virtual machine template that you want to use for creating virtual machines or custom templates. When virtual machine templates are configured with a boot source, they are labeled Available in the Templates tab. After you add a boot source to a template, you can create a new virtual machine from the template.

There are four methods for selecting and adding a boot source in the web console:

  • Upload local file (creates PVC)

  • Import via URL (creates PVC)

  • Clone existing PVC (creates PVC)

  • Import via Registry (creates PVC)

Prerequisites
  • To add a boot source, you must be logged in as a user with the os-images.kubevirt.io:edit RBAC role or as an administrator. You do not need special privileges to create a virtual machine from a template with a boot source added.

  • To upload a local file, the operating system image file must exist on your local machine.

  • To import via URL, access to the web server with the operating system image is required. For example: the Red Hat Enterprise Linux web page with images.

  • To clone an existing PVC, access to the project with a PVC is required.

  • To import via registry, access to the container registry is required.

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

  2. Click the Templates tab.

  3. Identify the virtual machine template for which you want to configure a boot source and click Add source.

  4. In the Add boot source to template window, click Select boot source, select a method for creating a persistent volume claim (PVC): Upload local file, Import via URL, Clone existing PVC, or Import via Registry.

  5. Optional: Click This is a CD-ROM boot source to mount a CD-ROM and use it to install the operating system on to an empty disk. The additional empty disk is automatically created and mounted by OpenShift Virtualization. If the additional disk is not needed, you can remove it when you create the virtual machine.

  6. Enter a value for Persistent Volume Claim size to specify the PVC size that is adequate for the uncompressed image and any additional space that is required.

    1. Optional: Enter a name for Source provider to associate the name with this template.

    2. Advanced: Click Storage class and select the storage class that is used to create the disk.

    3. Advanced: Click Access mode and select an access mode for the persistent volume. Supported access modes are: Single User (RWO), Shared Access (RWX), and Read Only (ROX).

    4. Advanced: Click Volume mode if you want to select Block instead of the default value Filesystem.

  7. Select the appropriate method to save your boot source:

    1. Click Save and upload if you uploaded a local file.

    2. Click Save and import if you imported content from a URL or the registry.

    3. Click Save and clone if you cloned an existing PVC.

Your custom virtual machine template with a boot source is listed in the Templates tab, and you can create virtual machines by using this template.

Creating a virtual machine from a template with an attached boot source

After you add a boot source to a template, you can create a new virtual machine from the template.

Procedure
  1. In the OpenShift Container Platform web console, click Workloads > Virtualization in the side menu.

  2. From the Virtual Machines tab or the Templates tab, click Create and select Virtual Machine with Wizard.

  3. In the General step, select an OS from the Operating System list that has the (Source available) label next to the OS and version name. The (Source available) label indicates that a boot source is available for this OS.

  4. In the Select a template step, select an OS from the Operating System list that has the (Source available) label next to the OS and version name. The (Source available) label indicates that a boot source is available for this OS.

  5. Click Review and Confirm.

  6. Review your virtual machine settings and edit them, if required.

  7. Click Create Virtual Machine to create your virtual machine. The Successfully created virtual machine page is displayed.

Additional resources