New Host can't get past TFTP

Problem: Created new host, trying to PXE boot it and it does a few RRQ TFTP tries and then ends, doesn’t proceed… kicks out to grub2 menu.

Expected outcome: Successfully kick starting new VM to Ubuntu 20.04

Foreman and Proxy versions: 3.7

Distribution and version: Ubuntu 20.04 LTS

Other relevant data:

syslog shows:

Apr  1 15:21:01 puppet dhcpd[1046]: DHCPREQUEST for 10.48.30.58 (10.48.30.102) from 00:0c:29:98:47:f9 via ens160
Apr  1 15:21:01 puppet dhcpd[1046]: DHCPACK on 10.48.30.58 to 00:0c:29:98:47:f9 via ens160
Apr  1 15:21:01 puppet in.tftpd[2577]: RRQ from 10.48.30.58 filename grub2/grubx64.efi
Apr  1 15:21:01 puppet in.tftpd[2577]: tftp: client does not accept options
Apr  1 15:21:01 puppet in.tftpd[2578]: RRQ from 10.48.30.58 filename grub2/grubx64.efi
Apr  1 15:21:01 puppet in.tftpd[2579]: RRQ from 10.48.30.58 filename grub2/grub.cfg-01-00-0c-29-98-47-f9
Apr  1 15:21:01 puppet in.tftpd[2580]: RRQ from 10.48.30.58 filename grub2/x86_64-efi/command.lst
Apr  1 15:21:01 puppet in.tftpd[2581]: RRQ from 10.48.30.58 filename grub2/x86_64-efi/fs.lst
Apr  1 15:21:01 puppet in.tftpd[2582]: RRQ from 10.48.30.58 filename grub2/x86_64-efi/crypto.lst
Apr  1 15:21:01 puppet in.tftpd[2583]: RRQ from 10.48.30.58 filename grub2/x86_64-efi/terminal.lst
Apr  1 15:21:01 puppet in.tftpd[2584]: RRQ from 10.48.30.58 filename grub2/grub.cfg-01-00-0c-29-98-47-f9

then nothing else

Hi,
what’s the log from the Foreman & Smart Proxy, is there anything interesting?

This topic might help: Debugging provisioning

Thank you for your reply.

Both Foreman and Smart Proxy logs do not show anything interesting. I rebooted the host to re-start the process to have something kick out to logs, and the only bit that kicked out was that chunk above, again.

I am reviewing your post you made about debugging provisioning; however, everything seems to be how it should be.

What are the contents of grub2/grub.cfg-01-00-0c-29-98-47-f9 (gonna guess that’s in /var/lib/tftpboot)? Or does it exist at all? Are you able to tftp that file yourself and get the same contents?

contents are:

#
# This file was deployed via 'Preseed default PXEGrub2' template

set default=0
set timeout=10

menuentry 'Preseed default PXEGrub2' {
  linuxefi  boot/ubuntu-mirror-LWkbAuSMBn4x-linux interface=auto url=http://puppet.spectric.dev/unattended/provision?token=7a00977e-3f67-49e0-b915-949f9ae59803 ramdisk_size=10800 root=/dev/rd/0 rw auto BOOTIF=01-$net_default_mac console-setup/ask_detect=false console-setup/layout=USA console-setup/variant=USA keyboard-configuration/layoutcode=us localechooser/translation/warn-light=true localechooser/translation/warn-severe=true locale=en_US netcfg/disable_dhcp=true netcfg/get_ipaddress=${netX/ip} netcfg/get_netmask=${netX/netmask} netcfg/get_gateway=${netX/gateway} netcfg/get_nameservers=${dns} netcfg/confirm_static=true locale=en_US hostname=foreman-test.spectric.dev domain=spectric.dev
  initrdefi boot/ubuntu-mirror-LWkbAuSMBn4x-initrd.gz
}

they do match when i tftp the file from the foreman host to a different server/vice versa.

sorry, and my tftp is hosted via /srv/tftp vs /var/lib/tftpboot and was established as such in the foreman-installer prior to installation

Vice versa?

