RFC: Clone OS from minor version & other cloning improvements

RFC: Clone OS from a minor version & other cloning improvements

Hi,

I would like to share with you my proposal for improvements in cloning operating systems, along with a POC PR, so that you can test it on your setup right away.

Context and Problem Statement

  • The current cloning feature ignores associated templates and default OS templates.
  • A newly created OS from Facts requires manual configuration, which can be a significant amount of work.

Proposal

  • Cloning OS should clone everything.

  • Introduce a setting for automatically cloning hosts from previous versions during fact import.

Alternative Designs

I don’t have any; feel free to suggest any.

Decision Outcome

Community members and developers discussed it several times at our Foreman Provisioning interest group.

Impacts

  • Reducing tedious work
  • Improving the workflow
  • Automating some steps that are currently done manually.
  • By default, the setting will be set to false, so it won’t change the workflow unless users enable it.

POC PR: [WIP] [POC] Clone OS by stejskalleos · Pull Request #10593 · theforeman/foreman · GitHub

1 Like

I would say there is no need for a setting, just make it the new default behavior as the current one has no advantages over the proposed new one.

1 Like

In my mind cloning copies an existing entry to a to be created entry, but a newly created OS from facts is created automatically. Looking at the code, it appears to automatically clone the last version it can find.

I can imagine that creates problems with taxonomies where host.example.com will create Debian 12.10. It finds Debian 12.9 with some provisioning templates. The org that owns host.example.com may not have permissions on the provisioning templates assigned to Debian 12.9.

In the provisioning SIG we talked about a “Copy settings from X” feature, where it was more a manual first step. Perhaps that would be a better first step? There you can also explicitly select where to clone from. For example, you may always use Debian 12 (without a minor) as your template.

I would go one step further because we have this issue multiple times.

The expectation is, that the OS / assigned templates etc are set up correctly so that it can be used immediatley for provision new hosts. This is not the case, if a OS was created by running subscription-manager on a host which would then register this host on foreman.

I would love to have a functionality, like a OS template which would be used while generating a OS from facts. Example:

RHEL 10 is the template. RHEL 10.0 used the template RHEL 10.

This would be a simple “template” - all the data is copied over from the template. If you want to adjust settings for RHEL10.0 it would only change values from RHEL10.0 and would not affect RHEL10.

2 Likes

Not against the idea, but I’m a little scared that I might introduce some unexpected behavior, aka bugs, and users won’t have a chance to disable it.

I must admit that again, I forgot about the taxonomies. Added to notes and will test the behavior.

Interesting idea, I like it.

This would also replace most of this extension katello/app/models/katello/concerns/operatingsystem_extensions.rb at master · Katello/katello · GitHub and generate a common / generic implementation.

2 Likes