RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1439645 - [RFE] yum plugin should update environment from Satellite
Summary: [RFE] yum plugin should update environment from Satellite
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: 1122832 1533259 1544891 1546815
TreeView+ depends on / blocked
 
Reported: 2017-04-06 11:09 UTC by Evgeni Golov
Modified: 2021-12-10 14:59 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 10:36:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1576582 0 high CLOSED rhsm configuration full_fresh_on_yum=1 is no longer working 2023-12-15 16:05:04 UTC
Red Hat Knowledge Base (Solution) 3030241 0 None None None 2017-05-11 10:09:08 UTC
Red Hat Product Errata RHBA-2018:3153 0 None None None 2018-10-30 10:37:12 UTC

Internal Links: 1576582

Description Evgeni Golov 2017-04-06 11:09:28 UTC
Description of problem:

RHEL 7.3 attached to Satellite 6.2(.8).

/etc/rhsm/rhsm.conf contains
 full_refresh_on_yum = 1

When I change the Lifecycle Environment or Content View on Satellite, I would expect it reflects immediately in /etc/yum.repos.d/redhat.repo on the next yum invocation, given the above setting is set. 
However, it is not. A "subscription-manager refresh" or a run of rhsmcertd is needed to have the file updated.

On the Satellite, I see the following request come in:
192.168.102.107 - 6f8b8bf9-3749-4412-9f76-3d7994b13074 [06/Apr/2017:12:56:49 +0200] "GET /rhsm/ HTTP/1.1" 200 1746 "-" "RHSM/1.0 (cmd=yum)"
192.168.102.107 - 6f8b8bf9-3749-4412-9f76-3d7994b13074 [06/Apr/2017:12:56:49 +0200] "GET /rhsm/consumers/6f8b8bf9-3749-4412-9f76-3d7994b13074/content_overrides HTTP/1.1" 200 319 "-" "RHSM/1.0 (cmd=yum)"
192.168.102.107 - 6f8b8bf9-3749-4412-9f76-3d7994b13074 [06/Apr/2017:12:56:49 +0200] "GET /rhsm/consumers/6f8b8bf9-3749-4412-9f76-3d7994b13074/release HTTP/1.1" 200 19 "-" "RHSM/1.0 (cmd=yum)"

And when switching the option to 0:
192.168.102.107 - 6f8b8bf9-3749-4412-9f76-3d7994b13074 [06/Apr/2017:12:57:31 +0200] "GET /rhsm/ HTTP/1.1" 200 1746 "-" "RHSM/1.0 (cmd=yum)"
192.168.102.107 - 6f8b8bf9-3749-4412-9f76-3d7994b13074 [06/Apr/2017:12:57:31 +0200] "GET /rhsm/consumers/6f8b8bf9-3749-4412-9f76-3d7994b13074/release HTTP/1.1" 200 19 "-" "RHSM/1.0 (cmd=yum)"

As you can see, when it's 1, it properly fetches /content_overrides, and does not, when off.
However, /content_overrides does not contain the environment, only /rhsm/consumers/6f8b8bf9-3749-4412-9f76-3d7994b13074/ does.

Version-Release number of selected component (if applicable):
subscription-manager-1.17.15-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. register system to Satellite
2. on Satellite, update the system to use another Content View or Lifecycle Environment
3. yum install vim

Actual results:
vim is installed from the _old_ CV/LE

Expected results:
redhat.repo is refreshed and vim is installed from the _new_ CV/LE

Additional info:

Comment 2 Kevin Howell 2017-04-10 15:12:50 UTC
Justin, what is the expected behavior from a Katello point of view?

Comment 3 Justin Sherrill 2017-04-18 02:50:45 UTC
The expected behavior is exactly as Evgeni describes.  If a consumer's 'Environment' changes, a full sub-man refresh (or rhsmcertd checkin) is required for it to pull down the new entitlement cert that contains the environment information. 

The desired behavior is just what Evgeni suggests it should be, when performing any yum action this check is performed.  I'm not sure of the performance implications of this, but its been a desired feature for some time.

Comment 4 Peter Vreman 2017-05-10 07:22:34 UTC
I would also like to see this feature.

