Bug 896302 - Replace hal-* commands in inventory gathering script
Summary: Replace hal-* commands in inventory gathering script
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: inventory
Version: 0.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 21.0
Assignee: Dan Callaghan
QA Contact: Dan Callaghan
URL:
Whiteboard: Inventory
Depends On:
Blocks: 727634
TreeView+ depends on / blocked
 
Reported: 2013-01-17 01:03 UTC by Amit Saha
Modified: 2018-02-06 00:41 UTC (History)
6 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 541294 0 high CLOSED Inventory script should use lshw instead of smolt for more accurate information 2021-02-22 00:41:40 UTC

Internal Links: 541294

Description Amit Saha 2013-01-17 01:03:36 UTC
Description of problem:

The current inventory script uses hal-find-by-property and hal-get-property to retrieve storage controller details. 

They should be replaced by something which doesn't need hald running.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 Amit Saha 2015-06-10 06:17:32 UTC
The hal commands are being used to set the DISK_CONTROLLER key/value, but I do not see that in our DB.

So..it seems like we can just remove those?

Comment 3 Amit Saha 2015-06-10 06:18:23 UTC
(In reply to Amit Saha from comment #2)
> The hal commands are being used to set the DISK_CONTROLLER key/value, but I
> do not see that in our DB.
> 
> So..it seems like we can just remove those?

Oh, but I see it in our production DB ..

Comment 4 Amit Saha 2015-06-10 06:21:58 UTC
(In reply to Amit Saha from comment #3)
> (In reply to Amit Saha from comment #2)
> > The hal commands are being used to set the DISK_CONTROLLER key/value, but I
> > do not see that in our DB.
> > 
> > So..it seems like we can just remove those?
> 
> Oh, but I see it in our production DB ..

Scratch that, i just learned that the admin can define key/value pairs.

Comment 8 Dan Callaghan 2015-07-16 04:24:22 UTC
Okay, looking more closely at the old piece of code in beaker-system-scan for populating DISK_CONTROLLER I see what is going on now...

The current algorithm for picking DISK_CONTROLLER is:

* For each block device in /sys/block:
  * If the block device is not named sr* (SCSI CD-ROM) or fd* (floppy disk)
    and if the block device has a "device" symlink to the underlying hardware
    and if it's not "virtual" (device-mapper etc):
    1. Find the device in HAL and get its driver
    2. If the driver is not "sd" or "sr":
      * Found DISK_CONTROLLER
    3. Find the device's parent in HAL and go back to 1

So clearly the intention here was to find the first real disk, and then work upwards to find the device it is connected to (typically a PCI SCSI card or RAID controller etc).

However the algorithm does not seem to account for "ide-disk" which is the driver for IDE disks, only "sd" which is SCSI disks. So in the IDE case, it won't actually go up one to the storage controller which would be "VIA_IDE" in the example in comment 7. But it clearly should be.

So we can grab the disk controller driver from lshw easily enough... the hardest part will probably be finding the correct (non-virtual, non-CDROM) disk.

Comment 9 Dan Callaghan 2015-07-16 04:59:05 UTC
http://gerrit.beaker-project.org/4299

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


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