Bug 1023371 - oo-admin-check-source tool still prefer RHN when registering system using both rhn and rhsm methods
oo-admin-check-source tool still prefer RHN when registering system using bot...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod (Show other bugs)
2.0.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: John W. Lamb
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-25 05:52 EDT by Ma xiaoqiang
Modified: 2017-03-08 12 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-16 04:11:20 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ma xiaoqiang 2013-10-25 05:52:06 EDT
Description of problem:
When I register with both rhn and rhsm, the RHN will be preferred. then the tool check missing repo, it will ignore the registered RHSM channel, and give the wrong message.

Version-Release number of selected component (if applicable):
https://github.com/openshift/openshift-extras/tree/enterprise-2.0/admin/check-sources

How reproducible:
always

Steps to Reproduce:
1.use the following settings in /etc/rhsm/rhsm.conf:
    hostname=subscription.rhn.stage.redhat.com
    baseurl=https://cdn.rcm-qa.redhat.com 
2.register a subscription
# subscription-manager  subscribe --pool 8a99f98341c648100141d9bab4fc13b5   
3.register a rhn channel 
#rhnreg_ks --username=user --password=passwd --serverUrl=https://xmlrpc.rhn.errata.stage.redhat.com/XMLRPC
#rhn-channel -a -c rhel-x86_64-server-6-ose-1.2-infrastructure -u user -p passwd
4.check the resource
#./oo-admin-check-sources.py --role=node -r broker -o 1.2

Actual results:
Output
Add the missing repositories with the following commands:
# rhn-channel -a -c jb-ews-2-x86_64-server-6-rpm
# rhn-channel -a -c rhel-x86_64-server-6-ose-1.2-node
# yum repolist
rhel-6-server-cf-tools-1-rpms                                           Red Hat CloudForms Tools for RHEL 6 (RPMs)                                                                         31
rhel-6-server-ose-2.0-node-rpms                                         Red Hat OpenShift Enterprise 2.0 Application Node (RPMs)                                                            0
rhel-6-server-ose-2.0-rhc-rpms                                          Red Hat OpenShift Enterprise 2.0 Client Tools (RPMs)                                                                0
rhel-6-server-rhev-agent-rpms                                           Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)                                                  32
rhel-6-server-rpms                                                      Red Hat Enterprise Linux 6 Server (RPMs)                                                                       11,086
rhel-server-ose-1.2-node-6-rpms                                         Red Hat OpenShift Enterprise 1.2 Application Node (RPMs)                                                          403
rhel-server-ose-1.2-rhc-6-rpms                                          Red Hat OpenShift Enterprise 1.2 Client Tools (RPMs)                                                               17
rhel-server-ose-node-6-rpms                                             Red Hat OpenShift Enterprise Application Node (RPMs)                                                              435
rhel-server-ose-rhc-6-rpms                                              Red Hat OpenShift Enterprise Client Tools (RPMs)                                                                   18
rhel-server-rhscl-6-eus-rpms                                            Red Hat Software Collections RPMs for Red Hat Enterprise Linux 6 RHEL 6 Server EUS                                440
rhel-x86_64-server-6                                                    Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)                                                       11,652
rhel-x86_64-server-6-ose-1.2-infrastructure                             Red Hat OpenShift Enterprise 1.2 Infrastructure - x86_64                                                          314
rhel-x86_64-server-6-ose-2.0-infrastructure                             Red Hat OpenShift Enterprise 2.0 Infrastructure - x86_64                                                            
RHN is preferred; I have registered rhel-server-ose-node-6-rpms channel from rhsm, user can install node successfully!!

Expected results:
RHSM should be preferred.
The missing channel shoud not contain rhel-x86_64-server-6-ose-1.2-node.

Additional info:
Comment 2 John W. Lamb 2013-10-28 17:02:00 EDT
I can't reproduce this - registered to both RHSM and RHN, following the directions above, it looks like only RHSM channels are being selected by oo-admin-check-sources. I get this output:

[root@jolamb-ent-2 check-sources]# python ./oo-admin-check-sources.py -rbroker -rnode -o1.2
If this system will be providing the JBossEAP cartridge, re-run this command with the --role=node-eap argument
Checking if yum-plugin-priorities is installed
The required OpenShift Enterprise repositories are disabled:
    jb-ews-2-for-rhel-6-server-rpms
Enable these repositories with the following commands:
# subscription-manager repos --enable=jb-ews-2-for-rhel-6-server-rpms
Checking channel/repository priorities
Resolving repository/channel/subscription priority conflicts
To resolve conflicting repositories, update repo priority by running:
# yum-config-manager --setopt=rhel-server-ose-1.2-infra-6-rpms.priority=10 rhel-server-ose-1.2-infra-6-rpms --save
# yum-config-manager --setopt=rhel-server-ose-1.2-node-6-rpms.priority=10 rhel-server-ose-1.2-node-6-rpms --save
# yum-config-manager --setopt=rhel-6-server-rpms.priority=20 rhel-6-server-rpms --save
The calculated priorities for the following repoids are too large (>= 99)
    rhel-server-ose-1.2-infra-6-rpms
    rhel-server-ose-1.2-node-6-rpms
    rhel-6-server-rpms