Recent (starting with RHEL6.9) changes to use 'subscription-manager refresh' make also that call more expensive.
See https://bugzilla.redhat.com/show_bug.cgi?id=1393580, https://bugzilla.redhat.com/show_bug.cgi?id=1360909 and https://bugzilla.redhat.com/show_bug.cgi?id=1367243

Currenly my hourly process contains always of the following steps to make sure that yum and puppet are garantueed to use the latest repos provided by the ContentView:

subscription-manager refresh
subscription-manager release --set $(subscription-manager release --list | tail -n1)
subscription-manager repos --enable='*'
yum clean expire-cache
yum repolist

Only after these steps i am sure that i use the latest redhat repos, also in case the EUS minor release is being change (e.g. 7.2 to 7.3 repos).
Now i can do:

yum check-update    or   yum update
puppet agent -t --noop    or   puppet agent -t 


I have this process hourly from the cron on 300+ servers. It has a noticable cpu consumption on the Satellite. But better a bit slower and a reliable output then quick an uncomparable results.

Comment 9 Evgeni Golov 2018-04-04 07:08:36 UTC
re-tested on 6.3 with the following bits on the client:
# rpm -q subscription-manager python-rhsm
subscription-manager-1.19.21-1.el7.x86_64
python-rhsm-1.19.9-1.el7.x86_64


behavior is unchanged, LCE/CV are not updated.

Comment 10 Peter Vreman 2018-04-26 05:43:08 UTC
With RHEL6.9,RHEL7.3+ i verified with both Sat6.2 and Sat6.3 that at least an explicit call to subscription-manager refresh is not needed anymore.

Only the request subscription-manager to enable all repositories does the job:

sudo subscription-manager repos --enable=\*

And additional you already have the step to change EUS/E4S release also with subscripotio-manager if you want to do the OS upgrade of the minor release:


sudo subscription-manager release --set=$(sudo subscription-manager release --list 2>/dev/null | grep '^[0-9]' | sed 's+Server+.99+' | sort -V | tail -n1 | sed 's+.99+Server+')

Only with both steps the new changes are enabled when you want to do the minor release upgrade for EUS/E4S attached host. e.g. upgrading from RHEL7.4-EUS to RHEL7.5-EUS

At least for me the requirement that 'subscription-manager refresh' is not needed anymore is a big step forward.

Comment 16 Rehana 2018-06-22 13:09:40 UTC
Note: Please click on "Unwrap comments" for better reading experience 

Reproducing the failure on RHEL7.3 registered against Satellite 6.3 machine
=========================================================================
subscription-manager: 1.17.15-1.el7
python-rhsm: 1.17.9-1.el7

prerequisite on satellite server:
==============
Created a product (ex: Product-for-1439645)
Created 2 repositories for the product (ex: Satellite-6_3-GA and Satellite-6_2-GA
Created contentview using the about repositories 
(ex: content_view_1 ==>pointing to Satellite-6_3-GA and 
     content_view_2 ==>pointing to Satellite-6_2-GA

(Please refer the details in the additional notes section, or on the polarion test case link) 


On the client:
--------------
Make sure full_refresh_on_yum is ON
# subscription-manager config --list | grep full_refresh_on_yum
   full_refresh_on_yum = 1

1)Install the satellite certificate on the system

2) Register client 
subscription-manager register --org="Default_Organization" --environment="Library"

3)Login to Satellite , go to Hosts-->Content Hosts-->Search for the Client hostname --> Navigate to "Subscriptions" tab and attach the subscriptions that are associated with contentviews 

4)Execute subscription-manager refresh on the system to get the entitlement 
certificate on the client

5)Click on the Hostname -->Under the Details tab --> Look for the section "Content Host Content" --> select the content view (ex: content_view_1)

6)Yum install a content from repo on the system

[root@hp-dl380pgen8-02-vm-4 test]# yum list available | grep qpid-proton*
python-qpid-proton.x86_64                              0.9-16.el7         Default_Organization_Product-for-1439645_Satellite-6_2-GA
qpid-proton-c.x86_64                                   0.9-16.el7         Default_Organization_Product-for-1439645_Satellite-6_2-GA


