Bug #25708
closedAlways download newest bootloader (if possible)
Description
In my specific case, each time CentOS has a newer version (in this case CentOS 7.6, but I had the exact same issue with 7.4 > 7.5), the kickstart image doesn't work with the install image. The only thing I can do, is delete the kickstart image and rebuild the machine. This is very re-active work.
I'd think that the Last-Modified or ETag header should be checked to see if there's a newer version of a (kickstart) image, and react based upon that information.
Expected:
CentOS repository is upgraded (externally), the smart-proxy checks if the stored kickstarter images is the same as what is available externally and downloads the latest greatest.
Actual results:
At some point in time, the kickstart image was downloaded from the CentOS repository and is used always as nothing really changes in foreman (no IDs that change, no URL that changes). This causes kickstart to fail, complaining about XFS being an unknown default FS; halting the installation there and then.
Work-around:
Removing the kickstart image allows smart-proxy to re-download the latest image from the CentOS repo and all works again.
Steps to quickly reproduce:
- Create a custom repo server
- Copy some images to it
- Create install media referring to repo server
- Create an OS and refer to that install media
- Build a host using that OS, watch how it downloads the image
- Overwrite the image to be something else
- Rebuild the host and observe how the file isn't changed (foreman wouldn't know this has changed so makes sense)
Keep in mind that this is "vanilla" foreman, so without Katello :-)
Updated by Lukas Zapletal almost 6 years ago
- Status changed from New to Resolved
- Triaged changed from No to Yes
I believe this was solved with this feature introduced in 1.20:
Ticket #19389 - now everytime there is a new installation media path new kernel/initramdisk is downloaded automatically. Please review and test this and reopen with appropriate description on what we need to change.
Updated by Lukas Zapletal almost 6 years ago
- Related to Feature #19389: Change TFTP filename pattern to include unique installation media ID added
Updated by Arend Lapere almost 6 years ago
Hey @Lukas Zapletal, cool, wasn't aware of this change. Will check it out as soon as I can and come back to you on the matter if it is not resolved.
Updated by Arend Lapere almost 6 years ago
- Description updated (diff)
- Status changed from Resolved to New
Updated by Arend Lapere almost 6 years ago
- Found in Releases 1.20.0 added
Hey @Lukas Zapletal, just had the chance to re-validate this, but it remains to be an issue in 1.20 as well. I've updated the description to try and elaborate on this issue.
Updated by Shimon Shtein almost 6 years ago
Using Foreman 1.20, foreman is sensitive to URL changes.
It means if you put the exact version number in the directory structure and medium definition - it should be enough.
I mean using http://mirror.centos.org/centos/7.6.1810/ rather than http://mirror.centos.org/centos/7/
If you insist on the latter, you can create a new medium provider (https://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin#Controlling-installation-media) that will calculate the unique id depending on the actual file. Just be careful with accessing external resources from the code, since it could slow down a lot of processes.
Updated by Arend Lapere almost 6 years ago
Shimon Shtein wrote:
Using Foreman 1.20, foreman is sensitive to URL changes.
It means if you put the exact version number in the directory structure and medium definition - it should be enough.I mean using http://mirror.centos.org/centos/7.6.1810/ rather than http://mirror.centos.org/centos/7/
If you insist on the latter, you can create a new medium provider (https://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin#Controlling-installation-media) that will calculate the unique id depending on the actual file. Just be careful with accessing external resources from the code, since it could slow down a lot of processes.
Wow, do I feel stupid, I didn't realise I could add the complete version string in the URL. That solves everything and also gives me more control on the expected OS version. As, by default, the URL only takes into account the major, so the latest OS would be installed instead.
I'll put this on as resolved. Thank you for this!
Updated by Lukas Zapletal almost 6 years ago
- Related to Refactor #25743: Improve help text for CentOS version scheme on OS edit page added
Updated by Arend Lapere almost 6 years ago
BTW, today I've learned that we can't use the mirror.centos.org link to get back to CentOS 7.5 (or older). However, using vault.centos.org seems to work always, nomatter what. Would it perhaps make sense if I'd change the default to vault.centos.org instead? Or would this effort be wasted before started?
Updated by Lukas Zapletal almost 6 years ago
We can't do this as Vault apparently does not contain updates: http://vault.centos.org/readme.txt
However we can create new installation media "CentOS Vault" next to the normal one, that would be fine perhaps.