Bug 1087603

Summary: RFE - "rhn-migrate-classic-to-rhsm" migration script to accept the expected parameter either via standard input or the equivalent of an "answer" file"
Product: Red Hat Enterprise Linux 5 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Bryan Kearney <bkearney>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.11CC: awood, bgollahe, bkearney, gkhachik, jgalipea, jsefler, mhuth, mmccune, tkolhar
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 912375 Environment:
Last Closed: 2014-09-16 00:22:23 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: 912375    
Bug Blocks: 1039651    

Comment 1 Carter Kozak 2014-04-29 13:48:57 UTC
Fixed in subscription-manager-1.11.3-2.el5

Comment 3 John Sefler 2014-05-22 19:58:13 UTC
Verifying Version...
[root@jsefler-5 ~]# rpm -q subscription-manager-migration
subscription-manager-migration-1.11.3-3.el5


[root@jsefler-5 ~]# rhn-migrate-classic-to-rhsm --help
Usage: rhn-migrate-classic-to-rhsm [OPTIONS]

options:
  -h, --help            show this help message and exit
  -f, --force           ignore channels not available on RHSM
  -g, --gui             launch the GUI tool to attach subscriptions, instead
                        of auto-attaching
  -n, --no-auto         don't execute the auto-attach option while registering
                        with subscription manager
  -s SERVICELEVEL, --servicelevel=SERVICELEVEL
                        service level to follow when attaching subscriptions,
                        for no service level use --servicelevel=""
  --serverurl=SERVERURL
                        specify the subscription management server to migrate
                        to
  --redhat-user=REDHATUSER
                        specify the Red Hat user name
  --redhat-password=REDHATPASSWORD
                        specify the Red Hat password
  --subscription-service-user=SUBSERVICEUSER
                        specify the subscription service user name
  --subscription-service-password=SUBSERVICEPASSWORD
                        specify the subscription service password
  --no-proxy            don't use RHN proxy settings with subscription
                        management server
  --org=ORG             organization to register to
  --environment=ENVIRONMENT
                        environment to register to
[root@jsefler-5 ~]# 

^^^ VERIFIED: Notice the command line options to specify --redhat-user=REDHATUSER --redhat-password=REDHATPASSWORD --subscription-service-user=SUBSERVICEUSER --subscription-service-password=SUBSERVICEPASSWORD --org=ORG --environment=ENVIRONMENT which can all be used to satisfy the request in comment 0.





[root@jsefler-5 ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa --password=*** --force --norhnsd --nohardware --nopackages --novirtinfo
[root@jsefler-5 ~]# rhn-migrate-classic-to-rhsm --redhat-user=qa --redhat-password=*** --subscription-service-user=stage_test_12 --subscription-service-password=*** --org=7065298 --no-auto --serverurl=subscription.rhn.stage.redhat.com:443/subscription

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 /tmp/sm-productCertDir.

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: 5ac0d250-94de-4f86-be65-9254cd47d7ca 
System 'jsefler-5.usersys.redhat.com' successfully registered to Red Hat Subscription Management.

[root@jsefler-5 ~]# 



^^^ VERIFIED: the migration script can be run with options to avoid interactive prompting.  (Note: I did not specify --environment because the hosted stage subscription management server does not support environments, but a katello server does and should only be required when more than one environment is available to the Subscription Service credentials.

Comment 6 errata-xmlrpc 2014-09-16 00:22:23 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-2014-1225.html