lhsw is terrible for detecting disks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Blake Rouse |
Bug Description
Various bugs report that lshw isn't reporting disks, or disk sizes correctly. This is because lshw, while venerable, is somewhat out of date with modern hardware.
I suggest avoiding that totally, and replacing 100% of the disk detection code with this one liner:
parted -lms | awk 'found{ if(!/dev\
This will reliably and repeatably output a single line per available disk, with a valid size:
root@t0:~/maas# parted -lms | awk 'found{ if(!/dev\
/dev/cciss/
root@t0:~/maas#
root@bay6:/var/log# parted -lms | awk 'found{ if(!/dev\
/dev/cciss/
/dev/cciss/
root@bay6:/var/log#
root@gw:~# parted -lms | awk 'found{ if(!/dev\
/dev/sda:
root@gw:~#
It also explicitly excludes LVM (the /dev/mapper negation) volumes.
This provides output in an easy to parse format, and will never be out of date, unlike lshw.
Related branches
- Raphaël Badin (community): Approve
-
Diff: 532 lines (+467/-0)2 files modifiedsrc/metadataserver/models/commissioningscript.py (+121/-0)
src/metadataserver/models/tests/test_noderesults.py (+346/-0)
Changed in maas: | |
milestone: | none → next |
tags: | added: cloud-installer |
Changed in maas: | |
assignee: | nobody → Blake Rouse (blake-rouse) |
status: | Triaged → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Changed in maas: | |
milestone: | next → none |
I have to agree with you that lshw is not the best source. As I am currently trying to detect that disks are SSD, and lshw does not provide that information.
I am looking into replacing lshw with another method of detecting disks, for the new storage work for MAAS. I will take into account your suggestion here.
Thanks,
Blake