Please re-run this script with the --fix argument to set an appropriate priority, or update the system priorities by hand
Please re-run this tool after making any recommended repairs to this system
[root@jolamb-ent-2 check-sources]# yum repolist
Loaded plugins: priorities, product-id, rhnplugin, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
This system is receiving updates from RHN Classic or RHN Satellite.
rhel-6-server-cf-tools-1-rpms                                                                                                                                                                                                                                  | 2.8 kB     00:00     
rhel-6-server-ose-2.0-infra-rpms                                                                                                                                                                                                                               | 2.8 kB     00:00     
rhel-6-server-ose-2.0-jbosseap-rpms                                                                                                                                                                                                                            | 2.8 kB     00:00     
rhel-6-server-ose-2.0-node-rpms                                                                                                                                                                                                                                | 2.8 kB     00:00     
rhel-6-server-ose-2.0-rhc-rpms                                                                                                                                                                                                                                 | 2.8 kB     00:00     
rhel-6-server-rhev-agent-rpms                                                                                                                                                                                                                                  | 3.1 kB     00:00     
rhel-6-server-rpms                                                                                                                                                                                                                                             | 3.7 kB     00:00     
rhel-server-ose-1.2-infra-6-rpms                                                                                                                                                                                                                               | 2.8 kB     00:00     
rhel-server-ose-1.2-jbosseap-6-rpms                                                                                                                                                                                                                            | 2.8 kB     00:00     
rhel-server-ose-1.2-node-6-rpms                                                                                                                                                                                                                                | 2.8 kB     00:00     
rhel-server-ose-1.2-rhc-6-rpms                                                                                                                                                                                                                                 | 2.9 kB     00:00     
rhel-server-ose-infra-6-rpms                                                                                                                                                                                                                                   | 2.8 kB     00:00     
rhel-server-ose-jbosseap-6-rpms                                                                                                                                                                                                                                | 2.8 kB     00:00     
rhel-server-ose-node-6-rpms                                                                                                                                                                                                                                    | 2.8 kB     00:00     
rhel-server-ose-rhc-6-rpms                                                                                                                                                                                                                                     | 2.8 kB     00:00     
rhel-server-rhscl-6-eus-rpms                                                                                                                                                                                                                                   | 2.9 kB     00:00     
repo id                                                                                                             repo name                                                                                                                                                   status
rhel-6-server-cf-tools-1-rpms                                                                                       Red Hat CloudForms Tools for RHEL 6 (RPMs)                                                                                                                      31
rhel-6-server-ose-2.0-infra-rpms                                                                                    Red Hat OpenShift Enterprise 2.0 Infrastructure (RPMs)                                                                                                           0
rhel-6-server-ose-2.0-jbosseap-rpms                                                                                 Red Hat OpenShift Enterprise 2.0 JBoss EAP add-on (RPMs)                                                                                                         0
rhel-6-server-ose-2.0-node-rpms                                                                                     Red Hat OpenShift Enterprise 2.0 Application Node (RPMs)                                                                                                         0
rhel-6-server-ose-2.0-rhc-rpms                                                                                      Red Hat OpenShift Enterprise 2.0 Client Tools (RPMs)                                                                                                             0
rhel-6-server-rhev-agent-rpms                                                                                       Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)                                                                                               32
rhel-6-server-rpms                                                                                                  Red Hat Enterprise Linux 6 Server (RPMs)                                                                                                                    11,086
rhel-server-ose-1.2-infra-6-rpms                                                                                    Red Hat OpenShift Enterprise 1.2 Infrastructure (RPMs)                                                                                                         311
rhel-server-ose-1.2-jbosseap-6-rpms                                                                                 Red Hat OpenShift Enterprise 1.2 JBoss EAP add-on (RPMs)                                                                                                         4
rhel-server-ose-1.2-node-6-rpms                                                                                     Red Hat OpenShift Enterprise 1.2 Application Node (RPMs)                                                                                                       403
rhel-server-ose-1.2-rhc-6-rpms                                                                                      Red Hat OpenShift Enterprise 1.2 Client Tools (RPMs)                                                                                                            17
rhel-server-ose-infra-6-rpms                                                                                        Red Hat OpenShift Enterprise Infrastructure (RPMs)                                                                                                             451
rhel-server-ose-jbosseap-6-rpms                                                                                     Red Hat OpenShift Enterprise JBoss EAP add-on (RPMs)                                                                                                             3
rhel-server-ose-node-6-rpms                                                                                         Red Hat OpenShift Enterprise Application Node (RPMs)                                                                                                           435
rhel-server-ose-rhc-6-rpms                                                                                          Red Hat OpenShift Enterprise Client Tools (RPMs)                                                                                                                18
rhel-server-rhscl-6-eus-rpms                                                                                        Red Hat Software Collections RPMs for Red Hat Enterprise Linux 6 RHEL 6 Server EUS                                                                             440
rhel-x86_64-server-6                                                                                                Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)                                                                                                    11,819
rhel-x86_64-server-6-ose-1.2-infrastructure                                                                         Red Hat OpenShift Enterprise 1.2 Infrastructure - x86_64                                                                                                       314
repolist: 25,364
[root@jolamb-ent-2 check-sources]#
Comment 3 Ma xiaoqiang 2013-10-28 21:23:08 EDT
1.use the following settings in /etc/rhsm/rhsm.conf:
    hostname=subscription.rhn.stage.redhat.com
    baseurl=https://cdn.rcm-qa.redhat.com 
