Bug 1315817 - Facts are deleted when a discovered host is provisioned, breaking kexec template for PXEless
Facts are deleted when a discovered host is provisioned, breaking kexec templ...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Discovery Plugin (Show other bugs)
6.0.4
Unspecified Unspecified
unspecified Severity high (vote)
: Beta
: --
Assigned To: Lukas Zapletal
sthirugn@redhat.com
http://projects.theforeman.org/issues...
: Triaged
: 1338062 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-08 11:46 EST by Stephen Benjamin
Modified: 2016-07-27 05:26 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-27 05:26:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 14100 None None None 2016-04-22 12:19 EDT

  None (edit)
Description Stephen Benjamin 2016-03-08 11:46:35 EST
Host facts get cleared, which breaks the `ip=` line in the kexec template:

<pre>
{
  "kernel": "boot/CentOS-7.1-x86_64-vmlinuz",
  "initram": "boot/CentOS-7.1-x86_64-initrd.img",
  "append": "ks=http://192.168.121.45:3000/unattended/provision?token=05d805c7-21be-46af-89cb-18c5a18527a1&static=yes inst.ks.sendmac ip=::::::none nameserver= ksdevice=bootif BOOTIF= "
}
</pre>


We need to preserve the discovery_* facts, or better - preserve all of them, what if a discovery user wants to use custom discovery facts in a provision template?
Comment 1 Stephen Benjamin 2016-03-08 11:46:37 EST
Created from redmine issue http://projects.theforeman.org/issues/14100
Comment 2 Stephen Benjamin 2016-03-08 11:48:43 EST
Found this nasty bug during the PXEless demo today. Foreman now clears facts on build:

  https://github.com/theforeman/foreman/blob/develop/app/models/host/managed.rb#L255
Comment 5 Bryan Kearney 2016-03-11 10:03:27 EST
Moving to POST since upstream bug http://projects.theforeman.org/issues/14100 has been closed
-------------
Anonymous
Applied in changeset commit:foreman_discovery|9384b9f3c960f4158772ec667cf28bfec51bfe24.
Comment 6 sthirugn@redhat.com 2016-03-24 13:43:16 EDT
Verified in Satellite-6.2-beta-Snap5.1

Steps:
1. Provision a pxeless discovery host
2. In the discovery boot add some custom facts like the following:
 - discovery_fact1 = value1
 - discovery_fact2 = value2
 - fact3 = value3
 - fact4 = value4
3. Locate the discovered host in UI
4. Review to make sure all 4 facts from above show up in the discovered host.  Note that the last two facts will be under the Misc section.
5. Auto provision the discovered host with discovery rules based on facts above.
6. After provisioning, review the host.
 - First two facts still show up in the host
 - Last two facts are gone.
Comment 8 Lukas Zapletal 2016-05-23 07:22:04 EDT
*** Bug 1338062 has been marked as a duplicate of this bug. ***
Comment 10 errata-xmlrpc 2016-07-27 05:26:34 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501

Note You need to log in before you can comment on or make changes to this bug.