Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1908015 - Discovered host is assigned a taxonomy at random and Satellite fails to honor the correct taxonomy when loading and matching discovery rules
Summary: Discovered host is assigned a taxonomy at random and Satellite fails to honor...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Discovery Plugin
Version: 6.8.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: 6.9.0
Assignee: Lukas Zapletal
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-15 17:05 UTC by Pablo Hess
Modified: 2024-06-13 23:44 UTC (History)
5 users (show)

Fixed In Version: Discovery Plugin 16.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1908856 (view as bug list)
Environment:
Last Closed: 2021-04-21 13:24:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30948 0 Normal Closed Auto provisioning does not work across organizations 2021-02-15 20:30:20 UTC
Red Hat Product Errata RHSA-2021:1313 0 None None None 2021-04-21 13:24:45 UTC

Description Pablo Hess 2020-12-15 17:05:31 UTC
Description of problem:
When using discovery rules, discovered hosts may be assigned a random taxonomy by Satellite. Satellite may say it assigned a different taxonomy right next (one that makes sense given e.g. the discovered host's subnet) but the newly assigned taxonomy will be disregarded when loading discovery rules.

As a result, discovery rules are loaded and matched as if the host still belonged to the randomly assigned taxonomy, not the actual taxonomy.

This can be worked around by setting the discovery_location and discovery_organization settings on Satellite to the correct ones the discovered host belongs to. However, if one wants to discover hosts in two or more different taxonomies and wants discovery rules to correctly load and match, this workaround does not fix the issue.


This has been resolved at least in part upstream: https://projects.theforeman.org/issues/30948


Version-Release number of selected component (if applicable):
foreman-2.1.2.21-1.el7sat.noarch
tfm-rubygem-foreman_discovery-16.1.2-1.el7sat.noarch
tfm-rubygem-smart_proxy_discovery-1.0.5-5.el7sat.noarch

How reproducible:
Every single time if a host's actual taxonomy does not match Satellite's default discovery taxonomy.

Steps to Reproduce:
1. Set Satellite's default discovery location to L2 or leave it undefined.
2. Have discovery rules in place for L1 that differ from the ones in L2.
3. Have a subnet S1 belonging to location L1 only.
4. Discover a host in S1 and L1.

Actual results:
Satellite loads discovery rules for L2 and none of them match; discovery rules do not work. But Satellite correctly re-assigns the host's location to L1. If one re-sends the discovery facts from the host, Satellite then loads discovery rules for L1 location and one of them finally matches the host, so the host reboots automatically to a functioning provisioning workflow.

Expected results:
Satellite figures out the host's taxonomy based on at least its subnet and correctly loads discovery rules accordingly, so one of those rules matches and automated discovery ensues.


Additional info:
Per lzap, this patch may need to be backported: https://github.com/theforeman/foreman_discovery/pull/509/files

Comment 2 Lukas Zapletal 2020-12-16 08:30:55 UTC
Please apply the following patch:

https://github.com/theforeman/foreman_discovery/pull/509/files

Find the app/controllers/api/v2/discovered_hosts_controller.rb file it resides somewhere reed in /opt/tfm SCL prefix I don't remember. Then restart all services.

I tried this on my system and I must have my taxonomy set up differently, it always works in my case. Confirming this works would be a huge help, thanks.

Comment 4 Bryan Kearney 2020-12-16 19:29:42 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30948 has been resolved.

Comment 12 errata-xmlrpc 2021-04-21 13:24:23 UTC
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 (Moderate: Satellite 6.9 Release), 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/RHSA-2021:1313


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