Bug 1290928 - Support for PXE bios & uefi with libvirt networking
Support for PXE bios & uefi with libvirt networking
Status: ASSIGNED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.2
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Michal Privoznik
yalzhang@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-11 17:57 EST by Ben Breard
Modified: 2017-05-02 11:13 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ben Breard 2015-12-11 17:57:56 EST
Description of problem:

The default libvirt networking & integrated dnsmasq work great for PXE, but it's very inconvenience to switch back and forth between a bios and uefi NBP. dhcpd (and dnsmasq) provides an easy way to detect the client and send the correct NBP. We need a way to configure this from libvirt's network config.

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

How reproducible:
100%

Expected results:

Today this is configured using virsh net-edit [network] and adding these two lines:
      <tftp root='/var/lib/tftpboot'/>
      <bootp file='pxelinux.0'/>

This can be hard coded for either bios or uefi. We document [1] how to detect the client with dhcpd:

  class "pxeclients" {
      match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
      next-server 10.0.0.1;

      if option architecture-type = 00:07 {
        filename "uefi/shim.efi";
      } else {
        filename "pxelinux/pxelinux.0";
      }


[1] https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installation-server-setup.html#sect-network-boot-setup


Additional info:
I believe the same thing can work with dnsmasq, but I haven't been able to test these settings yet.
  dhcp-match=bios,option:client-arch,0
  dhcp-match=uefi,option:client-arch,7
  dhcp-boot=tag:bios,pxelinux.0
  dhcp-boot=tag:uefi,grubx64.efi
  pxe-service=tag:bios,x86PC,"x86 bios boot msg",pxelinux.0
  pxe-service=tag:uefi,BC_EFI,"x86 uefi boot msg",grubx64.efi

Being able to define that via libvirt would make it much simpler to test provisioning/installer functionality on both bios & uefi firmwares.
Comment 1 Ben Breard 2015-12-11 19:18:46 EST
I've tested these options with dnsmasq and they work beautifully for both bios & uefi (OVMF).


dhcp-match=bios,option:client-arch,0
dhcp-match=uefi,option:client-arch,7
dhcp-boot=tag:bios,pxelinux.0
dhcp-boot=tag:uefi,grubx64.efi
pxe-service=tag:bios,x86PC,"x86 bios boot msg",pxelinux
pxe-service=tag:uefi,X86-64_EFI,"x86 uefi boot msg",grubx64.efi

Basically the <CSA> needs to be X86-64_EFI instead of BC_EFI.

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