Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-26256

[RFE] Libvirt Compute Resource - Add UEFI option for image provisioning

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Duplicate
    • Icon: Undefined Undefined
    • None
    • None
    • Provisioning
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • 0

      Problem Statement

      Creating a VM from a disk image file always uses BIOS firmware.
      This means a disk with GPT and EFI partition does not boot.

      This is not related to PXE provisioning. This is a missing piece of config in libvirt's VM XML. UEFI hosts have an extra config compared to BIOS hosts.

      libvirt XML for UEFI
        <os firmware='efi'>
          <type arch='x86_64' machine='pc-q35-rhel9.4.0'>hvm</type>
          <firmware>
            <feature enabled='yes' name='enrolled-keys'/>
            <feature enabled='yes' name='secure-boot'/>
          </firmware>
          <loader readonly='yes' secure='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.secboot
      .fd</loader>
          <nvram template='/usr/share/edk2/ovmf/OVMF_VARS.secboot.fd'>/var/lib/libvirt/qemu/nvram/
      misc-rhel9.site3.example.com_VARS.fd</nvram>
          <boot dev='hd'/>
          <bootmenu enable='yes'/>
        </os>
      
      libvirt XML for BIOS
        <os>
          <type arch='x86_64' machine='pc-q35-rhel9.4.0'>hvm</type>
          <boot dev='hd'/>
        </os>
      

      There is no metadata in a QCOW2 file about how a disk should boot, so choice should probably be manual. VMware section does offer a way to select either BIOS or UEFI. Libvirt does not.

      My request may be related to this story.
      https://issues.redhat.com/browse/SAT-25808
      As a user, I want to be able to provision VMs on Libvirt with UEFI and SecureBoot

      User Experience & Workflow

      • Create a machine that boots with UEFI (maybe with virt-install --boot="uefi,hd,menu=on" ...)
      • Power it down.
      • Create a template file from its disk image file (maybe with virt-sparsify or virt-sysprep)
      • Register the template as an image in Satellite.
      • Provision a new machine with the template.
      • Power up the new machine.
      • Open a console. Messages for SeaBIOS and iPXE appear, then the message "Booting from Hard Disk...". Machine hangs.

      Requirements

      Provide an option to choose UEFI or BIOS.

      Or possibly do this automatically, by detecting the presence of an EFI partition. (I don't know how - running virt-filesystems would only show /dev/sda2)

      Business Impact

      None. I am preparing for customer engagements.

            Unassigned Unassigned
            nhardima1 Nicholas Hardiman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: