Bug #6006

OS facts should not overwrite the OS selected to provision with

Added by Dominic Cleal over 3 years ago. Updated about 1 year ago.

Status:Closed
Priority:Normal
Assigned To:Trey Dockendorf
Category:Importers
Target version:-
Difficulty: Bugzilla link:1261667
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4077
Story points-
Velocity based estimate-
Release1.15.0Release relationshipAuto

Description

Migrated from https://github.com/theforeman/foreman/issues/1489

We setup a specific Operatingsystem, 'Ubuntu 12.04 + 3.2.0-59 kernel', and selected this OS in the hostgroup for machines that need this specific kernel.

We then built the hosts successfully.

Post-build, the Operatingsystem was set to 'Ubuntu 12.04.4 LTS'. This then caused a re-build of the system to fail, as the wrong kernel was installed.

I suspect the error is around line 47 in app/services/facts_parser.rb, as for our host, the os.description field is blank, because it is filled from the hostgroup. I am unclear on what a good fix for this is, but I will try and dig into more and produce a pull request, unless someone has an easy idea on it.

Another thought of mine is that facts collection should not overwrite fields that are critical to the provisioning process.


Related issues

Related to Foreman - Bug #11937: Yum updating a managed host can invalidate its data in Fo... New 09/23/2015
Related to Foreman - Bug #12076: Unable to create Mulitple OS with same name, major, minor Rejected 10/06/2015
Related to Foreman - Feature #15078: Disable updates to operating system from Puppet facts Duplicate 05/18/2016
Duplicated by Foreman - Feature #12235: OS minor versions should all use the same templates, inst... Duplicate 10/21/2015

Associated revisions

Revision ef9f2f9d
Added by Trey Dockendorf about 1 year ago

Fixes #6006 - Add options to disable updates from facts

Add option ignore_facts_for_operatingsystem:
do not update system's operating system based on facts
Add option ignore_facts_for_domain:
do not update system's domain based on facts

History

#1 Updated by Dominic Cleal over 3 years ago

I think it's likely creating a new OS if the exact major/minor numbers aren't found on the existing OS, this might contain the ".4" too.

#2 Updated by Aaron Stone over 3 years ago

There are at least three problems here, all of which are caused by Foreman reassigning the Operating System out from under us.

Problem 1: I assigned the host an OS, but Foreman invented a new OS entry instead of leaving it alone.

Problem 2: I assigned the host an OS, but Foreman reassigned the host to a different OS with the same name and version, because two entries with matching name and version numbers could be returning in different order from the database at different queries. Instead of leaving it alone.

Problem 3: I assigned the host an OS, and months later did a package upgrade which changed the OS micro version, causing Foreman to reassign the OS instead of leaving it alone.

We have operating System entries like "Ubuntu 12.04 + 3.2.0 kernel" and "Ubuntu 12.04 + 3.13.0 kernel". Based on which OS I assigned to a machine, I have different netboot, templates, and parameters. These are set up as:

Name: Ubuntu
Major: 12
Minor: 04
Description: + 3.2.0 kernel
/ Description: + 3.13.0 kernel
/ Description: with alternate netboot, etc.

Can we disable Foreman from reassigning the OS based on the received facts?

Should we be using some other mechanism to control the host OS installation parameters!?

#4 Updated by Dominic Cleal about 2 years ago

  • Related to Bug #11937: Yum updating a managed host can invalidate its data in Foreman. added

#5 Updated by Dominic Cleal about 2 years ago

  • Duplicated by Feature #12235: OS minor versions should all use the same templates, installation media, and partition tables added

#6 Updated by Dominic Cleal about 2 years ago

  • Related to Bug #12076: Unable to create Mulitple OS with same name, major, minor added

#7 Updated by Trey Dockendorf over 1 year ago

  • Related to Feature #15078: Disable updates to operating system from Puppet facts added

#8 Updated by The Foreman Bot about 1 year ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4077 added

#9 Updated by Tomer Brisker about 1 year ago

  • Bugzilla link set to 1261667

#10 Updated by Anonymous about 1 year ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#11 Updated by Dominic Cleal about 1 year ago

  • Assigned To set to Trey Dockendorf
  • Release set to 1.15.0

Also available in: Atom PDF