diff --git a/app/collins/util/parsers/LshwParser.scala b/app/collins/util/parsers/LshwParser.scala index dbe61db47..dc4f93a07 100644 --- a/app/collins/util/parsers/LshwParser.scala +++ b/app/collins/util/parsers/LshwParser.scala @@ -119,7 +119,7 @@ class LshwParser(txt: String) extends CommonParser[LshwRepresentation](txt) { case size => ByteStorageUnit(size.toLong) } Disk(size, _type, asset.description, asset.product, asset.vendor) - case n if (n \ "@class" text) == "memory" && LshwConfig.flashProducts.exists(s => (n \ "product" text).toLowerCase.contains(s)) => + case n if ((n \ "@class" text) == "memory" || (n \ "@class" text) == "storage") && LshwConfig.flashProducts.exists(s => (n \ "product" text).toLowerCase.contains(s)) => val asset = getAsset(n) val size = ByteStorageUnit(LshwConfig.flashSize) Disk(size, Disk.Type.Flash, asset.description, asset.product, asset.vendor) diff --git a/app/views/asset/show_overview.scala.html b/app/views/asset/show_overview.scala.html index f6fe5f809..c5715ddec 100644 --- a/app/views/asset/show_overview.scala.html +++ b/app/views/asset/show_overview.scala.html @@ -250,6 +250,13 @@

