Bug 1746391

Summary: no ability to register to insights during installation
Product: Red Hat Enterprise Linux 8 Reporter: Andreas Nilsson <anilsson>
Component: anacondaAssignee: Martin Kolman <mkolman>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact: Sharon Moroney <smoroney>
Priority: unspecified    
Version: 8.2CC: jstodola, mkolman, mvollmer, rvykydal, sbueno, smoroney, wchadwic
Target Milestone: rcKeywords: FutureFeature
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: anaconda-29.19.2.5-1 Doc Type: Enhancement
Doc Text:
.Ability to register your system to Red Hat Insights during installation In RHEL 8.2, you can register your system to Red Hat Insights during installation. Interactive GUI installations, as well as automated Kickstart installations, support this feature. Benefits include: * Easier to identify, prioritize, and resolve issues before business operations are affected. * Proactively identify and remediate threats to security, performance, availability, and stability with predictive analytics. * Avoid problems and unplanned downtime in your environment.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 15:30:46 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 Andreas Nilsson 2019-08-28 10:44:44 UTC
With Insights now included in the regular RHEL subscription, it would be nice to offer people to connect their system to Insights already in the installer, and not force them to do it as a post-installation task.

This is probably dependent on Martins work to integrate subscriptions in the Installer.

Comment 1 Martin Kolman 2019-08-29 13:29:55 UTC
I've played a bit with the insights client on a no-registered RHEL 8 system, and it looks pretty promising. This is what I got when calling the client with the --register option:

2019-08-28 19:37:02,804    DEBUG insights.client.auto_config Trying to autoconfigure...
2019-08-28 19:37:02,804    DEBUG insights.client.auto_config [Errno 2] No such file or directory: '/etc/pki/consumer/cert.pem'
2019-08-28 19:37:02,804    DEBUG insights.client.auto_config System is NOT subscription-manager registered

It seems insights already supports the RHSM authentication tokens for registration & I do have those in place in the installation environment once my prototype registers the machine & gets an entitlement attached. Also looking at the the client code it indeed looks like as a classical Python CLI application, so it should be possible to safely call it in the target system chroot, once the /etc/pki/consumer/cert.pem is copied over & it should be able to connect the target system to insights using the proper subscription. :)

So my next steps from the backend perspective:
- adding a task that will copy the RHSM authentication tokens to the target system
- extending the subscription kickstart command with a --connect-insights option (does this sound correct ? any other option naming suggestions ?)
- making sure the insights client is run in the target system chroot if --connect-insights is used in installation kickstart and connects the target system to insights

This way I should be able to check all works fine & we can move to the next step, wiring it all to the GUI.

Comment 2 Marius Vollmer 2019-08-30 07:09:58 UTC
(In reply to Martin Kolman from comment #1)

> It seems insights already supports the RHSM authentication tokens for
> registration & I do have those in place in the installation environment once
> my prototype registers the machine & gets an entitlement attached.

This is correct, in my experience.  On a registered machine, running "insights-client --register" is enough.  No additional inputs are needed.  (However, insights-client might need more files than just /etc/pki/consumer/cert.pem, maybe /etc/rhsm/rhsm.conf...)

> - extending the subscription kickstart command with a --connect-insights
> option (does this sound correct ? any other option naming suggestions ?)

We used the phrase "Connected to Insights" in the Cockpit UI because we only show things that are locally available on the machine, and don't want to talk to the Insights REST API.  To know whether a machine is "registered" one has to look into the Insights database on redhat.com (I think), and that's why I didn't want to use that term.

In your case, I think "--register-with-insights" would be better and less confusing, since you will ultimately call "insights-client --register", and the term "connect" doesn't really exist with a technical meaning in the Insight machinery.

Comment 14 Jan Stodola 2020-03-05 09:54:14 UTC
This feature is present in RHEL-8.2 Beta and later.

I'm moving this but to VERIFIED. Problems found during our testing were reported as new bugs.

Comment 18 errata-xmlrpc 2020-04-28 15:30:46 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, 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-2020:1584