Bug 541294 - Inventory script should use lshw instead of smolt for more accurate information
Summary: Inventory script should use lshw instead of smolt for more accurate information
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: inventory
Version: 0.5
Hardware: All
OS: Linux
high
medium
Target Milestone: 21.0
Assignee: Dan Callaghan
QA Contact: Dan Callaghan
URL:
Whiteboard: Inventory
: 593747 647470 747495 (view as bug list)
Depends On: 1212281 1212284 1212285 1212287 1212288 1212289 1212291 1212294 1212295 1212307 1212310 1212311 1213679 1213680 1213683 1213685 1213688
Blocks: 727634 1128002 1128004 1211089
TreeView+ depends on / blocked
 
Reported: 2009-11-25 13:22 UTC by Matt Brodeur
Modified: 2018-02-06 00:41 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-08-26 06:17:10 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 541278 0 high CLOSED edit system details 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 647470 0 low CLOSED [Beaker][Inventory] Unable to get correct memory value on host 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 896302 0 unspecified CLOSED Replace hal-* commands in inventory gathering script 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 902567 0 unspecified CLOSED Inventory task: Use lshw instead of libparted for retrieving disk information 2021-02-22 00:41:40 UTC

Internal Links: 541278 647470 896302 902567

Description Raymond Mancy 2009-11-25 13:22:47 UTC
This ticket was merged from Trac, original URL is http://fedorahosted.org/beaker/ticket/41
 The scripts used to push Details and Key/Values into inventory get some info wrong.

MEMORY - often rounds up too far.  eg, a system with 12288MB will be reported as 16384MB
FORMFACTOR - almost never right.  This comes straight from DMI, so there's probably not much to do.
PROCESSORS - If the running kernel limits the number of CPUs, the artificially lowered number gets reported.

Comment 1 Kevin Baker 2010-01-05 05:46:47 UTC
Food for thought:

I think a clean way to do this might be to keep to separate versions of the data. 

 Smolt Version      - <date-0>
 Smolt version      - <date-1>
 User Edited Values - <date-2>

The final system view is simply the latest Smolt version with the User edited values overlaid. There could be more than one set of User edited values (by possibly different people)

Pros:
 - you have a history
 - you can clearly view what was smolted vs human edited

Cons:
 - complexity

Comment 2 John Villalovos 2010-02-11 19:00:11 UTC
I have a system with 24GB of physical memory and in Beaker it showed 65536 as the MEMORY value.

Comment 3 Matt Brodeur 2010-08-10 19:34:50 UTC
*** Bug 593747 has been marked as a duplicate of this bug. ***

Comment 4 Bill Peck 2011-09-13 14:14:36 UTC
Steve,

Can you look into the memory issues specifically.

Comment 5 Steven Lawrance 2011-09-14 07:48:15 UTC
The memory size comes from smolt: http://git.fedorahosted.org/git/?p=smolt.git;a=blob;f=client/smolt.py#l1347

It takes MemTotal from /proc/meminfo -- memory available to the kernel, i.e. minus reservations etc.

Perhaps we could look to using lshw instead.  It can produce output in XML and reports each physical memory module installed and its size.  It may do a better job of reporting the CPUs as well.

Comment 6 Steven Lawrance 2011-10-20 04:38:10 UTC
*** Bug 747495 has been marked as a duplicate of this bug. ***

Comment 7 Steven Lawrance 2011-10-20 04:39:33 UTC
As highlighted by bug 747495, we should also ensure virt guests with memory ballooning report a sensible value.