Hardware Summary Summary of system components reported by LSHWSCSI Storage @aa.lshw.totalStorage.toHuman + @if(aa.lshw.hasFlashStorage) { + + + Flash Storage + @(aa.lshw.totalFlashStorage.toHuman) + + } Total Storage diff --git a/conf/test_base.conf b/conf/test_base.conf index 2beec20c4..2f0a845b7 100644 --- a/conf/test_base.conf +++ b/conf/test_base.conf @@ -279,7 +279,7 @@ ipmi { } lshw { - flashProducts = ["fusionio", "tachION", "flashmax"] + flashProducts = ["fusionio", "tachION", "flashmax", "hgst, inc."] flashSize="1400000000000" # For assets whose NIC capacity cannot be determined diff --git a/test/collins/util/parsers/LshwParserSpec.scala b/test/collins/util/parsers/LshwParserSpec.scala index 9eb98d4af..55825f497 100644 --- a/test/collins/util/parsers/LshwParserSpec.scala +++ b/test/collins/util/parsers/LshwParserSpec.scala @@ -186,6 +186,35 @@ class LshwParserSpec extends mutable.Specification { } } + "with a nvme flash card" in new LshwParserHelper("lshw-nvme.xml") { + val parseResults = parsed() + parseResults must beRight + parseResults.right.toOption must beSome.which { rep => + rep.cpuCount mustEqual 2 + rep.cpuCoreCount mustEqual 12 + rep.hasHyperthreadingEnabled must beFalse + rep.cpuSpeed must beCloseTo(2.3, 0.1) + + rep.totalMemory.inGigabytes must beCloseTo(32L, 1) + rep.memoryBanksUsed mustEqual 4 + rep.memoryBanksUnused mustEqual 8 + rep.memoryBanksTotal mustEqual 12 + + rep.hasFlashStorage must beTrue + rep.totalFlashStorage.toHuman mustEqual "1.27 TB" + rep.totalUsableStorage.toHuman mustEqual "1.55 TB" + + rep.totalStorage.toHuman mustEqual "278.46 GB" + rep.diskCount mustEqual 4 + + rep.nicCount mustEqual 2 + rep.nicsBySpeedGb(1).size mustEqual 2 + rep.nicsBySpeedGb get 10 must beNone + rep.macAddresses must have length 2 + rep.macAddresses must beNonEmptyStringSeq + } + } + } // Parse dell (AMD) lshw output "Parse different versioned formats" in { diff --git a/test/resources/lshw-nvme.xml b/test/resources/lshw-nvme.xml new file mode 100644 index 000000000..e9adfbd42 --- /dev/null +++ b/test/resources/lshw-nvme.xml @@ -0,0 +1,1300 @@ + + + + + + + Rack Mount Chassis + PowerEdge C6105 (N/A) + Winbond Electronics + N/A + F7S1NM1 + 64 + + + + + + + + + SMBIOS version 2.6 + DMI version 2.6 + 64-bit processes + 32-bit processes + + + Motherboard + 03M4R4 + Winbond Electronics + 0 + X04 + .F7S1NM1.CN717030750202. + N/A + + BIOS + Winbond Electronics + 1 + 1.6.0 + 09/27/2010 + 65536 + 4128768 + + ISA bus + PCI bus + Plug-and-Play + BIOS EEPROM can be upgraded + BIOS shadowing + ESCD + Booting from CD-ROM/DVD + Selectable boot path + BIOS ROM is socketed + Enhanced Disk Drive extensions + Print Screen key + INT14 serial line control + INT17 printer control + INT10 CGA/Mono video + ACPI + USB legacy emulation + Booting from LS-120 + Booting from ATAPI ZIP + BIOS boot specification + + + + CPU + AMD Opteron(tm) Processor 4174 HE + Hynix Semiconductor (Hyundai Electronics) + 5 + cpu@0 + D1 + To Be Filled By O.E.M. + CPU 0 + 2300000000 + 2300000000 + 64 + 200000000 + + + + + + + 64bits extensions (x86-64) + mathematical co-processor + FPU exceptions reporting + + virtual mode extensions + debugging extensions + page size extensions + time stamp counter + model-specific registers + 4GB+ memory addressing (Physical Address Extension) + machine check exceptions + compare and exchange 8-byte + on-chip advanced programmable interrupt controller (APIC) + fast system calls + memory type range registers + page global enable + machine check architecture + conditional move instruction + page attribute table + 36-bit page size extensions + + multimedia extensions (MMX) + fast floating point save/restore + streaming SIMD extensions (SSE) + streaming SIMD extensions (SSE2) + HyperThreading + fast system calls + no-execute bit (NX) + multimedia extensions (MMXExt) + + + + multimedia extensions (3DNow!Ext) + multimedia extensions (3DNow!) + + + + + + + + + + + + + + + + + + + L1 cache + 6 + L1-Cache + 786432 + 786432 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + L2 cache + 7 + L2-Cache + 3145728 + 3145728 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + L3 cache + 8 + L3-Cache + 6291456 + 6291456 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + + CPU + AMD Opteron(tm) Processor 4174 HE + Hynix Semiconductor (Hyundai Electronics) + 9 + cpu@1 + D1 + To Be Filled By O.E.M. + CPU 1 + 2300000000 + 2300000000 + 64 + 200000000 + + + + + + + 64bits extensions (x86-64) + mathematical co-processor + FPU exceptions reporting + + virtual mode extensions + debugging extensions + page size extensions + time stamp counter + model-specific registers + 4GB+ memory addressing (Physical Address Extension) + machine check exceptions + compare and exchange 8-byte + on-chip advanced programmable interrupt controller (APIC) + fast system calls + memory type range registers + page global enable + machine check architecture + conditional move instruction + page attribute table + 36-bit page size extensions + + multimedia extensions (MMX) + fast floating point save/restore + streaming SIMD extensions (SSE) + streaming SIMD extensions (SSE2) + HyperThreading + fast system calls + no-execute bit (NX) + multimedia extensions (MMXExt) + + + + multimedia extensions (3DNow!Ext) + multimedia extensions (3DNow!) + + + + + + + + + + + + + + + + + + + L1 cache + a + L1-Cache + 786432 + 786432 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + L2 cache + b + L2-Cache + 3145728 + 3145728 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + L3 cache + c + L3-Cache + 6291456 + 6291456 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + + System Memory + 26 + System board or motherboard + 34359738368 + + DIMM DDR3 Synchronous [empty] + ModulePartNumber00 + Manufacturer00 + 0 + SerNum00 + CPU0 DIMM A0 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber01 + Manufacturer01 + 1 + SerNum01 + CPU0 DIMM A1 + + + DIMM DDR3 Synchronous 1333 MHz (0.8 ns) + M393B1K70CHD-CH9 + Samsung + 2 + 5D08DF86 + CPU0 DIMM A2 + 8589934592 + 64 + 1333000000 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber03 + Manufacturer03 + 3 + SerNum03 + CPU0 DIMM B0 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber04 + Manufacturer04 + 4 + SerNum04 + CPU0 DIMM B1 + + + DIMM DDR3 Synchronous 1333 MHz (0.8 ns) + M393B1K70CHD-CH9 + Samsung + 5 + 9B06DF86 + CPU0 DIMM B2 + 8589934592 + 64 + 1333000000 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber06 + Manufacturer06 + 6 + SerNum06 + CPU1 DIMM C0 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber07 + Manufacturer07 + 7 + SerNum07 + CPU1 DIMM C1 + + + DIMM DDR3 Synchronous 1333 MHz (0.8 ns) + M393B1K70CHD-CH9 + Samsung + 8 + B106DF86 + CPU1 DIMM C2 + 8589934592 + 64 + 1333000000 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber09 + Manufacturer09 + 9 + SerNum09 + CPU1 DIMM D0 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber10 + Manufacturer10 + a + SerNum10 + CPU1 DIMM D1 + + + DIMM DDR3 Synchronous 1333 MHz (0.8 ns) + M393B1K70CHD-CH9 + Samsung + b + 7708DF86 + CPU1 DIMM D2 + 8589934592 + 64 + 1333000000 + + + + Host bridge + RD890 Northbridge only dual slot (2x8) PCI-e GFX Hydra part + ATI Technologies Inc + 100 + pci@0000:00:00.0 + 02 + 32 + 33000000 + + PCI bridge + Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI Express Root Port 2 + Intel Corporation + 2 + pci@0000:00:02.0 + 01 + 32 + 33000000 + + + + + + Message Signalled Interrupts + PCI Express + Power Management + + bus mastering + PCI capabilities listing + + + + + + + Non-Volatile memory controller + HGST, Inc. + HGST, Inc. + 0 + pci@0000:02:00.0 + 02 + 64 + 33000000 + + + + + + + Power Management + PCI Express + Message Signalled Interrupts + MSI-X + Vital Product Data + + bus mastering + PCI capabilities listing + extension ROM + + + + + + + + + + + PCI bridge + RD890 PCI to PCI bridge (PCI express gpp port D) + ATI Technologies Inc + 4 + pci@0000:00:04.0 + 00 + 32 + 33000000 + + + + + + Power Management + PCI Express + Message Signalled Interrupts + HyperTransport + + bus mastering + PCI capabilities listing + + + + + + + + Ethernet interface + 82576 Gigabit Network Connection + Intel Corporation + 0 + pci@0000:03:00.0 + eth0 + 01 + c8:0a:a9:9e:d0:5c + 100000000 + 1000000000 + 32 + 33000000 + + + + + + + + + + + + + + + + Power Management + Message Signalled Interrupts + MSI-X + PCI Express + bus mastering + PCI capabilities listing + extension ROM + + Physical interface + twisted pair + 10Mbit/s + 10Mbit/s (full duplex) + 100Mbit/s + 100Mbit/s (full duplex) + 1Gbit/s (full duplex) + Auto-negotiation + + + + + + + + + + + + Ethernet interface + 82576 Gigabit Network Connection + Intel Corporation + 0.1 + pci@0000:03:00.1 + eth1 + 01 + c8:0a:a9:9e:d0:5d + 1000000000 + 32 + 33000000 + + + + + + + + + + + + + Power Management + Message Signalled Interrupts + MSI-X + PCI Express + bus mastering + PCI capabilities listing + extension ROM + + Physical interface + twisted pair + 10Mbit/s + 10Mbit/s (full duplex) + 100Mbit/s + 100Mbit/s (full duplex) + 1Gbit/s (full duplex) + Auto-negotiation + + + + + + + + + + + + + PCI bridge + RD890 PCI to PCI bridge (NB-SB link) + ATI Technologies Inc + b + pci@0000:00:0b.0 + 00 + 32 + 33000000 + + + + + + Power Management + PCI Express + Message Signalled Interrupts + HyperTransport + + bus mastering + PCI capabilities listing + + + + + + + + Serial Attached SCSI controller + SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] + LSI Logic / Symbios Logic + 0 + pci@0000:02:00.0 + scsi0 + 02 + 64 + 33000000 + + + + + + + Power Management + PCI Express + Vital Product Data + Message Signalled Interrupts + MSI-X + bus mastering + PCI capabilities listing + extension ROM + + + + + + + + + + SCSI Disk + Logical Volume + LSI + 1.0.0 + scsi@0:1.0.0 + /dev/sda + 8:0 + 3000 + 298999349248 + 298999349248 + + + + + + 15000 rotations per minute + Partitioned disk + MS-DOS partition table + + + EXT3 volume + Linux + 1 + scsi@0:1.0.0,1 + /dev/sda1 + /boot + 8:1 + 1.0 + bb2c469f-045e-4d00-ad8b-b7c9b90a3d31 + 106893312 + 106896384 + + + + + + + + + + + + Primary partition + Bootable partition (active) + + Extended Attributes + + EXT2/EXT3 + initialized volume + + + + Linux LVM Physical Volume partition + 2 + scsi@0:1.0.0,2 + /dev/sda2 + 8:2 + M1IAFe-7dJr-0Tsn-wFrS-fWJ8-Z27k-myf5iF + 298890224640 + 298890224640 + + Primary partition + Multi-volumes + + + + + + SCSI Disk + 0.0.0 + scsi@0:0.0.0 + + + SCSI Disk + 0.1.0 + scsi@0:0.1.0 + + + + + SATA controller + SB700/SB800 SATA Controller [IDE mode] + ATI Technologies Inc + 11 + pci@0000:00:11.0 + 00 + 32 + 66000000 + + + + + + + Power Management + + bus mastering + PCI capabilities listing + + + + + + + + + + + + + USB Controller + SB700/SB800 USB OHCI0 Controller + ATI Technologies Inc + 12 + pci@0000:00:12.0 + 00 + 32 + 66000000 + + + + + + Open Host Controller Interface + bus mastering + + + + + + + OHCI Host Controller + Linux 2.6.18-238.el5 ohci_hcd + 1 + usb@3 + usb3 + 2.06 + + + + + + + USB 1.1 + + + + + USB Controller + SB700 USB OHCI1 Controller + ATI Technologies Inc + 12.1 + pci@0000:00:12.1 + 00 + 32 + 66000000 + + + + + + Open Host Controller Interface + bus mastering + + + + + + + OHCI Host Controller + Linux 2.6.18-238.el5 ohci_hcd + 1 + usb@4 + usb4 + 2.06 + + + + + + + USB 1.1 + + + Mouse + Holtek Semiconductor, Inc. + 3 + usb@4:3 + 1.00 + + + + + + + USB 1.1 + + + + + + USB Controller + SB700/SB800 USB EHCI Controller + ATI Technologies Inc + 12.2 + pci@0000:00:12.2 + 00 + 32 + 66000000 + + + + + + Power Management + Debug port + Enhanced Host Controller Interface (USB2) + bus mastering + PCI capabilities listing + + + + + + + EHCI Host Controller + Linux 2.6.18-238.el5 ehci_hcd + 1 + usb@1 + usb1 + 2.06 + + + + + + + USB 2.0 + + + USB hub + Generic Hub + American Megatrends Inc. + 2 + usb@1:2 + 1.00 + serial + + + + + + + USB 2.0 + + + Keyboard + Virtual Keyboard and Mouse + American Megatrends Inc. + 1 + usb@1:2.1 + 1.00 + serial + + + + + + USB 2.0 + + + + + + + USB Controller + SB700/SB800 USB OHCI0 Controller + ATI Technologies Inc + 13 + pci@0000:00:13.0 + 00 + 32 + 66000000 + + + + + + Open Host Controller Interface + bus mastering + + + + + + + OHCI Host Controller + Linux 2.6.18-238.el5 ohci_hcd + 1 + usb@5 + usb5 + 2.06 + + + + + + + USB 1.1 + + + Keyboard + USB Keyboard + CHICONY + 1 + usb@5:1 + 3.00 + + + + + + + USB 1.1 + + + + + + USB Controller + SB700 USB OHCI1 Controller + ATI Technologies Inc + 13.1 + pci@0000:00:13.1 + 00 + 32 + 66000000 + + + + + + Open Host Controller Interface + bus mastering + + + + + + + OHCI Host Controller + Linux 2.6.18-238.el5 ohci_hcd + 1 + usb@6 + usb6 + 2.06 + + + + + + + USB 1.1 + + + + + USB Controller + SB700/SB800 USB EHCI Controller + ATI Technologies Inc + 13.2 + pci@0000:00:13.2 + 00 + 32 + 66000000 + + + + + + Power Management + Debug port + Enhanced Host Controller Interface (USB2) + bus mastering + PCI capabilities listing + + + + + + + EHCI Host Controller + Linux 2.6.18-238.el5 ehci_hcd + 1 + usb@2 + usb2 + 2.06 + + + + + + + USB 2.0 + + + + + SMBus + SBx00 SMBus Controller + ATI Technologies Inc + 14 + pci@0000:00:14.0 + 3d + 32 + 66000000 + + + + + + HyperTransport + PCI capabilities listing + + + + + + + IDE interface + SB700/SB800 IDE Controller + ATI Technologies Inc + 14.1 + pci@0000:00:14.1 + 00 + 32 + 66000000 + + + + + + + Message Signalled Interrupts + bus mastering + PCI capabilities listing + + + + + + + + ISA bridge + SB700/SB800 LPC host controller + ATI Technologies Inc + 14.3 + pci@0000:00:14.3 + 00 + 32 + 66000000 + + + + + + bus mastering + + + + PCI bridge + SBx00 PCI to PCI Bridge + ATI Technologies Inc + 14.4 + pci@0000:00:14.4 + 00 + 32 + 66000000 + + + + bus mastering + + + + + + + VGA compatible controller + ASPEED Graphics Family + ASPEED Technology, Inc. + b + pci@0000:01:0b.0 + 10 + 32 + 33000000 + + + + + Power Management + + PCI capabilities listing + + + + + + + + + + + Host bridge + Family 10h Processor HyperTransport Configuration + Hynix Semiconductor (Hyundai Electronics) + 101 + pci@0000:00:18.0 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor Address Map + Hynix Semiconductor (Hyundai Electronics) + 102 + pci@0000:00:18.1 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor DRAM Controller + Hynix Semiconductor (Hyundai Electronics) + 103 + pci@0000:00:18.2 + 00 + 32 + 33000000 + + + + + + + + + Host bridge + Family 10h Processor Miscellaneous Control + Hynix Semiconductor (Hyundai Electronics) + 104 + pci@0000:00:18.3 + 00 + 32 + 33000000 + + + + + + + + + Host bridge + Family 10h Processor Link Control + Hynix Semiconductor (Hyundai Electronics) + 105 + pci@0000:00:18.4 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor HyperTransport Configuration + Hynix Semiconductor (Hyundai Electronics) + 106 + pci@0000:00:19.0 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor Address Map + Hynix Semiconductor (Hyundai Electronics) + 107 + pci@0000:00:19.1 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor DRAM Controller + Hynix Semiconductor (Hyundai Electronics) + 108 + pci@0000:00:19.2 + 00 + 32 + 33000000 + + + + + + + + + Host bridge + Family 10h Processor Miscellaneous Control + Hynix Semiconductor (Hyundai Electronics) + 109 + pci@0000:00:19.3 + 00 + 32 + 33000000 + + + + + + + + + Host bridge + Family 10h Processor Link Control + Hynix Semiconductor (Hyundai Electronics) + 10a + pci@0000:00:19.4 + 00 + 32 + 33000000 + + +