Sunday, October 30, 2016

UEFI PXE ESXi6 TFTP iPXE

Newer generation hardware default boot mode could be UEFI now, so existing PXE server might not work anymore.

VMware ESXi 6 ISO installation will still work for UEFI hardware, but there are changes for PXE boot process. Here is PDF link from VMware Installing VMware ESXi 6.0 Using PXE

Like always, my favorite blog site from William Lam already posted related blog a while ago about this:
http://www.virtuallyghetto.com/2015/10/support-for-uefi-pxe-boot-introduced-in-esxi-6-0.html
(Thank William again!)

VMware site PDF actually added obvious details which is missing from William: As we will use boot file from /efi/boot/bootx64.efi from installation ISO directly, instead of original pxelinux.0, so we need put boot.cfg file in the same location as mboot.efi. (bootx64.efi is renamed as mboot.efi), otherwise mboot.efi will not find boot.cfg during PXE boot process and throw out fatal TFTP error (15) about parsing boot.cfg. 

Update: Later version of ESXi uses b.b00 as kernel in boot.cfg file, insead of tboot.

We might encounter TFTP error (24) during PXE boot process if we start PXE Boot with a web server

Update: mboot.efi doesn't have http capability for tftp to continue, so we need start iPXE first. iPXE can be obtained from ipxe.org, or just download package to from vCenter server Auto Deploy service. File name inside the package for iPXE is: snponly64.efi. 

We don't have such issue for legacy BIOS, however now it is all about UEFI. If you decide to test out UEFI HTTP chainloading in VMWare VM, you need Burning iPXE into ROM for network adapter. (https://ipxe.org/howto/vmware)

The process is so-called chainload: snponly64.efi is obtained from tftp server, then it is look for mboot.efi from tftp server. Configuration in dhcpd.conf includes lines below:

class "pxeclients" {
   match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
   next-server ip-of-tftp-server;
   if option client-system-arch = 00:07 or option client-system-arch = 00:09 {
      if exists user-class and option user-class = "iPXE" {
         # Instruct iPXE to load mboot.efi as secondary bootloader
         filename = "mboot.efi";
      } else {
         # Load the snponly64.efi configuration of iPXE as initial bootloader
         filename = "snponly64.efi";
      }
   } else {
      filename "gpxelinux.0";
   }
}



Tip 1: before you start UEFI PXE boot process, please check UEFI boot order, and make sure PXE is after hard disk, otherwise PXE boot process will repeat after ESXi server reboot :-) (If your ks.cfg file includes reboot after installation)

Tip 2: We use PXE boot for multiple ESXi servers installation purpose, so the easiest way I found out about assigning IP address as you expected via DHCP is to edit dhcpd.conf file for DHCP reservation:

group {
host host-name1 {hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address ip-address1; option host-name "host-name1";
host host-name2 {hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address ip-address2; option host-name "host-name2
...
}

Of course, you need reboot DHCP for this, but you don't need multiple MAC-address-boot.cfg files. dhcpd.conf syntax is really picky, so you will follow the format exactly


No comments:

Post a Comment