Linux ubuntu PXE provisioning does not create boot host file

Problem:
Creating a host for pxe provisioning, BIOS or UEFI, particular host pxe config (file+mac) is not created

Expected outcome:
Creating a host for pxe provisioning, BIOS or UEFI, foreman create a particular host pxe config (file+mac)

Foreman and Proxy versions:
3.14 both

Foreman and Proxy plugin versions:

Distribution and version:
Server is a ubuntu 22.04

Other relevant data:

As additional information:
proxy tftp options are as follows:
–foreman-proxy-tftp Enable TFTP feature (current: true)
–foreman-proxy-tftp-dirs Directories to be create in $tftp_root (current: UNDEF)
–foreman-proxy-tftp-listen-on TFTP proxy to listen on https, http, or both (current: “https”)
–foreman-proxy-tftp-manage-wget If enabled will install the wget package (current: true)
–foreman-proxy-tftp-managed The TFTP daemon is managed by this module. (current: true)
–foreman-proxy-tftp-replace-grub2-cfg Determines if grub2.cfg will be replaced (current: true)
–foreman-proxy-tftp-root TFTP root directory (current: “/srv/tftp”)
–foreman-proxy-tftp-servername Defines the TFTP Servername to use, overrides the name in the subnet declaration (current: UNDEF)

And when I create pxe defaults with “Buid PXE Defaults” they are created as expeted in the correct directory (srv/tfpt)

Hi,
Could you please attach the debug logs from Foreman and Smart Proxy?

foreman-installer --foreman-logging-level "debug" --foreman-proxy-log-level "DEBUG"

And logs:

foreman-rake log
or
tail -f /var/log/foreman/production.log /var/log/foreman-proxy/proxy.log

proxy.log (11.6 KB)
production.log (252.7 KB)

Thanks Leos for your answer.
Here are the logs during a “build” and “cancel build” operations.

Hi,
From the logs (smart-proxy), I don’t see any operation for creating a host and its files.
Can you provide the logs generated when you attempt to create a host?

I noticed you are using a custom tftp directory /srv/tftp.
Can you please check that the foreman-proxy user has read and write permissions to the directory and its sub-directories and files?

proxy.log (9.5 KB)
production.log (148.6 KB)
Just in case, have deleted the host and I have created it again from zero. Hostname is ubuntu24 and in this case is suposed to be deployed using PXELinux Bios, but I’ve tried grub2 as well, and also no particular conf-MAC file is created.

Here you can see file permisions in tftp directory:

ls -l /srv/tftp/

total 484
drwxr-xr-x 2 foreman-proxy root 4096 May 27 10:31 boot
drwxr-xr-x 3 foreman-proxy root 4096 May 27 10:31 bootloader-universe
-rw-r–r-- 1 foreman-proxy root 25048 May 27 10:31 chain.c32
drwxr-xr-x 2 foreman-proxy root 4096 May 27 13:21 grub
drwxr-xr-x 2 foreman-proxy root 4096 Jun 2 11:44 grub2
drwxr-xr-x 2 foreman-proxy root 4096 May 27 10:31 host-config
-rw-r–r-- 1 foreman-proxy root 119284 May 27 10:31 ldlinux.c32
-rw-r–r-- 1 foreman-proxy root 169220 May 27 10:31 libcom32.c32
-rw-r–r-- 1 foreman-proxy root 23768 May 27 10:31 libutil.c32
-rw-r–r-- 1 foreman-proxy root 10916 May 27 10:31 mboot.c32
-rw-r–r-- 1 foreman-proxy root 26792 May 27 10:31 memdisk
-rw-r–r-- 1 foreman-proxy root 26148 May 27 10:31 menu.c32
drwxr-xr-x 2 foreman-proxy root 4096 May 27 10:31 poap.cfg
-rw-r–r-- 1 foreman-proxy root 42584 May 27 10:31 pxelinux.0
drwxr-xr-x 2 foreman-proxy root 4096 May 27 13:21 pxelinux.cfg
drwxr-xr-x 2 foreman-proxy root 4096 May 27 10:31 ztp.cfg

