Bug 840169 - rhn-migrate-classic-to-rhsm appears to autosubscribe before considering the requested --servicelevel option
rhn-migrate-classic-to-rhsm appears to autosubscribe before considering the r...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager (Show other bugs)
5.9
Unspecified Unspecified
unspecified Severity high
: rc
: ---
Assigned To: Alex Wood
Entitlement Bugs
:
: 834299 (view as bug list)
Depends On:
Blocks: 771748
  Show dependency treegraph
 
Reported: 2012-07-13 22:59 EDT by John Sefler
Modified: 2013-01-07 22:57 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Attempting to migrate a system from RHN to Red Hat Subscription Management using the rhn-migrate-classic-to-rhsm tool. Consequence: The system is registered but does not have its service level set correctly. Fix: The service level is now set before registration, Result: The service level is taken into account when a system registers.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-07 22:57:09 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 John Sefler 2012-07-13 22:59:42 EDT
Description of problem:
As demonstrated in the reproduction steps below, the autosubscribe step appears to happen before considration of the --servicelevel option.

Version-Release number of selected component (if applicable):
[root@ibm-x3620m3-01 ~]# rpm -q subscription-manager
subscription-manager-1.0.9-1.el5


How reproducible:


Steps to Reproduce:

[root@ibm-x3620m3-01 ~]# subscription-manager list --installed --consumed
No installed products to list
[root@ibm-x3620m3-01 ~]# rhn-migrate-classic-to-rhsm -f --servicelevel=PrEMiuM
RHN Username: qa@redhat.com
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to:
+----------------------------------+
rhel-x86_64-server-5
rhn-tools-rhel-x86_64-server-5
rhel-x86_64-server-rhsclient-5-debuginfo
rhel-x86_64-server-rhsclient-5

+--------------------------------------------------+ 
Unrecognized channels. Channel to product certificate mapping missing for these channels.
+--------------------------------------------------+
rhn-tools-rhel-x86_64-server-5
rhel-x86_64-server-rhsclient-5-debuginfo
rhel-x86_64-server-rhsclient-5

List of channels for which certs are being copied
rhel-x86_64-server-5

Product certificates copied successfully to /etc/pki/product

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

Attempting to register system to Certificate-based RHN ...
The system has been registered with id: fcaaf00c-b14c-47b2-9c57-1073e7a79a60 
System 'ibm-x3620m3-01.rhts.eng.bos.redhat.com' successfully registered to Certificate-based RHN.

Attempting to auto-subscribe to appropriate subscriptions ...
Installed Product Current Status:
Product Name:         	Red Hat Enterprise Linux Server
Status:               	Subscribed


Please visit https://access.redhat.com/management/consumers/fcaaf00c-b14c-47b2-9c57-1073e7a79a60 to view the details, and to make changes if necessary.

Service level "PrEMiuM" is not available.
Please select a service level agreement for this system.
1. Standard
2. Layered
3. Self-support
4. None
5. Premium
6. No service level preference
? 5

Subscribing to service level Premium
[root@ibm-x3620m3-01 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+

Subscription Name:    	CloudForms Beta
Provides:             	Red Hat CloudForms
                      	Red Hat Enterprise Linux Server
SKU:                  	MCT2538
Contract:             	3060009
Account:              	477931
Serial Number:        	3146900506500318348
Active:               	True
Quantity Used:        	1
Service Level:        	Standard
Service Type:         	L1-L3
Starts:               	05/23/2012
Ends:                 	07/21/2012

[root@ibm-x3620m3-01 ~]# 



NOTICE IN THE STEPS ABOVE, I REQUESTED A --servicelevel=PrEMiuM.  HOWEVER, THE MIGRATED PRODUCT CERT APPEARS TO BE AUTOSUBSCRIBED FOLLOWED BY "Service level "PrEMiuM" is not available.".  THEN I RESPOND TO THE INTERACTIVE PROMPT FOR "Premium", BUT IN THE END, I HAVE AUTO COSUMED A "Standard" SERVICE LEVEL.   THE ORDER OF EVENTS APPEARS OUT OF ORDER.
Comment 1 RHEL Product and Program Management 2012-07-13 23:07:19 EDT
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 John Sefler 2012-07-14 00:07:36 EDT
Since subscription-manager already permits the user to specify a case-insensitive servicelevel value, rhn-migrate-classic-to-rhsm should also be able to resolve the servicelevel option regardless of case.
Comment 3 Alex Wood 2012-07-18 11:00:35 EDT
commit 7b4ba0c80f9e87b89fc6520b187c734cbd80732a
Refs: <origin/awood/840169>, awood/840169, subscription-manager-1.0.9-1-24-g7b~
Author:     Alex Wood <awood@redhat.com>
AuthorDate: Tue Jul 17 14:14:16 2012 -0400
Commit:     Alex Wood <awood@redhat.com>
CommitDate: Tue Jul 17 14:15:53 2012 -0400

Available in subscription-manager-1.0.10+
Comment 4 John Sefler 2012-07-20 14:34:42 EDT
(In reply to comment #2)
> Since subscription-manager already permits the user to specify a
> case-insensitive servicelevel value, rhn-migrate-classic-to-rhsm should also
> be able to resolve the servicelevel option regardless of case.

Opened under seperate bug 841961 - rhsm-migrate-classic-to-rhsm --servicelevel should be case insensitive
Comment 6 Sharath Dwaral 2012-08-01 11:16:11 EDT
Verification blocked by  Bug 845043
Comment 7 John Sefler 2012-08-24 17:13:00 EDT
Verifying Version...

[root@jsefler-rhel59 ~]# rpm -q subscription-manager-migration
subscription-manager-migration-1.0.14-1.el5


[root@jsefler-rhel59 ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa@redhat.com --password=***** --profilename=rhsm-automation.jsefler-rhel59.usersys.redhat.com --force --norhnsd --nohardware --nopackages --novirtinfo
[root@jsefler-rhel59 ~]# rhn-migrate-classic-to-rhsm -f --servicelevel=PrEMiuM
Red Hat account: qa@redhat.com
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to:
+----------------------------------+
rhel-x86_64-server-5

List of channels for which certs are being copied
rhel-x86_64-server-5

Product certificates copied 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: e1ce1e87-139b-4825-a902-9a5d4da4c37f 
System 'jsefler-rhel59.usersys.redhat.com' successfully registered to Red Hat Subscription Management.


Service level "PrEMiuM" is not available.
Please select a service level agreement for this system.
1. SELF-SUPPORT
2. PREMIUM
3. STANDARD
4. NONE
5. No service level preference
? 2
Attempting to auto-subscribe to appropriate subscriptions ...
Service level set to: PREMIUM
Installed Product Current Status:
Product Name:         	Red Hat Enterprise Linux Server
Status:               	Not Subscribed


Unable to auto-subscribe.  Do your existing subscriptions match the products installed on this system?

Please visit https://access.redhat.com/management/consumers/e1ce1e87-139b-4825-a902-9a5d4da4c37f to view the details, and to make changes if necessary.
[root@jsefler-rhel59 ~]# 
[root@jsefler-rhel59 ~]# subscription-manager service-level --show
Current service level: PREMIUM


^^^^ VERIFIED: In the workflow above you can see that the requested servicelevel is now acknowledged and processed prior to the attempted autosubscribe.  The selected servicelevel is in fact saved as the new consumer's preference.
Comment 8 Alex Wood 2012-09-25 13:34:58 EDT
*** Bug 834299 has been marked as a duplicate of this bug. ***
Comment 10 errata-xmlrpc 2013-01-07 22:57:09 EST
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

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