2.register a subscription
# subscription-manager  subscribe --pool 8a99f98341c648100141d9bab4fc13b5   
3.register a rhn channel 
#rhnreg_ks --username=user --password=passwd --serverUrl=https://xmlrpc.rhn.errata.stage.redhat.com/XMLRPC
#rhn-channel -a -c rhel-x86_64-server-6-ose-1.2-infrastructure -u user -p passwd
#rhn-channel -a -c rhel-x86_64-server-6-ose-2.0-infrastructure -u user -p passwd
4.check resource 
# python oo-admin-check-sources.py  -r broker  -r node -o 1.2 
Output
     
If this system will be providing the JBossEAP cartridge, re-run this command with the --role=node-eap argument
Checking if yum-plugin-priorities is installed
The required OpenShift Enterprise repositories are missing:
    jb-ews-2-x86_64-server-6-rpm
    rhel-x86_64-server-6-ose-1.2-node
Please verify that an OpenShift Enterprise subscription is attached to this system using either RHN Classic or Red Hat Subscription Manager by following the instructions here: https://access.redhat.com/site/articles/522923
Checking channel/repository priorities
Resolving repository/channel/subscription priority conflicts
To resolve conflicting repositories, update /etc/yum/pluginconf.d/rhnplugin.conf with the following changes:
    Set priority=10 in the [rhel-x86_64-server-6-ose-1.2-infrastructure] section
The calculated priorities for the following repoids are too large (>= 99)
    rhel-x86_64-server-6-ose-1.2-infrastructure
Please re-run this script with the --fix argument to set an appropriate priority, or update the system priorities by hand
Please re-run this tool after making any recommended repairs to this system

#yum repolist
rhel-6-server-rpms
rhel-6-server-cf-tools-1-rpms
rhel-6-server-ose-2.0-node-rpms
rhel-6-server-ose-2.0-rhc-rpms
rhel-6-server-rhev-agent-rpms
rhel-server-ose-1.2-node-6-rpms
rhel-server-ose-1.2-rhc-6-rpms
rhel-server-ose-node-6-rpms
rhel-server-ose-rhc-6-rpms
rhel-server-rhscl-6-eus-rpms
rhel-x86_64-server-6
rhel-x86_64-server-6-ose-1.2-infrastructure
rhel-x86_64-server-6-ose-2.0-infrastructure

Two problems:
1.RHN is preferred
2.rhel-server-ose-1.2-node-6-rpms is enabled. User can use this repo to install node, but the tool still prompt user to register the node repo with RHN.
Comment 4 John W. Lamb 2013-10-30 16:23:04 EDT
Addressed in https://github.com/openshift/openshift-extras/pull/126
Comment 5 Ma xiaoqiang 2013-10-30 22:57:12 EDT
check it on the new version
#yum repolist
jb-ews-2-for-rhel-6-server-rpms 
rhel-6-server-cf-tools-1-rpms   
rhel-6-server-ose-2.0-node-rpms
rhel-6-server-ose-2.0-rhc-rpms
rhel-6-server-rhev-agent-rpms 
rhel-6-server-rpms            
rhel-server-ose-node-6-rpms   
rhel-server-ose-rhc-6-rpms     
rhel-server-rhscl-6-eus-rpms   
rhel-x86_64-server-6           
rhel-x86_64-server-6-ose-2.0-infrastructure
# python oo-admin-check-sources.py -r broker -r node
If this system will be providing the JBossEAP cartridge, re-run this command with the --role=node-eap argument
Detected OpenShift Enterprise repository subscription managed by Red Hat Subscription Manager.
Detected installed OpenShift Enterprise version 2.0
The required OpenShift Enterprise repositories are missing:
    rhel-6-server-ose-2.0-infra-rpms

We can find that the "rhel-x86_64-server-6-ose-2.0-infrastructure" repo is enabled in the step 1.  The tool choose rhsm, but when check enabled repos ,it should check the enabled repos registered by both rhsm and rhn, not only rhsm. 

In the step 2, the tool shouldn't show  rhel-6-server-ose-2.0-infra-rpms is the missing repo.
Comment 6 John W. Lamb 2013-10-31 14:15:28 EDT
This behavior is correct - with the RHSM OpenShift subscription active, all OpenShift channels should be available through RHSM. In order to simplify the tool, I've taken advantage of this knowledge and modified it so only one subscription type (whichever is "preferred") will be considered by the tool.

This change was introduced with this commit: https://github.com/openshift/openshift-extras/commit/e8edfea8df2e7f9694ec349b79d633558b3ebedf
Comment 7 Ma xiaoqiang 2013-10-31 21:53:05 EDT
Got it, thanks

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