The /srv/tftp directory appears to be in order, but I don’t see any TFTP-related activity in the smart proxy log.

Two questions:

  • Host’s subnet - does it have an assigned TFTP & DHCP smart proxy?
  • What’s the configuration of the subnet? Can you share the details?
  • Host group - Has it been assigned a subnet with the correct domain? Can you share the details?

Hi Leos,
you nailed id! I miss the smart proxy in the provisioning subnet. Now the"config-mac" file is created.
The problem now is that it tries to use:
KERNEL boot/ubuntu-24-04-autoinstall-zcIo8TMJBnZX-vmlinuz
INITRD boot/ubuntu-24-04-autoinstall-zcIo8TMJBnZX-initrd
which are not there. I don’t know if I must create them or any template will.
On the other hand, in the host group there’s no particular subnet because the host uses two subnets. Must I configure one anyway?
Thaks a lot for your help. I’m closer now

Does your OS have an assigned medium from which it can download those files? Select one from the Hosts > Provisioning > Installation media

Yes, you need to have at least one assigned subnet. The one with tftp that is managed and associated with the smart proxy.

Hi again,
yes, I have selected an installation media following the instruccions of Foreman manual for provisioning Ubuntu Autoinstall, which basiclly tells you must download the ditribution iso and extract the content un a particular directory (pub/installation_media/ubuntu).
I think I found the problem in proxy logs (thanks for focus me there):
Specific Kernel and initrd files are created via “curl” command getting them frem proxy itself.
Bur “curl” gives an error because proxy certificate is self-signed and then it can not verify the legitimacy of the server"
Is there any way to bypass than?
Thanks again.

What you can do is to download the kernel and initramdisk manually and just copy it to the /srv/tftp directory, naming it as the proxy would.
Not an elegant solution, but once the files are there, smart proxy won’t try to download them again and just skip the step.

1 Like

Another solution would be to add the custom CA to the list of trusted authorities, so the curl can make a secure connection

1 Like

Solved curl problem.
Now I get “The requested URL returned error: 404”
But the files are in /var/www/html/pub as requested in the documents.
Maybe I have to define proxy “webroot” anywhere?

I think I find out the problem with the URL not found.
The official documentation expalins that you have to leave iso files al /var/www/html/pub
but in /etc/apache2/sites-enabled/05-foreman-ssl.conf file public doocroot is
/usr/share/foreman/public
Is that a mistake? Has that changed in recent version?

Just for the record, moving pub direcory to /usr/share/foreman/public does the trick an particular kernel and initrd files are loaded by the client.
But after that, client shows the error “Booting kernek failure: Invalid argument”.
I’ve searched for the forums, and I have found a similar issue at

In that case,seems that kernel and initrd files were not foud, and they mentioned that the ones in casper directory should been used, but that is fixed now, so I don`t know what the error comes from.
May be in the grub arguments:

DEFAULT linux cloud-init autoinstall
LABEL linux cloud-init autoinstall
KERNEL boot/ubuntu-24-04-autoinstall-zcIo8TMJBnZX-vmlinuz
INITRD boot/ubuntu-24-04-autoinstall-zcIo8TMJBnZX-initrd
APPEND root=/dev/ram0 ip=dhcp BOOTIF=c6:64:81:e3:e4:cb ramdisk_size=1500000 fsck.mode=skip autoinstall url=http://:443/pub/installation_media/ubuntu/24.04-x86_64.iso cloud-config-url=/dev/null ds=nocloud-net;s=http:///userdata/c6:64:81:e3:e4:cb/ console-setup/ask_detect=false locale=es_ES localechooser/translation/warn-light=true localechooser/translation/warn-severe=true hostname= domain=

Anyway the issue of this ticket is solved. So I am going to open another topic for that.
Thank for you help Leos.

1 Like