choose "qpid-proton" , as the rpm did not have any dependencies. 

[root@hp-dl380pgen8-02-vm-4 test]# yum install qpid-proton-c.x86_64                                                                          0.16.0-7.el7                                                Default_Organization_Product-for-1439645_Satellite-6_3-GA
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Default_Organization_Product-for-1439645_Satellite-6_3-GA                                                                                                                                   | 2.1 kB  00:00:00     
No package 0.16.0-7.el7 available.
No package Default_Organization_Product-for-1439645_Satellite-6_3-GA available.
Resolving Dependencies
--> Running transaction check
---> Package qpid-proton-c.x86_64 0:0.16.0-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                   Arch                               Version                                  Repository                                                                             Size
===================================================================================================================================================================================================================
Installing:
 qpid-proton-c                             x86_64                             0.16.0-7.el7                             Default_Organization_Product-for-1439645_Satellite-6_3-GA                             131 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total download size: 131 k
Installed size: 334 k
Is this ok [y/d/N]: y
Downloading packages:
qpid-proton-c-0.16.0-7.el7.x86_64.rpm                                                                                                                                                       | 131 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : qpid-proton-c-0.16.0-7.el7.x86_64                                                                                                                                                               1/1 
  Verifying  : qpid-proton-c-0.16.0-7.el7.x86_64                                                                                                                                                               1/1 

Installed:
  qpid-proton-c.x86_64 0:0.16.0-7.el7                                                                                                                                                                              

Complete!

NOTICE that the content is installed from "Default_Organization_Product-for-1439645_Satellite-6_3-GA" 

7.Remove the content from the system 

[root@hp-dl380pgen8-02-vm-4 test]# yum remove qpid-proton-c.x86_64
<snip>
Removed:
  tracer-common.noarch 0:0.6.13.1-1.el7sat                                                                                                                                                                         

Complete!

8. Change the content view from the satellite server to content_view_2
Click on the Hostname -->Under the Details tab --> Look for the section "Content Host Content" --> select the contentview (Ex: content_view_2)

9) Try  to install the same package

[root@hp-dl380pgen8-02-vm-4 test]# yum install qpid-proton-c.x86_64
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Default_Organization_Product-for-1439645_Satellite-6_3-GA                                                                                                                                   | 2.1 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package qpid-proton-c.x86_64 0:0.16.0-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                   Arch                               Version                                  Repository                                                                             Size
===================================================================================================================================================================================================================
Installing:
 qpid-proton-c                             x86_64                             0.16.0-7.el7                             Default_Organization_Product-for-1439645_Satellite-6_3-GA                             131 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total download size: 131 k
Installed size: 334 k
Is this ok [y/d/N]: n
Exiting on user command
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx.2018-06-22.08-41.ogo2xy.yumtx


NOTICE that the content is still installing from "Default_Organization_Product-for-1439645_Satellite-6_3-GA"(which is from content_view_1)  , it should be "Default_Organization_Product-for-1439645_Satellite-6_2-GA"( from 
content_view_2)

Now lets try the current "workaround" and check if the system is getting content from the content_view_2 post executing the `subscription-manager refresh` command

10) Execute `subscription-manager refresh` on the system and then try to install the package.

[root@hp-dl380pgen8-02-vm-4 test]# subscription-manager refresh
2 local certificates have been deleted.
All local data refreshed

[root@hp-dl380pgen8-02-vm-4 test]# yum install qpid-proton-c.x86_64
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Default_Organization_Product-for-1439645_Satellite-6_2-GA                                                                                                                                   | 2.1 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package qpid-proton-c.x86_64 0:0.9-16.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                   Arch                               Version                                  Repository                                                                             Size
===================================================================================================================================================================================================================
Installing:
 qpid-proton-c                             x86_64                             0.9-16.el7                               Default_Organization_Product-for-1439645_Satellite-6_2-GA                             135 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total download size: 135 k
Installed size: 356 k

OBSERVED that yum request to install a package after executing `subscription-manager refresh` is getting the content from content_view_2, which points to Satellite-6.2 (ex: Default_Organization_Product-for-1439645_Satellite-6_2-GA)

