Ubuntu provisioning, wrong path to kernel image

Problem:
Ubuntu Provisining fail . My machine successfully retrieve an IP adrress from the DHCP, and it load the menu file named with my machine MAC address (this file has no error in it). But after, it can’t find the kernel image. So i check the tftp server file, and my kernel image size is 0 byte. I’ve read on a another topic that it means that the kernel download failed. So I check the proxy log, and sure enough, it try to download the kernel image from a completly wrong location :
2020-03-02T13:59:34 815de707 [W] [18841] http://192.168.57.1/pub/Ubuntu_18.04/dists/bionic/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux: 2020-03-02T13:59:34 815de707 [W] [18846] http://192.168.57.1/pub/Ubuntu_18.04/dists/bionic/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz:

The path should be “http://192.168.57.1/pub/Ubuntu_18.04/casper/vmlinuz”. But it can’t figure out where this path is coded. I’ve check every preseed file and the PxeLinux file. Can someone explain me where is defined this path ?
The only path i’ve defined myself is in Foreman " Hosts --> Installation Media --> Ubuntu mirror" and my path is “http://192.168.57.1/pub/Ubuntu”. It’s not a permission problem because i can download kernel for CentOS from this server and everything works fine.

Expected outcome:
New host find and download the kernel image and successfully install Ubuntu 18.04

Foreman and Proxy versions:
1.24
Foreman and Proxy plugin versions:

Distribution and version:
Foreman installed on CentOS 7 lastest version
Other relevant data:

Hello, Foreman figures out paths itself based on installation media and some paths hardcoded in Foreman code. For Debian and Ubuntu the path is calculated in operatingsystems/debian.rb:

'dists/$release/main/installer-$arch/current/images/netboot/' + guess_os + '-installer/$arch'

This follows naming scheme that Ubuntu and Debian follows. It’s correct as of today:

http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/

If you are mirroring Ubuntu repositories, you must mirror them either using Katello plugin, or using the official Ubuntu/Debian mirroring tool. I think it’s called debmirror. Or anything that keeps the directory structure as is.

See our “Ubuntu mirror” installation media to see how a base should look like and set yours accordingly.

Ok thanks, i’ve just paste the content of an ubuntu iso on my server, it was the problem. I will mirror Ubuntu repositories using debmirror like you told me. Ty for the help !

I have Katello/Foreman (v4.5/v3.3) in debian.rb :code:

  def pxe_file_names(medium_provider)
    if (guess_os == 'ubuntu' && (major.to_i > 20 || major.to_i == 20 && minor.to_i >= 3))
      {
        kernel: 'vmlinuz',
        initrd: 'initrd',
      }
    else
      super
    end
  end

But it is initrd.gz not initrd, my Ubuntu 20.04 LTS install is failing because of that. Is this a bug or i am doing something wrong?

1 Like

For anyone still having issues with this on Ubuntu 20.04 provisioning, Canonical moved the files to a new directory:

http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/ubuntu-installer/amd64/

So I manually downloaded them into /srv/tftp/boot with the ubuntu-STRING-vmlinuz and ubuntu-STRING-initrd

I haven’t figured out the Autoinstall yet.