Bug 853233

Summary: rhn-migrate-classic-to-rhsm is installing both Desktop(68) and Workstation(71) when rhel-ARCH-client-vt-5 channel is consumed
Product: Red Hat Enterprise Linux 5 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Alex Wood <awood>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.9CC: dgregor, khong, spandey
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Improper logic in rhn-migrate-classic-to-rhsm. Consequence: Extraneous certificates were being installed. Fix: Correct logic to prevent Desktop and Workstation certificates from coexisting. Result: Systems will no longer have extraneous product certificates installed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-08 04:02:39 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: 771748    

Description John Sefler 2012-08-30 20:04:39 UTC
Description of problem:
Starting with a RHEL 5Client system consuming the classic rhel-<ARCH>-client-vt-5 channels, run the rhn-migrate-classic-to-rhsm tool and you get both the Desktop (68) and Workstation (71) product certs installed.

Based on what we learned in https://bugzilla.redhat.com/show_bug.cgi?id=786257#c1 products 68 and 71 should never be simultaneously installed.
Dennis, please confirm ^^ that statement and the validity of this bug.


Version-Release number of selected component (if applicable):
[root@jsefler-59client ~]# rpm -q subscription-manager-migration
subscription-manager-migration-1.0.15-1.git.12.5c3af23.el5


How reproducible:


Steps to Reproduce:
1. register an x86_64 5Client system to RHN classic and add these channels:
rhel-x86_64-client-vt-5-debuginfo
rhel-x86_64-client-vt-5-beta
rhel-x86_64-client-vt-5-beta-debuginfo
rhel-x86_64-client-vt-5

Then...

[root@jsefler-59client ~]# rhn-migrate-classic-to-rhsm --no-auto
Red Hat account: qa
Password: 
System Engine Username: testuser1
Password: 
Org: admin

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to these RHN Classic Channels:
+----------------------------------+
rhel-x86_64-client-5
rhel-x86_64-client-vt-5-debuginfo
rhel-x86_64-client-vt-5-beta
rhel-x86_64-client-vt-5-beta-debuginfo
rhel-x86_64-client-vt-5

+--------------------------------------------------+ 
Installing product certificates for these RHN Classic channels:
+--------------------------------------------------+
rhel-x86_64-client-5
rhel-x86_64-client-vt-5-debuginfo
rhel-x86_64-client-vt-5-beta
rhel-x86_64-client-vt-5-beta-debuginfo
rhel-x86_64-client-vt-5

Product certificates installed successfully to /etc/pki/product.

Preparing to unregister system from RHN Classic ...
System successfully unregistered from RHN Classic.

Attempting to register system to Red Hat Subscription Management ...
The system has been registered with id: 81e58974-767c-4e1a-855a-4cfb911f63e6 
System 'jsefler-59client.usersys.redhat.com' successfully registered to Red Hat Subscription Management.

[root@jsefler-59client ~]# subscription-manager list --installed 
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:         	Red Hat Enterprise Linux Desktop
Product ID:           	68
Version:              	5.9
Arch:                 	x86_64
Status:               	Not Subscribed
Starts:               	
Ends:                 	

Product Name:         	Red Hat Enterprise Linux Workstation
Product ID:           	71
Version:              	5.9
Arch:                 	x86_64
Status:               	Not Subscribed
Starts:               	
Ends:           


^^^^ ONLY EXPECTED Workstation 71 TO BE INSTLLED

Comment 1 RHEL Program Management 2012-08-30 20:07:09 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 2 Dennis Gregorovic 2012-08-30 20:21:04 UTC
Good catch.  In general, we should add the logic "if 71.pem and 68.pem are installed, remove 68.pem"

Comment 3 Alex Wood 2012-09-11 19:54:50 UTC
commit 4a3ceabfd1c3da24d0992283bf21c2cb3b60a07c
Author: Alex Wood <awood>
Date:   Thu Sep 6 13:51:57 2012 -0400

    853233: Do not allow 68.pem and 71.pem to coexist after migration.
    
    If a system is subscribed to channels that map to both 68.pem
    and 71.pem, remove 68.pem.

Available in subscription-manager-1.0.18+

Comment 5 John Sefler 2012-09-14 19:04:02 UTC
Verifying Version...
[root@dell-p690-01 ~]# rpm -q subscription-manager-migration-data subscription-manager-migration
subscription-manager-migration-data-1.11.2.4-1.el5
subscription-manager-migration-1.0.18-1.el5

[root@dell-p690-01 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Client release 5.9 Beta (Tikanga)
[root@dell-p690-01 ~]# uname -m
x86_64


[root@dell-p690-01 ~]# subscription-manager config --server.hostname=subscription.rhn.stage.redhat.com --server.port=443 --server.prefix=/subscription

[root@dell-p690-01 ~]# subscription-manager  list --installed
No installed products to list

[root@dell-p690-01 ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa --password=**** --force --norhnsd --nohardware --nopackages --novirtinfo

[root@dell-p690-01 ~]# rhn-channel --user=qa --add --channel=rhel-x86_64-client-vt-5-debuginfo --channel=rhel-x86_64-client-vt-5-beta --channel=rhel-x86_64-client-vt-5-beta-debuginfo --channel=rhel-x86_64-client-vt-5
Password: 

[root@dell-p690-01 ~]# rhn-migrate-classic-to-rhsm --no-auto
Red Hat account: qa
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to these RHN Classic Channels:
+----------------------------------+
rhel-x86_64-client-5
rhel-x86_64-client-vt-5-debuginfo
rhel-x86_64-client-vt-5-beta
rhel-x86_64-client-vt-5-beta-debuginfo
rhel-x86_64-client-vt-5

+--------------------------------------------------+ 
Installing product certificates for these RHN Classic channels:
+--------------------------------------------------+
rhel-x86_64-client-5
rhel-x86_64-client-vt-5-debuginfo
rhel-x86_64-client-vt-5-beta
rhel-x86_64-client-vt-5-beta-debuginfo
rhel-x86_64-client-vt-5

Product certificates installed successfully to /etc/pki/product.

Preparing to unregister system from RHN Classic ...
System successfully unregistered from RHN Classic.

Attempting to register system to Red Hat Subscription Management ...
The system has been registered with id: f86f8db2-8d48-4f2d-9f66-646db19b9061 
System 'dell-p690-01.rhts.eng.bos.redhat.com' successfully registered to Red Hat Subscription Management.

[root@dell-p690-01 ~]# subscription-manager  list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:         	Red Hat Enterprise Linux Workstation
Product ID:           	71
Version:              	5.9
Arch:                 	x86_64
Status:               	Not Subscribed
Starts:               	
Ends:                 	

[root@dell-p690-01 ~]# 


^^^ VERIFIED: Only rhel product cert 71 is installed when consuming rhel-x86_64-client-vt-5 channels.  Product cert 68 from channel rhel-x86_64-client-5 is not.

Comment 7 errata-xmlrpc 2013-01-08 04:02:39 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.

http://rhn.redhat.com/errata/RHBA-2013-0033.html