Deploying ESXi through Foreman

At the time of writing this (Foreman v1.18), ESXi deployment through Foreman is not supported natively. The problem is exacerbated by the fact that the ESXi Legacy BIOS bootloader depends on an older Syslinux (v3.86) and GRUB2 not being able to chainload the ESXi EFI bootloader. However there are quite a few articles on the Internet that have attempted to work around these issues. This post is an attempt to bring all the information together in one place, simplify the process and most importantly, support both Legacy BIOS and UEFI modes of installation. Huge thanks to the foreman developers for helping me out whenever I was stuck.


This is a companion discussion topic for the original entry at https://theforeman.org/2018/08/deploying-esxi-through-foreman.html

I wonder why the legacy PXELinux is named subdirectory/pxelinux.0 and not pxelinux-legacy.0 that way it should be able to load the standard configuration files. Maybe configuration syntax is no longer compatible?

I wonder why the legacy PXELinux is named subdirectory/pxelinux.0 and not pxelinux-legacy.0

Because pxelinux.0 v3.86 is kept under {tftproot}/syslinux386/ and not directly under {tftproot}/.
So are you saying we should keep it under {tftproot} directly and rename it to pxelinux-3.86.0? Then what about the supporting v3.86 *.c32 files (v3.86 pxelinux.0 is incompatible with the default .c32 files)? Where do we keep those?

Oh I havenā€™t realized that there are those c32 files. These are indeed not compatible. Only if there was a way to embedd them into the .0 file like for grub2, or load them via relative path.

1 Like

Hi, I was able to get ESXI to provision using iPXE to chanload to mboot.efi and avoid any hook script.

echo Booting ESXi install from HTTP
kernel <%= @host.os.medium_uri(@host) %>mboot.efi -c <%= @host.os.medium_uri(@host) %>boot.cfg ks=<%= foreman_url('provision') %> ksdevice=<%= @host.mac %> network kssendmac ks.sendmac inst.ks.sendmac
boot || goto failed

Yesā€¦the iPXE based procedure is covered here Foreman :: Install ESXi through Foreman using iPXE bootstrapping

2 Likes

Hello Team, i need your advice.

I have Foreman in my infrastructure and i want configure ESXi installation. I did everithig like in this post
Deploying ESXi through Foreman.

After ESXi installation it didnā€™t send information to Foremn to delete the config, after reboot system start installation again and only after removing config manually it stops installation.

Scripts below didnā€™t work
%post --interpreter=busybox

Add temporary DNS resolution so the foreman call works

echo ā€œnameserver <%= @host.subnet.dns_primary %>ā€ >> /etc/resolv.conf

Inform Foreman that we are done.

wget -O /dev/null <%= foreman_url(ā€˜builtā€™) %>
echo ā€œDone with Foreman callā€

How can i send information to Foreman to stop installation?