When you say “kicks out to grub2 menu,” what menu is that? What are the options it’s presenting? Ostensibly it’s not the menu specified in that grub.cfg-01-00-0c-29-98-47-f9 , or you’d be happier, and yet, I’m not sure where a fresh VM would be getting any other Grub menu.

Since that series of requests looks like Grub is successfully starting and grabbing the configuration, I’d be looking at Grub’s documentation to hand-modify that config to make Grub log more verbosely, or to have it pause between steps so what’s failing isn’t merely flashing before your eyes on the way to something else.

Vice versa being I can send to a remote server from the foreman host via tftp, or “get” the file using the remote host tftp’ing to the foreman host.

Here is the grub menu I get shown nearly automatically.

The VM shows this below screen shot, then near-instantly goes to the grub menu pictured above:

I forget how to do this off-hand, but at that prompt, what does Grub think its root and prefix variables are? (Might be echo ${var}?) If you run the commands in your configuration file line-by-line manually at that prompt, does it work or does it error out on one of them?

Incidentally, my tftpd is a bit chattier than yours!

Apr  5 16:07:46 sci-foreman2 in.tftpd[1236024]: tftp: client does not accept options
Apr  5 16:07:46 foreman in.tftpd[1236025]: RRQ from ::ffff:[ip] filename grub2/shim.efi
Apr  5 16:07:46 foreman in.tftpd[1236025]: Client ::ffff:[ip] finished grub2/shim.efi
Apr  5 16:07:46 foreman in.tftpd[1236026]: RRQ from ::ffff:[ip] filename grub2/grubx64.efi
Apr  5 16:07:48 foreman in.tftpd[1236026]: Client ::ffff:[ip] finished grub2/grubx64.efi
Apr  5 16:07:48 foreman in.tftpd[1236031]: RRQ from ::ffff:[ip] filename grub2/grub.cfg-[mac]
Apr  5 16:07:48 foreman in.tftpd[1236031]: Client ::ffff:[ip] finished grub2/grub.cfg-[mac]
Apr  5 16:07:48 foreman in.tftpd[1236032]: RRQ from ::ffff:[ip] filename /EFI/redhat/x86_64-efi/command.lst
Apr  5 16:07:48 foreman in.tftpd[1236032]: Client ::ffff:[ip] File not found /EFI/redhat/x86_64-efi/command.lst
Apr  5 16:07:48 foreman in.tftpd[1236033]: RRQ from ::ffff:[ip] filename /EFI/redhat/x86_64-efi/fs.lst
Apr  5 16:07:48 foreman in.tftpd[1236033]: Client ::ffff:[ip] File not found /EFI/redhat/x86_64-efi/fs.lst
Apr  5 16:07:48 foreman in.tftpd[1236034]: RRQ from ::ffff:[ip] filename /EFI/redhat/x86_64-efi/crypto.lst
Apr  5 16:07:48 foreman in.tftpd[1236034]: Client ::ffff:[ip] File not found /EFI/redhat/x86_64-efi/crypto.lst
Apr  5 16:07:48 foreman in.tftpd[1236035]: RRQ from ::ffff:[ip] filename /EFI/redhat/x86_64-efi/terminal.lst
Apr  5 16:07:48 foreman in.tftpd[1236035]: Client ::ffff:[ip] File not found /EFI/redhat/x86_64-efi/terminal.lst
Apr  5 16:07:48 foreman in.tftpd[1236036]: RRQ from ::ffff:[ip] filename grub2/grub.cfg-[mac]
Apr  5 16:07:48 foreman in.tftpd[1236036]: Client ::ffff:[ip] finished grub2/grub.cfg-[mac]
Apr  5 16:07:58 foreman in.tftpd[1236095]: RRQ from ::ffff:[ip] filename boot/almalinux-9-3-for-x86_64-baseos-2766-vmlinuz
Apr  5 16:08:03 foreman in.tftpd[1236095]: Client ::ffff:[ip] finished boot/almalinux-9-3-for-x86_64-baseos-2766-vmlinuz
Apr  5 16:08:03 foreman in.tftpd[1236263]: RRQ from ::ffff:[ip] filename boot/almalinux-9-3-for-x86_64-baseos-2766-initrd.img
Apr  5 16:08:43 foreman in.tftpd[1236263]: Client ::ffff:[ip] finished boot/almalinux-9-3-for-x86_64-baseos-2766-initrd.img

