Discovered host with different IP range cannot be provisioned

Problem:
Following the ideal guidelines, I assigned different IP ranges (but still from the same subnet) to ISC DHCP server as well as on the Foreman UI. When a host was discovered, it was first assigned an IP address within the range given to the DHCP server, and after clicking on the Foreman UI to start the provisioning of the host, the host was assigned another IP address within the range written on the Foreman UI.
However, the host was not able to download the image of the OS.

Expected outcome:
The discovered host can be provisioned successfully.
Foreman and Proxy versions:
2.14

1 Like

Any more info about that? Everything is set correctly.

I was reading through the Foreman guide and came across something called the Build Token. It seems like there wasn’t any Build Token assigned. I will look through the logs and try to give you more info

So we are trying to provision a server, which is using UEFI to boot.
The Foreman Server is also the DHCP Smart Proxy server, the DHCP Server and the TFTP server.
We are using Grub2 UEFI as the PXE loader, and Kickstart Default as the Partition Table.
I will walk you through the provisioning process and what I observed:

  1. Hosts gets rebooted, asks for an IP and is assigned one.
  2. Shows a menu from /var/lib/tftpboot/grub2/grub.cfg on the Foreman Server. We chose that one for Foreman Discovery.
  3. Foreman discovers the host. We then click for the host to be provisioned on the Foreman UI.
  4. A reservation is made for the host in DHCP lease file, with filename=grub2/grubx64.efi, server= the Foreman server, and the host did indeed take up the reservation.
  5. The file grub.cfg-mac_address was created at /var/lib/tftpboot/grub2.

Despite the above steps, the host was still not provisioned. I am unsure whether the OS installer was loaded or not, but then I did not see the Kickstart Menu from the grub.cfg-mac_address file.

Are you on Red Hat system or not?

Ok, we are getting somewhere. Now, I assume your host boots again into discovery, is that correct?

In that case show me the grub.cfg file from the TFTP directory.

And also after you boot that host, show me system log which should contain both DHCP and TFTP log information. You should see the grub making attempts to load the MAC-based named grub configuration file.

The host did not boot again into Discovery because it was already discovered.
The host simply tries to boot over PXE Network again, then this time it said failed to boot, and went on to boot using other methods.

For the grub.cfg file it contained this segment of code:
if [ $grub_platform} == “pc” ]; then
menuentry ‘Foreman Discovery Image’–id discovery {
linux boot/fdi-image/vmlinuz0 ${common}
initrd boot/fdi-image/initrd0.img
}
else
menuentry ‘Foreman Discovery Image EFI’–id discovery {
linuxefi boot/fdi-image/vmlinuz0 ${common}
initrdefi boot/fdi-image/initrd0.img
}
fi

Since I am using baremetal server, the second menuentry was displayed instead.

As for the system logs, I am not allowed to show it, but I did not see any logs from TFTP at all.

Provisioned host in Foreman does boot from network, this is by design, but host that is in Foreman inventory has its own MAC-based confiiguration which chainboots from HDD.

I think we need to update our docs with more info about this, I take this for granted but its not obvious. @mcorr gonna make a patch:

https://docs.theforeman.org/nightly/Provisioning_Guide/index-foreman-el.html

1 Like