PXE booting: Could not find kernel image

I am having trouble PXE booting new hosts. This is the error:

Could not find kernel image: boot/CentOS-7.2-x86_64-vmlinuz

At first i was using the http:// URL to my CentOS base repo as my
installation media. I suspected that perhaps that repo did not contain the
kernel image so I tried loop mounting the CentOS 7 1511 Minimal ISO to a
directory under /pub. I can view the directory from a browser so It should
work I think. But the kernel file is simply named "vmlinuz" there is no OS
version prefix.

Also the path from the error shows boot/ as the directory containing the
kernel, but on the iso the directory is named isolinux/. When I used
Satallite 6.0 about a year ago there were "kickstart" repositories and they
seemed to work without much effort. At the time I thought the only
difference between a kickstart repo and a regular repo was that the content
was shared via http instead of https. But I guess there was a bit more to
it. The foreman installation media docs mak ethis seem simple but I am
obviously missing something.

Hi, I am dealing with a similar issue right now so I will explain what I
know of the process because I am currently debugging the same thing :

  1. When you create a new host, Katello looks at what operating system the
    host is assigned, and checks if it has an operating system installation
    media entry for that OS. If it does, it goes and finds the initrd and
    vmlinuz files from that image.
  2. It then copies those 2 files to the /var/lib/tftpboot/boot directory and
    names them something based on the base OS : ie CentOS-6.5-x86_64-vmlinuz

This works fine for me on a normal machine, but I cannot seem to transfer
the content to a capsule automatically.

··· On Wednesday, January 20, 2016 at 12:14:19 PM UTC-8, Filippo Di Noto wrote: > > I am having trouble PXE booting new hosts. This is the error: > > Could not find kernel image: boot/CentOS-7.2-x86_64-vmlinuz > > At first i was using the http:// URL to my CentOS base repo as my > installation media. I suspected that perhaps that repo did not contain the > kernel image so I tried loop mounting the CentOS 7 1511 Minimal ISO to a > directory under /pub. I can view the directory from a browser so It should > work I think. But the kernel file is simply named "vmlinuz" there is no OS > version prefix. > > Also the path from the error shows boot/ as the directory containing the > kernel, but on the iso the directory is named isolinux/. When I used > Satallite 6.0 about a year ago there were "kickstart" repositories and they > seemed to work without much effort. At the time I thought the only > difference between a kickstart repo and a regular repo was that the content > was shared via http instead of https. But I guess there was a bit more to > it. The foreman installation media docs mak ethis seem simple but I am > obviously missing something. >

Thanks for that insight Nathan, I had no idea where the PXE client was
looking for the kernel image. I checked the contents of
the /var/lib/tftpboot/boot directory and the CentOS-7.2-x86_64-vmlinuz
and CentOS-7.2-x86_64-initrd.img are both there. The permissions are 644
foreman-proxy:foreman-proxy and the SELinux type context
is cobbler_var_lib_t. So I think all of that is correct.

I did a packet capture because I wasn't sure if the error was because of a
connection failure or not. In the capture I can see the TFTP server reply
to the client with a "File not found"

I'm wondering if it has to do with the request path
(boot/CentOS-7.2-x86_64-vmlinuz) and am trying to find a document root
configuration of some kind.

I tried to connect via tftp client and download the files and it worked so
its not a request path issue. But then I noticed the files I downloaded
were 0 bytes. Then I confirmed that they were also 0 bytes on the server.
Can't believe I didn't notice that before.

So now I am trying to understand the proper way to get these files created,
which was my original issue.

It the files are zero bytes, it means that at the moment you provisioned
the machine, when you saw that greenish status screen with stuff like
"fetching tftp boot files" that the main katello server could not get those
files from the OS media that was assigned to that host. Katello always
puts zero byte files there and then tries to actually download them.
I'm not sure what you are using as your media from your earlier
description. It sounds like you may be trying to use an iso file? I don't
think that will work because katello is expecting it to be a directory of
files.

I have had success using the CentOS Base repo online. If you sync that
repo and make it available in a content view, katello will automatically
use the images in the /boot directory of that content view. I find that is
a good way to ensure Katello has access to those files by just syncing the
whole thing so it is just grabbing them from itself locally.

··· On Wednesday, January 20, 2016 at 6:39:14 PM UTC-8, Filippo Di Noto wrote: > > I tried to connect via tftp client and download the files and it worked so > its not a request path issue. But then I noticed the files I downloaded > were 0 bytes. Then I confirmed that they were also 0 bytes on the server. > Can't believe I didn't notice that before. > > So now I am trying to understand the proper way to get these files > created, which was my original issue. >

I manually copied the files from the ISO on top of the 0 byte files in the
tftp directory and got passed the issue. But now the VM can't find the
kickstart file on the server.

I would like to understand why the 0 byte files were there though, and why
they don't get deleted/recreated when I deleted the installation media and
made new installation media specifying the loop mounted ISO as the media
path.

The VM couldn't find the kickstart because DHCP didn't give it a name
server. I set it with katello-installer --capsule-dhcp-nameservers
<serverIP> and it worked.

I thought that was going to be provided via the subnet configuration
though… Maybe that's just for puppet, not for kickstarts.

Thanks for the info Nathan

> It the files are zero bytes, it means that at the moment you provisioned
> the machine, when you saw that greenish status screen with stuff like
> "fetching tftp boot files" that the main katello server could not get those
> files from the OS media that was assigned to that host. Katello always
> puts zero byte files there and then tries to actually download them.
> I'm not sure what you are using as your media from your earlier
> description. It sounds like you may be trying to use an iso file? I don't
> think that will work because katello is expecting it to be a directory of
> files.

This is because we need to download these files asynchronously,
therefore we can't wait until the result. If it fails (we download them
via wget), they are zero bytes.

Check if your Smart Proxy is able to reach the media URL correctly
(firewalls etc). Check proxy.log during provisioning, you should see the
error message there. Increase the debug to see the whole wget command so
you can easily reproduce.

··· -- Later, Lukas #lzap Zapletal