Bare-metal discovery reboots on Starting provision

Problem:
I’ve got a Foreman server set up, and a VM I’ve built to try Discovery and provisioning via Foreman. My environment doesn’t have a TFTP server, and the way DHCP/hostnames are managed I have to create a VM and register the MAC before I can even turn it on.

I get the VM started on the most recent Discovery ISO, and I manage to connect it to the Foreman server fine. When I go to provision the VM (as an ubuntu 20.04 machine) it reboots and goes right back into the boot menu.

Expected outcome:

Installation/provisioning of Ubuntu.

Foreman and Proxy versions:

3.7

Foreman and Proxy plugin versions:

Distribution and version:
Ubuntu 20.04
Other relevant data:

Whatever other info you need, just let me know. I admit I’m very new at this, and sort of floundering.

Hi @cjausask

Are you able to generate a foreman-debug so we can see the logs if there are any tracebacks? You can email it to me at chrobert at redhat.com

Thanks for the offer. I send you a onedrive share link to the logs.

Try making sure secure-boot is disabled. It might be chocking on kexec booting the downloaded kernel.

I was using SeaBIOS so no secure boot. Just to try, I switched to OVMF and specifically disabled Secure Boot, and I still got the same result.

Hi.

This might be a result of:

Provisioning via FDI usually requires a DHCP/TFTP server unless you are using kexec. For kexec, you need to set the corresponding template in your desired operating system.
https://theforeman.org/plugins/foreman_discovery/18.0/index.html#5.3PXE-lessdiscovery

The point is I’m trying to use kexec, but it keeps on rebooting instead of booting into the kernel.

You can enforce kexec by setting the following cmdline option for the FDI using this script:

... fdi.pxfactname1=discovery_kexec fdi.pxfactvalue1=1

However, kexec only works (incl. enforcement) if you have configured kexec template:

  1. Get corresponding kexec template (https://github.com/theforeman/foreman/tree/develop/app/views/unattended/provisioning_templates/discovery) and add it as “Provisioning Template” (type “Discovery kexec”); select corresponding OS in “Associate” .
  2. Go to “Operating Systems” > corresponding OS > Templates and select the template you just created.

Done.

I’ve done all this, but I get the same result. When the kexec call is made, it reboots instead of proceeding with the kernel boot.

I looked through the foreman-debug you sent me and I did not see anything odd in the production.log or the proxy.log I reached out internally to get some more eyes on this for you, with people who are more familiar with foreman-discovery and possibly proxmox

Next time it would be helpful to provide information what you have already done/tried :wink:

I had another developer look at the logs and he is saying the arch is missing:

2023-07-10T15:30:52 [W|app|d2dce801] Could not find a provider for midgard. Providers returned {"MediumProviders::Default"=>["Ubuntu 20.04 medium was not set for host 'midgard'", "Invalid medium '' for 'Ubuntu 20.04'", "Invalid architecture '' for 'Ubuntu 20.04'"]}

2023-07-10T15:31:07 [W|app|add6bbd9] unattended: Midgard build failed!

What does the OS you are using look like in the UI?

I’m not sure what you’re asking for here - can you be more specific?