apologies for the delay in response! i had a hectic weekend

anyway

submitting the commands line-by-line manually, grub complained about the use of $_____ in some cases… i removed those, and re-sent the line (the one loading the kernel) and no errors occurred

since no errors occurred, i exited the prompt and told it to boot normally in which it tried to PXE over IPv4 and then sent me back to the grub menu

Not being able to expand variables might explain why it’s not working. A peek at the template suggests that getting those netX variables means you’re using iPXE templates – is that intentional? I also remembered there’s a “Preseed default PXEGrub2 Autoinstall” template, and apparently

Provisioning hosts with Debian and Ubuntu up to Ubuntu 20.04.2 supports debian-installer with Preseed templates. With Ubuntu 20.04.3+ and Ubuntu 22.04, you have to use Autoinstall, a cloud-init-based mechanism, to perform network-based deployments.

so I’m wondering if you’re using such an affected minor version, and if you’ve tried using the Autoinstall template instead.

The tidbit about Autoinstall is good to know, not sure why I didn’t see that before. I did update the OS templates now:

The templates portion… when I go look at the OS build out, there was an iPXE template in it and I removed it; however, the host is calling for Grub2 EFI.

With making the changes… do I need to re-create the host? Or is there a way to update the grub.cfg?

I usually “Cancel build” and then “Build” again, or a hammer host update --build false ... followed by a --build true.

Hm, it’s giving me an error for too many arguments even though it’s only one for the hammer stuff.

I’m assuming the only other way to rebuild the config is to delete and recreate

You may need to also set “Preseed Autoinstall cloud-init user data” for “User data template,” and to use the “Preseed default autoinstall” ptable instead of the “Preseed default” ptable.

With the ... I meant some way of specifying the host, e.g. --name or --id. The GUI method is in this menu on the host page
slika

The error I received is after declaring the host, I figured you meant the host, at minimum, was required :slight_smile:

I do not have the other autoinstall templates you mention - maybe that came out later than 3.7? I can update Foreman

Got the build part reset…

Now I’m failing at another part… but it’s kicking, kind of!

Maybe I only needed those templates for the Jammy build I was doing, but regardless, updated templates seems like a good idea.

I must’ve misremembered the Hammer command. I know it can be made to work, at least in 3.9.1, because I was doing it just last week!

I don’t remember what Subiquity looked like, but I don’t think it involved debconf, so that makes me wonder if your host isn’t still using the original, non-Autoinstall method, maybe fixed from the original problem by your iPXE change. The post I linked claims 20.04.3+ require the use of Autoinstall.

# This file was deployed via 'Preseed default PXEGrub2 Autoinstall' template
#
# Supported host/hostgroup parameters:
#
# blacklist = module1, module2
#   Blacklisted kernel modules
#
# lang = en_US
#   System locale
#

set default=0
set timeout=10

menuentry 'Preseed default PXEGrub2 Autoinstall' {
  linuxefi boot/ubuntu-mirror-LWkbAuSMBn4x-linux root=/dev/rd/0 rw auto ip=10.48.30.58::10.48.30.1:255.255.255.0:foreman-test.spectric.dev:ens160:none:10.48.30.50:10.48.30.253 ramdisk_size=1500000 fsck.mode=skip autoinstall url=http://archive.ubuntu.com:80/ubuntu.iso cloud-config-url=/dev/null "ds=nocloud-net;s=http://puppet.spectric.dev/userdata/00:0c:29:98:47:f9/" console-setup/ask_detect=false locale=en_US localechooser/translation/warn-light=true localechooser/translation/warn-severe=true hostname=foreman-test.spectric.dev domain=spectric.dev
  initrdefi boot/ubuntu-mirror-LWkbAuSMBn4x-initrd.gz
}

this is the updated config file for it… and it mostly works aside from not finding that file… so now i need to change it manually, but i wonder how i can change it permanently