Bug 621138

Summary: rhn-client-tools does not count CPUs on s390
Product: Red Hat Enterprise Linux 6 Reporter: Martin Poole <mpoole>
Component: rhn-client-toolsAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED ERRATA QA Contact: Martin Minar <mminar>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: jhutar, mkoci, mminar, mpoole, tao
Target Milestone: rc   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: rhn-client-tools-1.0.0-45.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 621135 Environment:
Last Closed: 2011-05-19 13:04:55 UTC Type: ---
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: 621135    
Bug Blocks:    

Description Martin Poole 2010-08-04 11:16:35 UTC
+++ This bug was initially created as a clone of Bug #621135 +++

Escalated to Bugzilla from IssueTracker

--- Additional comment from tao on 2010-08-04 07:11:56 EDT ---

Event posted on 2010-08-04 04:10 BST by tscott

Product & Version:
RHN Satellite 5.3

When Did Problem Start:
From the beginning of use

Description of Problem:
Satelite doesn't correctly report the number of vCPUs on guests in s390/s390x architecture

Related fix was done in spacewalk-reports and its changelog entry as below:

2010-05-03 22:00:00
Jan Pazdziora 0.7.0-4:
- 588277 - There is one rhnCpu record per each rhnServer, number of CPUs is in nrcpu.

However, as the customer pointed out in the ticket that

/usr/share/rhn/up2date_client/hardware.py

seems to give always 1 as CPU count for s390/s390x architecture.
(Please see the ticket entry)


Action Requested of L2:
Correct counting of vCPUs on s390/s390x guest systems.

Files:

KCS Solution Doc:
DOC-31128
This event sent from IssueTracker by mpoole  [Support Engineering Group]
 issue 1223303

--- Additional comment from tao on 2010-08-04 07:11:58 EDT ---

Event posted on 2010-08-04 04:28 BST by tscott

I've done some initial analysis, and it appears that there is no
s390-specific code in hardware.py. The /proc/cpuinfo on s390 presents
processors quite differently to i386 or x86_64.

It should be possible to add a check at around line 610 in
/usr/share/rhn/up2date_client/hardware.py, with something like the
following:

--- s390-hardware.py    2010-08-04 13:21:26.000000000 +1000
+++ /usr/share/rhn/up2date_client/hardware.py   2010-03-25
00:48:09.000000000 +1000
@@ -610,30 +610,7 @@
             hwdict['speed'] = int(round(float(mhz_speed)) - 1)
         except ValueError:
             hwdict['speed'] = -1
-        
-    elif uname in ['s390x', 's390']:
-        tmpdict = {}
-        count = 0
-        for cpu in string.split(cpulist, "\n"):
-            if cpu[:8] in ['processor']:
-                count = count + 1
-            if cpu[:5] in ['vendor']:
-                vals = string.split(cpu, ":")
-                vendor = string.strip(vals[0])
+         
         
     else:
         # XXX: expand me. Be nice to other

This is obviously incomplete, but shows the logic that needs to be
applied.

An example of s390's /proc/cpuinfo:
--------
[root@gss4 ~]# cat /proc/cpuinfo 
vendor_id       : IBM/S390
# processors    : 2
bogomips per cpu: 1661.33
features        : esan3 zarch stfle msa ldisp eimm dfp 
processor 0: version = FF,  identification = 04C5C2,  machine = 2097
processor 1: version = FF,  identification = 04C5C2,  machine = 2097
--------

Thanks,

Tristan Scott
GSS APAC

Status set to: Waiting on Tech
Summary edited.

This event sent from IssueTracker by mpoole  [Support Engineering Group]
 issue 1223303

Comment 1 Milan Zázrivec 2011-01-18 16:58:34 UTC
satellite.git CLIENT-RHEL-6: f032532cbc5eeba032b4b2823200e63a1c295eb5

Comment 3 Martin Minar 2011-02-23 13:58:08 UTC
When update is done on new packages, rhn_register (rhnreg_ks) stops working due to bug 646429.

]# rhn_register
Illegal instruction (core dumped)
]# python
Python 2.6.5 (r265:79063, Jul 14 2010, 14:13:28) 
[GCC 4.4.4 20100630 (Red Hat 4.4.4-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dmidecode
Illegal instruction (core dumped)
]# rpm -qa python-dmidecode
python-dmidecode-3.10.12-1.el6.s390x

Comment 4 Martin Minar 2011-02-24 12:48:57 UTC
There is also bug 680124 that effectively blocks correct number display.

Comment 5 Martin Minar 2011-03-04 15:12:59 UTC
Problem described in this bug (/proc/cpuinfo looks different on x86 and s390) is solved. Those two other bugs remain to be solved.

Verified in rhn-client-tools-1.0.0-51.el6.

Comment 6 errata-xmlrpc 2011-05-19 13:04:55 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0565.html