Bug 863428

Summary: Migration failed with message Organization A has more than one environment.
Product: Red Hat Enterprise Linux 5 Reporter: spandey
Component: subscription-managerAssignee: Alex Wood <awood>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.9CC: awood, jmolet, jsefler, kbanerje, skallesh, spandey
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-08 04:04:01 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 spandey 2012-10-05 13:07:00 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:
4/4

Prerequisites:
Rhel5.9 with following subscription-manager rpm 
subscription-manager-migration-1.0.21-1.el5
subscription-manager-1.0.21-1.el5
subscription-manager-migration-data-1.11.2.6-1.el5
subscription-manager-gui-1.0.21-1.el5
subscription-manager-firstboot-1.0.21-1.el5

Steps to Repro : 
Register rhel5.9 server with rhn.
Migrate client from rhn to Katello which have more than one environment for Organization.

Expected Result : 


Actual Result : 

[root@dhcp193-98 ~]# rhn-migrate-classic-to-rhsm --serverurl dhcp201-196.englab.pnq.redhat.com/katello/api
Red Hat account: qa
Password: 
System Engine Username: admin
Password: 
Org: redhat

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

+-----------------------------------------------------+ 
Installing product certificates for these RHN Classic channels:
+-----------------------------------------------------+
rhel-x86_64-server-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 ...
Organization redhat has more than one environment. Please specify target environment for system registration.

Unable to register.
For further assistance, please contact Red Hat Global Support Services.
[root@dhcp193-98 ~]# 

Note : we dont have any option to specify target  environment for system

Comment 1 RHEL Program Management 2012-10-05 13:29:15 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 Alex Wood 2012-10-08 17:20:50 UTC
commit a00ef6b866493b95aa6033a5b96eee8911332ce8

Comment 4 John Sefler 2012-10-15 16:00:55 UTC
Verifying Version...
[root@jsefler-rhel59 ~]# rpm -q subscription-manager-migration
subscription-manager-migration-1.0.22-1.el5
# against a cfse server that I have pre-configured with multiple orgs and multiple environments.
CloudForms System Engine Version: 1.1.12-14.el6cf 



[root@jsefler-rhel59 ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa --password=*** --force --norhnsd --nohardware --nopackages --novirtinfo
[root@jsefler-rhel59 ~]# rhn-migrate-classic-to-rhsm --serverurl=se-rhelbox.usersys.redhat.com/cfse/api
Red Hat account: qa
Password: 
System Engine Username: admin
Password: 
Org: Test_Org
Environment: Test_Env

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

+-----------------------------------------------------+ 
Installing product certificates for these RHN Classic channels:
+-----------------------------------------------------+
rhel-x86_64-server-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: 54e73b43-310f-4ed0-8187-467e96ef92ae 
System 'jsefler-rhel59.usersys.redhat.com' successfully registered to Red Hat Subscription Management.

Attempting to auto-subscribe to appropriate subscriptions ...
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?
[root@jsefler-rhel59 ~]# 


VERIFIED: We successfully used rhn-migrate-classic-to-rhsm to migrate to a cfse server with credentials to an organization containing multiple environments. The rhn-migrate-classic-to-rhsm now prompts the user for an environment.

Moving to VERIFIED

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