Above test steps demonstrates that the issue was successfully reproduced on a older version of subscription-manager (subscription-manager: 1.17.15-1.el7)

Additional notes:
===================

to create product:
==============
Login to Satellite 6 environment with valid credentials
Navigate to Content -->Products --> Click on New product --> Provide a "Name" --> Click on Save

Now create repository for the product:
===========================
Select the 'Product' --> Click on "New Repository" --> Provide "Name", type as "yum" , Provide a "upstream" URL to content_view_1 or content_view_2 from below --> Sync the content

content_view_1 upstream repo: 
http://download-node-02.eng.bos.redhat.com/released/Satellite-6/6.3-GA/SatTools-RHEL-7/Server/x86_64/os/

content_view_2 upstream repo:
http://download-node-02.eng.bos.redhat.com/released/Satellite-6/6.2-GA/SatTools-RHEL-7/Server/x86_64/os/ 

Create a contentview:
================
 Navigate to Content -->Content Views --> Provide a "Name" and Add the newly created Repository from above--> Publish the content view

Comment 17 Rehana 2018-06-22 16:43:46 UTC
Note: Please click on "Unwrap comments" for better reading experience 


Verifying with (subscription-manager: 1.21.5-4.el7)
=================================================
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.4.5.64.2-Unknown
subscription management rules: 5.26
subscription-manager: 1.21.5-4.el7


1.Update the subscription-manager package to the latest

[root@hp-dl380pgen8-02-vm-4 ~]# yum update subscription-manager --quiet

===================================================================================================================================================================================================================
 Package                                                                Arch                                   Version                                         Repository                                     Size
===================================================================================================================================================================================================================
Installing:
 subscription-manager-rhsm                                              x86_64                                 1.21.5-4.el7                                    RHEL76-Server                                 291 k
     replacing  python-rhsm.x86_64 1.17.9-1.el7
 subscription-manager-rhsm-certificates                                 x86_64                                 1.21.5-4.el7                                    RHEL76-Server                                 206 k
     replacing  python-rhsm-certificates.x86_64 1.17.9-1.el7
Updating:
 subscription-manager                                                   x86_64                                 1.21.5-4.el7                                    RHEL76-Server                                 1.0 M
Installing for dependencies:
 python-chardet                                                         noarch                                 2.2.1-1.el7_1                                   RHEL76-Server                                 227 k
 python-inotify                                                         noarch                                 0.9.4-4.el7                                     RHEL76-Server                                  49 k
 python-kitchen                                                         noarch                                 1.1.1-5.el7                                     RHEL76-Server                                 266 k
 python-six                                                             noarch                                 1.9.0-2.el7                                     RHEL76-Server                                  29 k
Updating for dependencies:
 python-dmidecode                                                       x86_64                                 3.12.2-2.el7                                    RHEL76-Server                                  83 k

Transaction Summary
===================================================================================================================================================================================================================
Install  2 Packages (+4 Dependent packages)
Upgrade  1 Package  (+1 Dependent package)

Is this ok [y/d/N]: y
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
warning: /etc/rhsm/rhsm.conf created as /etc/rhsm/rhsm.conf.rpmnew



2)Make sure full_refresh_on_yum is ON
# subscription-manager config --list | grep full_refresh_on_yum
   full_refresh_on_yum = 1

3) Register client 
subscription-manager register --org="Default_Organization" --environment="Library"

# subscription-manager register --org="Default_Organization" --environment="Library"
Registering to: jyejaretestsat.usersys.redhat.com:443/rhsm
Username: admin
Password: 
The system has been registered with ID: aa426bd1-2262-44fb-b01b-648922163ecf
The registered system name is: hp-dl380pgen8-02-vm-4.lab.bos.redhat.com



4)Login to Satellite , go to Hosts-->Content Hosts-->Search for the Client hostname --> Navigate to "Subscriptions" tab and attach the subscriptions that are associated with contentviews  (ex:Product-for-1439645)

5)Execute subscription-manager refresh on the system to get the entitlement 
certificate on the client

