Bug 1439645
Summary: | [RFE] yum plugin should update environment from Satellite | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Evgeni Golov <egolov> |
Component: | subscription-manager | Assignee: | candlepin-bugs |
Status: | CLOSED ERRATA | QA Contact: | John Sefler <jsefler> |
Severity: | low | Docs Contact: | |
Priority: | medium | ||
Version: | 7.3 | CC: | baptiste.agasse, candlepin-bugs, cdonnell, csnyder, egolov, fcami, jsherril, khowell, peter.vreman, redakkan, rjerrido, skallesh |
Target Milestone: | rc | Keywords: | FutureFeature, PrioBumpPM |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-10-30 10:36:03 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1122832, 1533259, 1544891, 1546815 |
Description
Evgeni Golov
2017-04-06 11:09:28 UTC
Justin, what is the expected behavior from a Katello point of view? 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. 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. 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. 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. 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 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. 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 dropping my needinfo, let's assume it's fixed |