Project

General

Profile

Actions

Feature #26709

open

Rethink TFTP naming conventions for PXE files

Added by Lukas Zapletal almost 5 years ago. Updated almost 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
TFTP
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

The new naming convention implemented in #19389 is not good, while it workarounds concurrency problems it creates unecessary amount of files. Here is how we could implement this:

  • we can keep the current unique id approach in core (in Katello lets change from DBID to URL hash like in core)
  • new code in proxy
  • before anything is downloaded, do HTTP HEAD and acquire last-modified/etag sha1 hash
  • then download the content to a filename SHA1 (or skip if the file already exists)
  • then create a relative symlink FilenameFromForemanCore-XYZ -> SHA
  • extend TFTP API with "expiration" flag - every created symlink would have expiration time, this would be stored as FILENAME.expire_at timestamp or text file
* expiration is set by Foreman core according to Token expiration (when it expires TFTP files are actually also invalid) - when set to zero no expiration is performed * change back naming convention sent from foreman to Operating Sytem, Architecture and Version (https://community.theforeman.org/t/pxe-files-kernel-initrd/15354) * there will be a cronjob running every day cleaning up expired symlinks * the cronjob can optionally delete SHA1 named (content) files which are "orphans" (have zero symlinks) and are older than 1 year

We can also use hardlinks instead of symlinks.

Problems:

  • Foreman can download from any mirror, not all mirrors provide etag/last-modified. In that case, we'd need to redownload every time.

Related issues 2 (0 open2 closed)

Related to Foreman - Feature #19389: Change TFTP filename pattern to include unique installation media IDClosedShimon ShteinActions
Related to Foreman - Bug #28965: Regression: Since #19389 boot image of debian is not updated and installation is brokenClosedLukas ZapletalActions
Actions #1

Updated by Lukas Zapletal almost 5 years ago

  • Tracker changed from Bug to Feature
Actions #2

Updated by Lukas Zapletal almost 5 years ago

  • Related to Feature #19389: Change TFTP filename pattern to include unique installation media ID added
Actions #3

Updated by The Foreman Bot almost 5 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Lukas Zapletal
  • Pull request https://github.com/theforeman/foreman/pull/6726 added
Actions #4

Updated by Lukas Zapletal over 4 years ago

  • Description updated (diff)
  • Status changed from Ready For Testing to New
  • Assignee deleted (Lukas Zapletal)
  • Pull request deleted (https://github.com/theforeman/foreman/pull/6726)
Actions #5

Updated by Lukas Zapletal over 4 years ago

  • Subject changed from Perform HTTP HEAD prior downloading kernel/initramdisk to Rethink TFTP naming conventions for PXE files
Actions #6

Updated by Lukas Zapletal over 4 years ago

  • Description updated (diff)
Actions #7

Updated by Daniel Kraemer about 4 years ago

  • Related to Bug #28965: Regression: Since #19389 boot image of debian is not updated and installation is broken added
Actions #8

Updated by Lukas Zapletal almost 4 years ago

  • Description updated (diff)
Actions

Also available in: Atom PDF