[root@hp-dl380pgen8-02-vm-4 ~]# subscription-manager refresh
All local data refreshed
[root@hp-dl380pgen8-02-vm-4 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Product-for-1439645
Provides:            Product-for-1439645
SKU:                 1915404394
Contract:            
Account:             
Serial:              7454803335654394858
Pool ID:             2c9094a263f317ab01642723fb661c99
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       
Service Type:        
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              Friday 22 June 2018
Ends:                Sunday 14 June 2048
System Type:         Physical


6)Click on the Hostname -->Under the Details tab --> Look for the section "Content Host Content" --> select the content view (ex: content_view_1)

[root@hp-dl380pgen8-02-vm-4 ~]# yum install qpid-proton-c.x86_64 --quiet
1 local certificate has been deleted.

===================================================================================================================================================================================================================
 Package                                   Arch                               Version                                  Repository                                                                             Size
===================================================================================================================================================================================================================
Updating:
 qpid-proton-c                             x86_64                             0.16.0-7.el7                             Default_Organization_Product-for-1439645_Satellite-6_3-GA                             131 k

Transaction Summary
===================================================================================================================================================================================================================
Upgrade  1 Package

Is this ok [y/d/N]: y
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.

7) Remove the installed content

[root@hp-dl380pgen8-02-vm-4 ~]# yum remove qpid-proton-c.x86_64
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Resolving Dependencies
--> Running transaction check
---> Package qpid-proton-c.x86_64 0:0.16.0-7.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                  Arch                              Version                                    Repository                                                                             Size
===================================================================================================================================================================================================================
Removing:
 qpid-proton-c                            x86_64                            0.16.0-7.el7                               @Default_Organization_Product-for-1439645_Satellite-6_3-GA                            334 k

Transaction Summary
===================================================================================================================================================================================================================
Remove  1 Package

Installed size: 334 k
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : qpid-proton-c-0.16.0-7.el7.x86_64                                                                                                                                                               1/1 
Default_Organization_Product-for-1439645_Satellite-6_3-GA                                                                                                                                   | 2.1 kB  00:00:00     
  Verifying  : qpid-proton-c-0.16.0-7.el7.x86_64                                                                                                                                                               1/1 

Removed:
  qpid-proton-c.x86_64 0:0.16.0-7.el7                                                                                                                                                                              

Complete!

8) Change the content view from the satellite server to content_view_2
Click on the Hostname -->Under the Details tab --> Look for the section "Content Host Content" --> select the contentview (Ex: content_view_2)

[root@hp-dl380pgen8-02-vm-4 ~]# yum install qpid-proton-c.x86_64 
Loaded plugins: product-id, search-disabled-repos, subscription-manager
2 local certificates have been deleted.
Default_Organization_Product-for-1439645_Satellite-6_2-GA                                                                                                                                   | 2.1 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package qpid-proton-c.x86_64 0:0.9-16.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                   Arch                               Version                                  Repository                                                                             Size
===================================================================================================================================================================================================================
Installing:
 qpid-proton-c                             x86_64                             0.9-16.el7                               Default_Organization_Product-for-1439645_Satellite-6_2-GA                             135 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total download size: 135 k
Installed size: 356 k
Is this ok [y/d/N]: y
Downloading packages:
qpid-proton-c-0.9-16.el7.x86_64.rpm                                                                                                                                                         | 135 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : qpid-proton-c-0.9-16.el7.x86_64                                                                                                                                                                 1/1 
  Verifying  : qpid-proton-c-0.9-16.el7.x86_64                                                                                                                                                                 1/1 

Installed:
  qpid-proton-c.x86_64 0:0.9-16.el7                                                                                                                                                                                

Complete!


Notice that the entitlement certs were updated during the yum transaction and content was installed from content_view_2( "Default_Organization_Product-for-1439645_Satellite-6_2-GA"), the system no-longer needs to be run the `subscription-manager refresh` command to reflect  the content_view changes on the client


Based on the above observations moving the bug to verified.

Comment 20 errata-xmlrpc 2018-10-30 10:36:03 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-2018:3153

Comment 21 Evgeni Golov 2021-02-22 09:41:13 UTC
dropping my needinfo, let's assume it's fixed


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