Bug 1466453 - [RFE] rhn-migrate-classic-to-rhsm should ensure subscription-manager yum plugin is enabled
[RFE] rhn-migrate-classic-to-rhsm should ensure subscription-manager yum plug...
Status: VERIFIED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager (Show other bugs)
7.3
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Jiri Hnidek
John Sefler
: FutureFeature, Triaged
Depends On: 1516832
Blocks: 1420851 1469152
  Show dependency treegraph
 
Reported: 2017-06-29 12:15 EDT by Mason Loring Bliss
Modified: 2017-12-11 03:57 EST (History)
11 users (show)

See Also:
Fixed In Version: subscription-manager-1.20.2-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Github /candlepin/subscription-manager/pull/1702 None None None 2017-09-20 04:01 EDT

  None (edit)
Description Mason Loring Bliss 2017-06-29 12:15:23 EDT
Description of problem:


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

Presumably all versions.


How reproducible:


Steps to Reproduce:
1. Register a system with RHN.
2. Install subscription manager, disable /etc/yum/pluginconf.d/subscription-manager.conf
3. Run rhn-migrate-classic-to-rhsm

Actual results:

/etc/yum/pluginconf.d/subscription-manager.conf left disabled

Expected results:

/etc/yum/pluginconf.d/subscription-manager.conf enabled

Additional info:

Unclear how the setting was disabled, but SFDC case 01865488 saw my customer encounter this.
Comment 10 Rehana 2017-11-13 06:56:01 EST
Reproducing the failure on RHEL74:
====================================

version:
subscription management server: 2.0.43-1
subscription management rules: 5.26
subscription-manager: 1.19.21-1.el7
python-rhsm: 1.19.9-1.el7

1)REgister system with RHN 

#  rhnreg_ks --serverUrl=https://rhsm-sat5.usersys.redhat.com/XMLRPC --username=rhsm-client --password=**** --profilename=rhsmtest --force  --nohardware --nopackages --novirtinfo

2)Disabled the subscription-manager and product-id plugins 

#sed -i s/^enabled=1/enabled=0/ /etc/yum/pluginconf.d/subscription-manager.conf

#sed -i s/^enabled=1/enabled=0/ /etc/yum/pluginconf.d/product-id.conf

Verifying the same is set to "0"

#egrep ^enabled /etc/yum/pluginconf.d/product-id.conf
enabled=0
# egrep ^enabled /etc/yum/pluginconf.d/subscription-manager.conf
enabled=0

3) Now migrate the system to RHSM


[root@dhcp35-85 ~]#  rhn-migrate-classic-to-rhsm --legacy-user=rhsm-client --legacy-password=*** --destination-url=subscription.rhsm.stage.redhat.com:443/subscription --destination-user=qa@redhat.com --destination-password=***

Retrieving existing legacy subscription information...

+-----------------------------------------------------+
System is currently subscribed to these legacy channels:
+-----------------------------------------------------+
rhel-x86_64-server-7

+-----------------------------------------------------+
Installing product certificates for these legacy channels:
+-----------------------------------------------------+
rhel-x86_64-server-7

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

Preparing to unregister system from legacy server...
System successfully unregistered from legacy server.
Stopping and disabling legacy services...
rhnsd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rhnsd off

Attempting to register system to destination server...
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: 6f0add1f-9fa5-4de9-af68-d61204fad2e7 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

System 'dhcp35-85.lab.eng.blr.redhat.com' successfully registered.

Verify if the plugins are enabled.

# egrep ^enabled /etc/yum/pluginconf.d/subscription-manager.conf
enabled=0
# egrep ^enabled /etc/yum/pluginconf.d/product-id.conf
enabled=0
[root@dhcp35-85 pluginconf.d]# 

Observed that the "subscription-manager" and product-id plugins were not enabled
also see the yum repolist didn't load those plugins 

[root@dhcp35-85 ~]# yum repolist
Loaded plugins: langpacks, search-disabled-repos
repo id        repo name                    status
!rhel-7-server-rpms/7Server/x86_64                                                                 Red Hat Enterprise Linux 7 Server (RPMs)                                                                  17,474
repolist: 17,474
Comment 11 Rehana 2017-11-27 08:31:33 EST
Verification is blocked until bug 1516832 is fixed
Comment 12 Shwetha Kallesh 2017-12-11 03:57:22 EST
Moving bug to verified as yum plugin is enabled when migrated from rhn to rhsm

[root@dhcp35-7 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.0.43-1
subscription management rules: 5.26
subscription-manager: 1.20.7-1.el7


[root@dhcp35-7 ~]# rhnreg_ks --serverUrl=https://rhsm-sat5.usersys.redhat.com/XMLRPC --username=**** --password=**** --profilename=rhsmtest --force  --nohardware --nopackages --novirtinfo
[root@dhcp35-7 ~]# subscription-manager identity
server type: RHN Classic

WARNING

The yum plugins: /etc/yum/pluginconf.d/subscription-manager.conf, /etc/yum/pluginconf.d/product-id.conf were automatically enabled for the benefit of Red Hat Subscription Management. If not desired, use "subscription-manager config --rhsm.auto_enable_yum_plugins=0" to block this behavior.

[root@dhcp35-7 ~]# sed -i s/^enabled=1/enabled=0/ /etc/yum/pluginconf.d/subscription-manager.conf
[root@dhcp35-7 ~]# sed -i s/^enabled=1/enabled=0/ /etc/yum/pluginconf.d/product-id.conf
[root@dhcp35-7 ~]# 
[root@dhcp35-7 ~]# egrep ^enabled /etc/yum/pluginconf.d/product-id.conf
enabled=0
[root@dhcp35-7 ~]# egrep ^enabled /etc/yum/pluginconf.d/subscription-manager.conf
enabled=0


[root@dhcp35-7 ~]#  rhn-migrate-classic-to-rhsm --legacy-user=**** --legacy-password=**** --destination-url=subscription.rhsm.stage.redhat.com:443/subscription --destination-user=shwetha_tier1_test --destination-password=***

Retrieving existing legacy subscription information...

+-----------------------------------------------------+
System is currently subscribed to these legacy channels:
+-----------------------------------------------------+
rhel-x86_64-server-7

+-----------------------------------------------------+
Installing product certificates for these legacy channels:
+-----------------------------------------------------+
rhel-x86_64-server-7

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

Preparing to unregister system from legacy server...
System successfully unregistered from legacy server.
Stopping and disabling legacy services...
rhnsd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rhnsd off

Attempting to register system to destination server...
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: 1ca2a68e-0c84-4173-8c0f-4b1cfe31053d
The registered system name is: dhcp35-7.lab.eng.blr.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed


WARNING

The yum plugins: /etc/yum/pluginconf.d/subscription-manager.conf, /etc/yum/pluginconf.d/product-id.conf were automatically enabled for the benefit of Red Hat Subscription Management. If not desired, use "subscription-manager config --rhsm.auto_enable_yum_plugins=0" to block this behavior.

System 'dhcp35-7.lab.eng.blr.redhat.com' successfully registered.

[root@dhcp35-7 ~]# egrep ^enabled /etc/yum/pluginconf.d/product-id.conf
enabled=1

[root@dhcp35-7 ~]# egrep ^enabled /etc/yum/pluginconf.d/subscription-manager.conf
enabled=1

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