PXE UEFI booting and installing

From PDP/Grid Wiki
Jump to navigationJump to search

We recently got a batch of DELL PE640s, and for fast storage opted for a superfast NVMe card of 3TB. That was almost the most expensive part of the whole order. Because the BIOS could not handle this card (or the other way around, the card would not do BIOS, only UEFI) we were forced to do UEFI boot, a first for the NDPF.

We install all our machines through PXE booting, and the configuration is managed by our trusty (legacy) quattor installation. This is based on pxelinux.cfg. For UEFI boot, we need a slightly different approach because the boot loader is a grub.

The boot loader image is called bootx64.efi (from any CentOS mirror, the path is /centos/6/os/x86_64/EFI/BOOT/). This file needs to be placed in the pxelinux.cfg directory along with the usual files for the machines to install. But note that this is different from pxelinux.0, which resides in the directory above pxelinux.cfg/. This also means that subsequent kernel and initrd files will be retrieved from the pxelinux.cfg directory, so you will have to set up symlinks accordingly.

Our setup basically looks like this:

/osinstall/nbp (the root of the tftp server).
/osinstall/nbp/centos-6.9 (the installer lives here)
/osinstall/nbp/pxelinux.cfg/
/osinstall/nbp/pxelinux.cfg/centos69_x86_64 -> ../centos-6.9/x86_64
/osinstall/nbp/pxelinux.cfg/bootx64.efi
/osinstall/nbp/pxelinux.cfg/machine.cfg

That last file contains (e.g.)

default=0
timeout 5
hiddenmenu
title EFI Boot
	root (nd)
	kernel /centos69_x86_64/vmlinuz ramdisk=32768 ks=http://stal.nikhef.nl/ks/machine.ks ksdevice=eth4 biosdevname=0
	initrd /centos69_x86_64/initrd.img


option arch code 93 = unsigned integer 16; # RFC4578

if option arch = 00:06 {
    filename "pxelinux/bootia32.efi";
} else if option arch = 00:07 {
    option tftp-server-name "stal.nikhef.nl";
    filename "pxelinux.cfg/bootx64.efi";
} else {
    option vendor-class-identifier "PXEClient";
    option vendor-encapsulated-options 01:04:00:00:00:00:ff;
    filename "pxelinux/pxelinux.0";
}