Comment 9 Nish Aravamudan 2012-05-11 00:31:18 UTC
I think using lshw makes a lot of sense here. smolt does not currently have a release that correctly supports ppc64 (the next branch does, but it's wrong). Additionally, smolt's current releases can't parse the 3.x version strings and thus think know memory is installed. I don't know why it's dependent on the version string at all, tbh.

Generally speaking, the inventory task does not work at all on ppc64 (tested on both FC17 and RH6.3) -- due to the issues mentioned above. So an alternative tool would be great.

Comment 10 Dan Callaghan 2012-08-30 02:16:55 UTC
The other big limitation of smolt (at least on RHEL <= 6) is that it talks to hald, which rules out running in a kickstart %post environment.

Changing this bug's description to be about switching to lshw. It should hopefully solve, or allow us to solve, the many other inventory-related bugs we have too.

Comment 11 James de Vries 2012-10-16 22:43:53 UTC
There are a huge number of "devices" that smolt tracks that lshw does not. They are all devices without device ID's and for the most part are either abstractions, ports with nothing connected, or platform devices. I am not certain how many problems their removal from the inventory tasks output will cause for people, and apologise for any inconvenience, but as far as i'm concerned lshw will still be a huge upgrade.

Comment 12 Dan Callaghan 2012-12-05 22:06:06 UTC
Acking this as it is definitely able to be done. James has done most of the work already, the only remaining problem is tracking down discrepancies between the output of the existing hal-based scripts and the new lshw-based one, and figuring out whether these discrepancies are acceptable or need to be fixed somehow.

Comment 14 Amit Saha 2014-06-12 03:20:16 UTC
This patch is now here: http://gerrit.beaker-project.org/#/c/3139/

Comment 15 Nick Coghlan 2014-08-08 05:35:59 UTC
More detail on this migration at https://beaker-project.org/dev/proposals/inventory-lshw-migration.html

I'm also going to split out separate issues (blocked on this one) for aarch64 and ppc64le inventory scanning support.

Comment 16 Nick Coghlan 2014-08-08 06:04:49 UTC
Separate issues for the new architectures have been created as bug 1128002 (aarch64) and bug 1128004 (ppc64le).

ia64 support was dropped in RHEL6, while x86, ppc, s390 support were all dropped in RHEl7, so I suggest we drop those architectures from the scope of this issue and continue to use smolt on those systems.

That leaves this issue covering migration from smolt to lshw for x86_64, ppc64 and s390x

Comment 17 Dan Callaghan 2014-08-08 06:19:08 UTC
(In reply to Nick Coghlan from comment #16)

I think using smolt sometimes and lshw other times (effectively two separate branches of beaker-system-scan) is a bad idea. It means that the smolt branch would continue reporting all the bad/wrong/missing data that it does now, but the lshw one would be fixed. So for example, i386 would give different results than x86_64 on the same system.

Also, the ia64 machines and the i386-only ones (we have some) will continue to be supported until RHEL5 ELS ends in 2020, so I don't think we can just forget about fixing all the inventory bugs for those systems.

Comment 18 Nick Coghlan 2014-08-08 07:16:36 UTC
That makes sense, but that's a big test matrix. I'd like to find a way to break this issue down into smaller pieces that can be delivered incrementally.

So how does this sound:

1. All 7 architectures will be updated to use lshw at the same time (for the reasons you gave)
2. x86_64, ppc64 & s390x will be treated as "tier 1" architectures: any regressions noted with them will be considered as failing QA, and we don't ship the updated beaker-system-scan until they're fixed
3. ia64, i386, ppc, and s390 will be treated as "tier 2" architectures: any minor regressions specific to them will be filed as new bugs, and won't block the release of the new beaker-system-scan version

Comment 19 Amit Saha 2014-08-08 07:28:43 UTC
(In reply to Nick Coghlan from comment #18)
> That makes sense, but that's a big test matrix. I'd like to find a way to
> break this issue down into smaller pieces that can be delivered
> incrementally.
> 
> So how does this sound:
> 
> 1. All 7 architectures will be updated to use lshw at the same time (for the
> reasons you gave)
> 2. x86_64, ppc64 & s390x will be treated as "tier 1" architectures: any
> regressions noted with them will be considered as failing QA, and we don't
> ship the updated beaker-system-scan until they're fixed
> 3. ia64, i386, ppc, and s390 will be treated as "tier 2" architectures: any
> minor regressions specific to them will be filed as new bugs, and won't
> block the release of the new beaker-system-scan version

Sounds good to me.

Comment 20 Evan McNabb 2014-11-20 19:46:44 UTC
A heads up that lshw is being added in RHEL7.1: BZ 1101590

Comment 21 Amit Saha 2014-11-20 20:18:20 UTC
(In reply to Evan McNabb from comment #20)
> A heads up that lshw is being added in RHEL7.1: BZ 1101590

Please note that the current released version of lshw has very limited support for aarch64 (among others), we have contributed patches to enhance lshw's functionality on non-x86 archs and they have been accepted upstream - however there is no new release with those fixes yet.

Comment 22 Evan McNabb 2014-11-20 20:29:55 UTC
Thanks for the upstream fixes. If a release is made, we can help push to get it included in RHEL.

Comment 23 Dan Callaghan 2015-07-22 00:37:21 UTC
Taking this bug in order to finish it off, although Amit has done quite a substantial portion of the work.

Comment 24 Dan Callaghan 2015-07-22 00:41:45 UTC
We had to fix quite a few bugs/RFEs in lshw in order to bring it up to the same level as smolt in some cases. All our lshw are posted upstream. For anyone interested, the lshw patches we are still carrying that are not yet merged upstream can be seen here:

https://github.com/beaker-project/lshw/compare/lyonel:master...master

Comment 25 Dan Callaghan 2015-07-28 02:05:42 UTC
As part of the development work for porting beaker-system-scan to use lshw, Amit wrote a Beaker task /distribution/inventory-compare which runs both versions of beaker-system-scan on a system and highlights differences in the output.

The source for the task is here:

https://git.beaker-project.org/cgit/beaker-meta-tasks/tree/inventory-compare

We are running that task on as many different representative pieces of hardware as we can, to make sure there are no unacceptable regressions in the new version of beaker-system-scan.

Comment 28 Dan Callaghan 2015-08-03 07:23:48 UTC
Marking this as VERIFIED based on the comparison tests analyzed in comment 26.

All of the differences noted there are either:
(a) improvements
(b) insignificant, because nobody could reasonably be relying on the old values (for example "OTHER" for type)
or (c) minor regressions which are filed as separate bugs.

Even though it is still not perfect, we are close enough that this can be released now (instead of letting it drag on for any longer than the 3 years it already has!)

Comment 29 Dan Callaghan 2015-08-26 06:17:10 UTC
Beaker 21.0 has been released.

Comment 30 Dan Callaghan 2015-08-26 06:32:36 UTC
*** Bug 647470 has been marked as a duplicate of this bug. ***


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