Bug 1272238
Summary: | Setting a host build state to true facts are lost | ||
---|---|---|---|
Product: | Red Hat OpenStack | Reporter: | Dave Sullivan <dsulliva> |
Component: | foreman | Assignee: | Mike Burns <mburns> |
Status: | CLOSED EOL | QA Contact: | Shai Revivo <srevivo> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | Foreman (RHEL 6) | CC: | bkearney, dmaley, dsulliva, hbrock, jcoufal, johfulto, kbasil, lzap, mburns, morazi, ohadlevy, rhos-maint, scohen, srevivo |
Target Milestone: | async | Keywords: | ZStream |
Target Release: | Installer | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | foreman-1.6.0.44-7.el6ost | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-09-29 13:39:42 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Dave Sullivan
2015-10-15 20:35:15 UTC
Adding bkearney as well. Bryan, any thoughts on this? deleting facts (and reports) on host build was done on purpose, Could you please provide information on why you would need it to stay when rebuilding a machine? (granted that when the machine is re provisioned, its out of date / irrelevant facts are purged anyway). per customer.... Current workflow is: 1. Boot servers into discovered_hosts 2. Host added to "hosts" table from discovered_hosts (build=0) and assigned to proper groups,hostname,ip,etc.. 3. Server build is executed "build=1" and foreman-hooks (after_build) are executed. If any hooks were relying on facts_hash (ie: checking for processorcount,processor0,memorytotal,manufactuer,modelname,etc...) those hooks will fail to find those entries. Since most facts collected during discovered_hosts is hardware related, we expected those facts to remain (as hardware isn't changing), at least until the provision process is finished (ie: before_provision hook is executed). Hope this helps? In latest version of Discovery (upstream) we actually prevent deletion of some facts (prefixed with "discovery_"): https://github.com/theforeman/foreman_discovery/blob/develop/app/services/foreman_discovery/host_converter.rb#L22-L25 You can use similar code as a workaround for now, maybe it makes sense to keep *all* discovered facts during provisioning. Or at least some (configurable by an option) if that breaks provisioning (network detection might fail perhaps). Ohad, if it makes sense we can keep them all: http://projects.theforeman.org/issues/12244 This is on the foreman server side, right? not the discovery image? Right it's foreman server side. [root@gss-rhos-3 foreman]# grep -B 5 -A 5 setBuild app/models/host/managed.rb # Called by build link in the list # Build is set # The boot link and autosign entry are created # Any existing puppet certificates are deleted # Any facts are discarded def setBuild self.build = true self.save errors.empty? end So looks like self.save calls a before_save hook that calls clear_data_on_build /usr/share/foreman/app/models/host/managed.rb # Custom hooks will be executed after_commit after_commit :build_hooks before_save :clear_data_on_build ... def clear_data_on_build return unless respond_to?(:old) && old && build? && !old.build? clearFacts clearReports end If we know on provision/re-provision the facts are regenerated/overwritten. Why can't we just comment out clearFacts, not sure the implications of this though. Dave, I believe your fix would work as well (for all usage cases and not just discovered hosts) - would that be sufficient? This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions Closing list of bugs for RHEL OSP Installer since its support cycle has already ended [0]. If there is some bug closed by mistake, feel free to re-open. For new deployments, please, use RHOSP director (starting with version 7). -- Jaromir Coufal -- Sr. Product Manager -- Red Hat OpenStack Platform [0] https://access.redhat.com/support/policy/updates/openstack/platform |