Heads up: We are changing TFTP file naming conventions for 1.20

Hello,

I have just merged a PR (*) which changes naming conventions for TFTP (kernel/init ram disk) files and creates an API so plugins can easily hook and provide their own conventions. Katello, for example, will take advantage of that and will name the files after product name and kickstart id.

The default Foreman core example is Installation-Media-Name-base64_hash-vmlinuz. The hash is a SHA of installation media URL after variables are interpolated. Example:

# old:
boot/Redhat-6.1-x86_64-vmlinuz
boot/Redhat-6.1-x86_64-initrd.img
# new:
boot/CentOS_mirror-aBsbsZ_lDn-vmlinuz
boot/CentOS_mirror-aBsbsZ_lDn-initrd.img

Katello PR is still opened, but so far it looks like (assuming repository ID of 221):

boot/Red-Hat-Enterprise-Linux-Server-Kickstart-7.5-221-vmlinuz
boot/Red-Hat-Enterprise-Linux-Server-Kickstart-7.5-221-initrd.img

This will allow kickstart flavours to co-exist (Worstation vs Server) and also changing Installation media for hosts/hostgroups will not lead to re-downloading and over-writing same files over and over again.

(1) https://github.com/theforeman/foreman/pull/5244

Big thanks to @Shimon_Shtein who did all the coding and all others involved in the review.

Does this need an upgrade warning in the manual or any changes to its contents otherwise? if so please open a pr against the nightly manual.

This is automatic for new and/or edited hosts, I can’t think of anything we’d need to tell our users. TFTP directory needs regular cleaning but we don’t offer any tool to identify unused files anyway.

It’s a new development feature, updated the How to create a plugin page

1 Like

Heads up: this change actually does not prevent to workaround situation when content changes upstream.

Situation: New CentOS is released an the centos-7 repository is updated together with kernel and initramdisk. New provisioning will still fail. There is not an easy solution to this, Foreman would need to determine timestamp of the files from the HTTP server.

The same applies to Katello override, however this case is probably easier to fix. Katello tracks last sync date and time, so the naming convention can be changed to include last sync date-time as suffix. On the other hand, this would create too many files for users who sync very often which is most of them.

So I guess the only solution is either Foreman or Proxy to do HEAD HTTP request and getting Last-Modified or ETag HTTP headers. If a server provides it, this can be added to the filename for katello or to the UUID itself for core.

I lean towards putting this to Foreman because this way we can actually test in advance if repository URL is present and server responds. If the HEAD request fails, we can inform the user quickly before even trying out to enter build mode.

Filed Feature #26709: Perform HTTP HEAD prior downloading kernel/initramdisk - Foreman for this. I think it is worth fixing this, it’s long-term issue and we haven’t actually improved it much.

1 Like