Bug 1116349

Summary: call rhsm-debug with --no-subscriptions by default
Product: Red Hat Enterprise Linux 7 Reporter: Bryn M. Reeves <bmr>
Component: sosAssignee: Bryn M. Reeves <bmr>
Status: CLOSED ERRATA QA Contact: David Kutálek <dkutalek>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: agk, alikins, bkearney, isenfeld, jsefler, pep, wpoteat
Target Milestone: rcKeywords: EasyFix
Target Release: 7.1   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sos-3.2-4.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1114117 Environment:
Last Closed: 2015-03-05 11:23:25 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: 1114117    
Bug Blocks: 1005618    

Description Bryn M. Reeves 2014-07-04 09:40:04 UTC
+++ This bug was initially created as a clone of Bug #1114117 +++

Description of problem:
Running rhsm-debug on a simple rhel7 VM installation takes around 90s:

# time rhsm-debug system --sos --no-archive --destination /var/tmp/out/
Wrote: /var/tmp/out//rhsm-debug-system-20140627-165705

real    1m26.624s
user    0m6.045s
sys     0m0.384s

This is run by default by sos and on a typical install now accounts for around 1/3rd of the total runtime:

# time sosreport -vv --batch
[...]
real    2m41.154s
user    0m57.406s
sys     0m11.706s

We really need to get this down or we'll have to make collection of the rhsm-debug data optional.

--- Additional comment from Adrian Likins on 2014-07-01 14:16:26 EDT ---


I would say to remove getSubscriptionList call from rhsm_debug. Looks like it can be huge, or almost empty depending on server permission set up. The data is potentially useful for debugging subscription issues, but not 90s worth. It's
also not used by subscription-manager directly.

Tempting to say to remove all the calls that hit the network, since theoretically that data should be available to the folks doing the troubleshooting. I don't think that is actually always the case, and it loses some of the snapshot-in-time value, but it would be quicker and simpler.

--- Additional comment from Bryan Kearney on 2014-07-02 09:00:51 EDT ---

will, go back on what said. Go ahead with removing it.

--- Additional comment from William Poteat on 2014-07-03 16:08:29 EDT ---

Added --no-subscriptions option to the rhsm-debug command

commit 68a1a418c27172c4fb851d536813f8060f4d3d1f

Comment 1 Bryan Kearney 2014-07-30 19:23:23 UTC
Acking 7.1

Comment 2 Bryn M. Reeves 2014-07-31 08:55:00 UTC
This bug should be against sos - it's to make use of the option added to rhsm-debug in bug 1114117 the default.

Comment 5 John Sefler 2014-11-21 21:16:45 UTC
Testing sos version...
[root@jsefler-os7 ~]# rpm -q sos
sos-3.2-7.el7.noarch

[root@jsefler-os7 ~]# rpm -ql sos-3.2-7.el7.noarch | grep yum.py
/usr/lib/python2.7/site-packages/sos/plugins/yum.py
/usr/lib/python2.7/site-packages/sos/plugins/yum.pyc
/usr/lib/python2.7/site-packages/sos/plugins/yum.pyo
[root@jsefler-os7 ~]# grep -A2 rhsm-debug /usr/lib/python2.7/site-packages/sos/plugins/yum.py
        self.add_cmd_output("rhsm-debug system --sos --no-archive "
                            "--no-subscriptions --destination %s"
                            % self.get_cmd_output_path())
[root@jsefler-os7 ~]# 

VERIFIED: sos appears to be calling rhsm-debug system with the new --no-subscriptions which will be much faster....



[root@jsefler-os7 ~]# subscription-manager register --serverur=https://subscription.rhn.stage.redhat.com:443/subscription
Username: qa
Password: 
The system has been registered with ID: fe276cb2-76a2-4285-98ce-c8bad57fd1b0 

[root@jsefler-os7 ~]# time rhsm-debug system --sos --no-archive --destination /tmp/test
Wrote: /tmp/test/rhsm-debug-system-20141121-269017

real	0m13.244s
user	0m1.363s
sys	0m0.162s

[root@jsefler-os7 ~]# time rhsm-debug system --sos --no-archive --no-subscriptions --destination /tmp/test
Wrote: /tmp/test/rhsm-debug-system-20141121-884360

real	0m3.360s
user	0m0.732s
sys	0m0.138s
[root@jsefler-os7 ~]# 

VERIFIED: A call to rhsm-debug system with the new --no-subscription option against a system registered to the stage environment took 3 seconds versus 13 seconds without the --no-subscription option.

Comment 8 errata-xmlrpc 2015-03-05 11:23:25 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.

https://rhn.redhat.com/errata/RHBA-2015-0532.html