Foreman build process fails due to missing pxe config creation

Problem: When clicking the build usually a discovered host restarted and was being installed. This is not working anymore. So it restarts and runs in the discovery image again.

Expected outcome: VM should boot the correct image via PXE.

Foreman and Proxy versions: 1.20.3 (both)

Other relevant data:
Based on:
Foreman :: Manual I found out, that step 2 in the described workflow is not happening:
Create a host-specific TFTP configuration file in /var/lib/tftpboot/pxelinux.cfg/01-XX-XX-XX-XX-XX-XX, named based off of the MAC address, using the associated PXE template.

What can I do?

Hello, does your operating system have a PXELinux template associated? If not, this step will be skipped and indeed the host in question will reboot into discovery again.

Yes it has:

And I don’t have other other PXELinux templates.

What is your PXELoader flag then? Must be set to PXELinux in this case.

This has been happening to me with CentOS as well, same issue, no template files are created even when a PXEBoot template is associated with the Operating System. I was waiting to create a post until I solved some other issues, but I can confirm this is happening to me too on a fresh installation of 1.22 and katello 3.12.

Check your PXELoader, it’s defined for a host or a hostgroup. Alternatively, check taxonomy of templates (organization and location).

@lzap Since I’ve never administrated this system, I don’t know what exactly I shall check. Can you assist me please?

Check your PXELoader, it’s defined for a host or a hostgroup.

Also it can be mismatch of organization and location - check ORG and LOC of your host vs your template. This can lead to error when host cannot see the template (which leads to orchestration step to be skipped).

Indeed, the PXEGrub2 template was missing. Not sure why it disappeared. I’m absolutely sure, nobody removed it from the OS setup.

In the APT history I can see, that 1.20.3 was installed some weeks ago. I thought there are no auto updates on this machine. Have to clarify that.
Can it be possible that this setting above was lost due to the update from 1.20.2 to 1.20.3?

It is not impossible, however I don’t recall any bug in this regard.