Bug #11678

Do not cache initial 10 facter runs on discovered node

Added by Rene Visser over 1 year ago. Updated about 1 year ago.

Status:Closed
Priority:Normal
Assigned To:-
Category:Image
Target version:Image 3.0.0
Difficulty: Pull request:https://github.com/theforeman/foreman-discovery-image/pull/23
Bugzilla link:
Story points-
Velocity based estimate-

Description

Im fairly new to discovery and provisioning on Bare Metal, but we are trying to discover a host which is pxe booting OK with the 2.1.1 FDI
via discovery proxy (version 1.0.2) it is publishing its facts to foreman (with discovery plugin 4.0.0) and in the foreman production.log we found the Host Discovery Failed.
After I put foreman in debug mode I captured the next Debug message:

Unable to assign subnet, primary interface is missing IP address

I've already logged in with ssh on host and saw there is a discovery_bootif fact. this was also logged in the foreman production.log

Why is Foreman unable to discover this host, and how can I debug this issue?
can anyone help me with this issue?

Associated revisions

Revision 153c964c
Added by Rene Visser over 1 year ago

Fixes #11678 - Do not cache initial 10 facter runs on discovered node

History

#1 Updated by Rene Visser over 1 year ago

after we do a discvover-register on the host it is discovered by foreman
some facts about the interfaces also have changed. So in the boot proces of the host the image sends some facts which are not correct at that time.
do we need to delay this and can we?

#2 Updated by Rene Visser over 1 year ago

created pull request https://github.com/theforeman/foreman-discovery-image/pull/23

start discovery-register service after network-online, because interfaces have to be renamed before starting the service.
Facter caches the facts and would otherwise hold the initial interface names (ethx). And the service keeps sending these (wrong) interface names.

This causes foreman to be unable to discover the host with (Debug) message: "Unable to assign subnet, primary interface is missing IP address"

I'm not really shure this is the right solution for this problem, but it did fix it for our situation.

#3 Updated by Rene Visser over 1 year ago

Other suggestion would be to call a Facter.clear every now and then in the discovery-register while true loop.
Because now the service keeps sending the cached facts (wich in fact could change)

#4 Updated by Lukas Zapletal over 1 year ago

  • Tracker changed from Support to Bug
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-discovery-image/pull/23 added

#5 Updated by Rene Visser over 1 year ago

adapted pull request

Facter cache now cleared first 10 times.

We have also discovered that changes since 2.1 stable had a positive influence on our issue.
probably commit 7618547 has already fixed our problem.

#6 Updated by Lukas Zapletal over 1 year ago

  • Subject changed from Unable to assign subnet, primary interface is missing IP address to Do not cache initial 10 facter runs on discovered node
  • Priority changed from High to Normal
  • Target version set to Plugin 5.0.0

#7 Updated by Lukas Zapletal over 1 year ago

  • Category changed from Discovery plugin to Image
  • Target version changed from Plugin 5.0.0 to Image 3.0.0

#8 Updated by Lukas Zapletal about 1 year ago

  • Status changed from Ready For Testing to Closed

This is now upstream.

Also available in: Atom PDF