ironic: Fix UEFI & iPXE bootloader filenames

When using Ironic with UEFI boot mode and iPXE booting, nodes will
attempt to chainload iPXE using a Network Boot Program (NBP). This is
configured in Ironic via [pxe] uefi_ipxe_bootfile_name, and the default
since Xena is snponly.efi. In Wallaby and earlier releases, the default
was ipxe.efi. These files need to be available in the /tftpboot
directory of the ironic-pxe image.

The current default of snponly.efi was not present for any supported
distros. ipxe.efi was present for Debian/Ubuntu but not CentOS, which
appends the architecture to the filename (e.g. ipxe-x86_64.efi).

This change ensures that both ipxe.efi and snponly.efi exist in
/tftpboot for all supported distributions, ensuring that both the
current and previous Ironic defaults should work. Where these files have
different names, we use symlinks to allow for any deployers overriding
the filenames in configuration.

Closes-Bug: #1959203

Change-Id: I79e78dca550262fc86b092a036f9ea96b214ab48
This commit is contained in:
Mark Goddard 2022-02-10 10:58:55 +00:00
parent 838ee8cd9d
commit 909710d739
2 changed files with 25 additions and 0 deletions

View File

@ -36,10 +36,27 @@ function prepare_pxe_grub {
}
function prepare_ipxe {
# NOTE(mgoddard): Ironic uses snponly.efi as the default for
# uefi_ipxe_bootfile_name since Xena. In Wallaby and earlier releases it
# was ipxe.efi. Ensure that both exist, using symlinks where the files are
# named differently to allow the original names to be used in ironic.conf.
if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then
cp /usr/lib/ipxe/{undionly.kpxe,ipxe.efi} /tftpboot
# NOTE(mgoddard): The 'else' can be removed when snponly.efi is
# available in Jammy 22.04.
if [[ -f /usr/lib/ipxe/snponly.efi ]]; then
cp /usr/lib/ipxe/snponly.efi /tftpboot/snponly.efi
elif [[ ! -e /tftpboot/snponly.efi ]]; then
ln -s /tftpboot/ipxe.efi /tftpboot/snponly.efi
fi
elif [[ "${KOLLA_BASE_DISTRO}" =~ centos ]]; then
cp /usr/share/ipxe/{undionly.kpxe,ipxe*.efi} /tftpboot
if [[ ! -e /tftpboot/ipxe.efi ]]; then
ln -s /tftpboot/ipxe-${KOLLA_BASE_ARCH}.efi /tftpboot/ipxe.efi
fi
if [[ ! -e /tftpboot/snponly.efi ]]; then
ln -s /tftpboot/ipxe-snponly-${KOLLA_BASE_ARCH}.efi /tftpboot/snponly.efi
fi
fi
}

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Fixes an issue with Ironic deployments using UEFI and iPXE, where the
default UEFI iPXE bootloader in Ironic was not available in the TFTP
server. This affects all Kolla releases on CentOS, and Xena on
Debian/Ubuntu. `LP#1959203
<https://bugs.launchpad.net/kolla/+bug/1959203>`__