Bug 1217444 - RFE: libvirt vmware driver does not expose the firmware/efi property
Summary: RFE: libvirt vmware driver does not expose the firmware/efi property
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: ---
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Pino Toscano
QA Contact: liuzi
URL:
Whiteboard:
Depends On: 1564270
Blocks: 1508299
TreeView+ depends on / blocked
 
Reported: 2015-04-30 11:45 UTC by Richard W.M. Jones
Modified: 2020-11-14 12:46 UTC (History)
13 users (show)

Fixed In Version: libvirt-5.3.0-1.el8
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-06 07:10:39 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
RHEL 7.1 UEFI.ovf (8.43 KB, text/plain)
2015-04-30 11:46 UTC, Richard W.M. Jones
no flags Details
RHEL 7.1 UEFI.xml (1.25 KB, text/plain)
2015-04-30 11:47 UTC, Richard W.M. Jones
no flags Details
RHEL 7.1 UEFI.vmx (3.11 KB, text/plain)
2015-04-30 11:57 UTC, Richard W.M. Jones
no flags Details
RHEL 7.1 Server.vmx (2.74 KB, text/plain)
2015-04-30 11:58 UTC, Richard W.M. Jones
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:3723 0 None None None 2019-11-06 07:11:24 UTC

Description Richard W.M. Jones 2015-04-30 11:45:17 UTC
Description of problem:

VMware can present either BIOS or UEFI to guests.

When you export such a guest as a VMware OVF, you can see in
the metadata that it records the presence of EFI:

      <vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="efi" />

(See attached OVF for the complete file)

However the libvirt XML equivalent contains no indication that
the guest requires EFI.

(See attached example from the same guest)

Version-Release number of selected component (if applicable):

I only tested this on Fedora, but I assume the same must hold
true on RHEL 7.
libvirt-1.2.14-2.fc23.x86_64

How reproducible:

100%

Steps to Reproduce:
1. Create a UEFI guest on VMware 5.5

2. Export it as an OVA.

3. Connect to the server using libvirt:
   virsh -c 'vpx://root@v2v-vcenter/Datacenter/vmware.home.annexia.org?no_verify=1' dumpxml "RHEL 7.1 UEFI"

The OVF & libvirt XML are attached.

Comment 1 Richard W.M. Jones 2015-04-30 11:46:36 UTC
Created attachment 1020568 [details]
RHEL 7.1 UEFI.ovf

Note in the attached OVF file the line:

<vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="efi" />

Comment 3 Richard W.M. Jones 2015-04-30 11:47:25 UTC
Created attachment 1020569 [details]
RHEL 7.1 UEFI.xml

The libvirt XML from the same guest.  Note there is no indication
that the guest requires EFI.

Comment 4 Richard W.M. Jones 2015-04-30 11:57:22 UTC
Created attachment 1020572 [details]
RHEL 7.1 UEFI.vmx

This is the vmx file from a UEFI guest.

$ grep -i firmware RHEL*.vmx
RHEL 7.1 UEFI.vmx:firmware = "efi"

Comment 5 Richard W.M. Jones 2015-04-30 11:58:07 UTC
Created attachment 1020573 [details]
RHEL 7.1 Server.vmx

This is the vmx file from a NON-UEFI guest.  Note that there
is no "firmware" line at all in this file.

Comment 6 Daniel Berrangé 2015-04-30 12:00:59 UTC
Currently in libvirt XML the only way to change the firmware type used is to supply a path to the firmware binary, eg

    <loader>/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>

While this works, it is rather horrible for applications to have to care about the long file paths. It is even worse because EFI firmeware for x86 has a different filepath than firmware for aarch64, so apps need to know about arch specific firmware paths. On vmware there is not even any concept of loader paths.

It would be nice if we extended the libvirt XML so that we can refer to the firmware types using short symbolic names. eg

   <loader type="bios|efi|...."/>

And then libvirt automatically fill in the correct filepath (if required). This would allow a nice mapping for the vmware VMX config, as also simplify EFI usage for KVM apps. The absence of any <loader> or type attribute would just signify to use the default firmware for the platform

Comment 10 Daniel Berrangé 2016-10-19 11:28:17 UTC
I've got an impl of this idea here (for KVM/QEMI only)

https://www.redhat.com/archives/libvir-list/2016-October/msg00045.html

this is something we could then wire up for VMWare too

Could you confirm that works from libguestfs POV before i merge it.

Comment 11 Richard W.M. Jones 2017-01-27 11:26:39 UTC
Just unsetting NEEDINFO.  I provided review comments on the patch:

https://www.redhat.com/archives/libvir-list/2016-October/thread.html#00045

There are a few problems which mean that it's not usable from
libguestfs in its present state unfortunately.

Comment 13 Richard W.M. Jones 2017-11-07 09:09:38 UTC
I posted an idea for implementing an interim fix:
https://www.redhat.com/archives/libvir-list/2017-November/msg00203.html

Comment 15 Pino Toscano 2019-05-07 13:43:05 UTC
Few years later...

There was work, part of libvirt 5.2.0, to do automatic firmware selection for QEMU: bug 1564270.
This allows guest XMLs to just specify the type of firmware with no need for paths of loader, etc -- for example:

  <os firmware='bios|efi'>
   ...
  </os>

Making use of this infrastructure (the XML additions, in particular), I exposed the firmware information of VMware guests in the XML:
https://www.redhat.com/archives/libvir-list/2019-April/msg00653.html

3958e3d6a5 docs: document firmware attribute for VMware guests
b4e34d1083 vmx: write firmware back from autoselection
9bb6e4e739 vmx: convert firmware config for autoselection

Part of libvirt 5.3.0.

Comment 17 liuzi 2019-07-15 08:47:48 UTC
Verify bug with build:
libvirt-5.5.0-1.module+el8.1.0+3580+d7f6488d.x86_64

Steps:
1.Create a rhel7.6 uefi guest on the ESX6.5 server

2.Export the ova file and check the firmware info from the ovf file
# cat esx6_5-rhel7.6-uefi.ovf  |grep firmware
      <vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="efi"/>

3.Check the firmware info from the guest's xml
# virsh -c vpx://root.73.141/data/10.73.196.89/?no_verify=1 dumpxml esx6.5-rhel7.6-uefi 
<domain type='vmware' xmlns:vmware='http://libvirt.org/schemas/domain/vmware/1.0'>
  <name>esx6.5-rhel7.6-uefi</name>
  ...
  <os firmware='efi'>
    <type arch='x86_64'>hvm</type>
  </os>

Result:
Libvirt vmware driver can expose the firmware/efi property,so change the bug from ON_QA to VERIFIED.

Comment 19 errata-xmlrpc 2019-11-06 07:10:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3723


Note You need to log in before you can comment on or make changes to this bug.