Foreman, RHEL and no found subscriptions

Problem:
Fresh RHEL system does not see valid subscriptions

Expected outcome:
Fresh RHEL system sees a valid subscription and shows repositories

Foreman and Proxy versions:
Foreman 3.1.2
Proxy 3.1.2

Foreman and Proxy plugin versions:
Katello 4.3.0

Distribution and version:
Foreman - CentOS 7.9 uptodate
Proxy - CentOS 7.9 uptodate
Client - RHEL 7.9 from ISO

Other relevant data:
A colleague is currently automating RHEL-installations through PXE.
We configured our Foreman server, added the needed manifest,
enabled all the repositories we need and want, but can’t get the
client to subscribe automatically to the right subscription.

Ok, first step was to install a system by hand to tinker with it.
Installed a complete fresh system with RHEL from ISO, nothing changed, just logged in and used
subscription-manager to register the system against our Foreman installation.

The command:

/usr/bin/subscription-manager register --force --org=company --activationkey=rhel7_default

The client finds the Foreman server, connected through a Foreman proxy, registers itself and does not
find a valid subscription.

Literally the output:

The system had been registered with ID: L0nG-V4lU3
The registered systemname: my-testing-system
Current status of the installed products:
Productname: Red Hat Enterprise Linux Server
Status: Not subscribed

Unable to find available subscriptions for all your installed products

This is the configuration of the activationkey:

If an option seems a bit odd, I played with some of them, enabling, disabling, different value, etc.

Output from “subscription-manager list --available”:

Subscriptionname:  Red Hat Enterprise Linux for Virtual Datacenters, Standard
Provides:          Red Hat Beta
                   Red Hat Software Collections (for RHEL Server)
                   Red Hat Enterprise Linux for x86_64
                   Red Hat CodeReady Linux Builder for x86_64
                   Red Hat Ansible Engine
                   Oracle Java (for RHEL Server)
                   Red Hat Developer Tools (for RHEL Server)
                   Red Hat Enterprise Linux Atomic Host
                   Red Hat Developer Tools Beta (for RHEL Server)
                   Red Hat Enterprise Linux Server
                   dotNET on RHEL (for RHEL Server)
                   Red Hat Software Collections Beta (for RHEL Server)
                   Red Hat Developer Toolset (for RHEL Server)
                   Red Hat Enterprise Linux Atomic Host Beta
SKU:               RH00050
Contract:          123456790
Pool-ID:           11aa22bb33cc44dd55ee66ff
Provides Management: yes
Availablity:       Unlimited
Recommende:        1
Servicetype:        L1-L3
Roles:             Red Hat Enterprise Linux Server
Servicelevel:      Standard
Usage:             Production
Add-ons:
Subscriptiontype:  Standard (Temporary)
Begins:            01.12.2021
Ends:              14.10.2023
Entitlement Type:  Virtual

And ideas, why the VM does not find the subscription automatically?

But that doesn’t tell the client to access your foreman server. You have to register the client to the foreman server first, otherwise subscription-manager will access redhat servers…

Compare Deploying a Custom SSL Certificate to Hosts or Registering a CentOS Stream Host to Foreman

1 Like

Excuse me for not mentioning that, but that I did that as well,
because otherwise the host wouldn’t appear in Foreman.

Why did you use “–force”? That should usually be not necessary. You’ll never know what is left behind… You first unregister the client and then register it to the new server…

If it’s correct your host is configured for content view “rhel7”. Does that content view contain all the repositories you need?

Or switch to the “Default Organization View” to see if it works then. The default view in the Library environment basically has access to everything available…

What does subscription-manager list and status and attach --auto show?

# subscription-manager list
# subscription-manager status
# subscription-manager attach --auto

As mentioned earlier, just played around with various parameters,
to see if one gives me the wanted result.

Yes, the content view “rhel7” does contain al the needed repositories.
It is shown in the last screenshot of the first message.

Will check what happens if “Default Organization View” is used.

Output of the subscription-manager commands:

subscription-manager list
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        7.9
Arch:           x86_64
Status:         Not Subscribed
Status Details: Not supported by a valid subscription.
Starts:
Ends:

subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Invalid

Red Hat Enterprise Linux Server:
- Not supported by a valid subscription.

System Purpose Status: Not Specified



subscription-manager attach --auto
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

It seems that “attach --auto” is needed after registration, with the
current configuration.

Okay, created an activation key with “Default Organization View” and
it just worked.
After registration the system got immediately subscribed.

That looks to me like the repository set for the host and not the repos in the content view. But I‘m still on 4.2 so it may look different.

This also suggest that your content view doesn‘t contain the necessary repos. Check which repos you have added to the content view “rhel7”.

Checked again the content view.
Some point releases were missing, like Server RPMs 7.1.
Added them and now the registration worked.
Thank you for the help.