Bug 1821457 - [RFE] Capsules shouldn't update hosts' "Registered through" facts on the Satellite server in a load-balanced configuration.
Summary: [RFE] Capsules shouldn't update hosts' "Registered through" facts on the Sate...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Subscription Management
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: 6.8.0
Assignee: satellite6-bugs
QA Contact: Cole Higgins
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-06 21:08 UTC by Jessica Hanley
Modified: 2023-10-06 19:36 UTC (History)
11 users (show)

Fixed In Version: rubygem-katello-3.16.0-0.16.rc4.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1851151 (view as bug list)
Environment:
Last Closed: 2020-10-27 13:01:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 29986 0 Normal Closed [RFE] Capsules shouldn't update hosts' "Registered through" facts on the Satellite server in a load-balanced configurat... 2021-01-25 01:15:55 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 13:01:47 UTC

Description Jessica Hanley 2020-04-06 21:08:44 UTC
1. Proposed title of this feature request

Capsules shouldn't update hosts' "Registered through" facts on the Satellite server in a load-balanced configuration.

2. What is the nature and description of the request?

The customer would like to prevent the capsules from sending hosts' "Registered through" facts to the Satellite server when they're set up in a load-balanced configuration.

3. Why does the customer need this? (List the business requirements here)

From the customer: The vast majority of our hosts are registered through a load balancer.  We've had some issues with the audits table growing too quickly, along with other host-initiated tasks happening too frequently.  Looking through the audits list, I see that hosts are updating their "Registered through" every day when our day cronjob runs.  If this is happening on each of the 68k hosts everyday, that is a lot of extra work that doesn't need to be done by the Satellite.

4. HHow would the customer like to achieve this? (List the functional requirements here)

Hosts connecting to Satellite through load-balanced capsules should report their "registered_through" value as the load-balancer VIP (as determined by the "hostname" setting in rhsm.conf on the host" rather than the actual FQDN of the capsule itself.

5. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

Monitor the audits table for flapping "registered through" entries

6. Is there already an existing RFE upstream or in Red Hat Bugzilla?

No

7. Does the customer have any specific time-line dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?

No

8. Is the sales team involved in this request and do they have any additional input?

No

9. Would the customer be able to assist in testing this functionality if implemented?

Yes

Comment 4 Lukas Zapletal 2020-04-08 11:54:15 UTC
Please add "without_auditing" around that code:

SubscriptionFacet.without_auditing do
  host.subscription_facet.update_attribute(:registered_through, parent_host)
end

The customer can easily do this as hotfix, warning this is untested need someone from Katello team to confirm. Should work.

Moving to proper BZ component for further triage.

Comment 5 Dylan Gross 2020-04-08 13:25:10 UTC
Customer contacted me to stress that he wasn't asking that this *NOT* be audited.  Only that it not update flapping values between Load-Balanced capsules.

He did some testing and confirmed that changing HTTP_X_FORWARDED_SERVER to HTTP_X_FORWARDED_HOST will successfully record the client's rhsm.conf hostname value in the "registered through" attribute of the content host.  I also added the bit to strip out the port number.  The audit entry was also successfully reflects the same value.

~~~
    def get_parent_host(headers)
      hostnames = headers["HTTP_X_FORWARDED_HOST"]
      host = hostnames.split(/[^\w.]/)[0] if hostnames
      host || SETTINGS[:fqdn]
    end
~~~"

Comment 6 Partha Aji 2020-06-02 13:38:15 UTC
Connecting redmine issue https://projects.theforeman.org/issues/29986 from this bug

Comment 7 Bryan Kearney 2020-06-09 16:03:52 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/29986 has been resolved.

Comment 12 errata-xmlrpc 2020-10-27 13:01:16 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 (Important: Satellite 6.8 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-2020:4366


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