Skip to content

Inventory

The DRP inventory system collects structured hardware and OS metadata from machines during the discovery and provisioning pipeline. Inventory data is stored as machine parameters and is used to drive workflow decisions, hardware classification, compliance checking, and cost tracking. The inventory system is implemented by two stages in the task-library content pack:

  • inventory-minimal runs early in discovery. It recognizes the chassis and its hardware components, applies the matching Profiles, and records the network interfaces. See Early Inventory.
  • inventory runs later in the workflow. It collects flat inventory fields, evaluates compliance checks, and calculates cost.

Early Inventory

The inventory-minimal stage is a flexiflow stage. It runs the tasks listed in the inventory-minimal-tasks parameter, which defaults to:

Task Writes Purpose
inventory-dmi inventory/dmi-data, machine/type, skip-hardware, hpe-system-gen Recognizes the chassis from DMI and applies hw-dmi-* Profiles
inventory-components inventory/components-data Recognizes PCI components and applies hw-comp-* Profiles
cloud-inventory cloud/* Collects cloud metadata when cloud/provider is set
inventory-network inventory/net-interface-data Records physical interfaces and marks the boot interface

Each task is also available as a standalone stage with the same name.

Chassis Recognition (inventory-dmi)

inventory-dmi matches the machine's DMI manufacturer, product, chassis type, hypervisor, and serial number against the rules in inventory/dmi. For each matching rule it adds that rule's Profile to the machine, hw-dmi-<key> by default. A Profile from a rule that no longer matches is removed, so a machine with a replaced board or chassis loses its old identity. Profiles are only applied to physical machines. Virtual machines record their matches without receiving Profiles, and containers are not evaluated.

Vendor content packs ship the tooling Profiles. For example, dell-support provides hw-dmi-dell, which installs DSU and OMSA in the hardware-tools-install stage.

Bash
drpcli machines get <machine-uuid> param inventory/dmi-data | jq '.Matched'
JSON
{
  "dell": {
    "Profile": "hw-dmi-dell",
    "Applied": true,
    "Content": "dell-support",
    "Description": "Dell system"
  }
}

Component Recognition (inventory-components)

inventory-components matches PCI devices against the rules in inventory/components. Rules can test the vendor, device, subsystem, PCI class, and kernel driver. Shipped rules cover GPUs, NICs, RAID controllers, NVMe, and Fibre Channel HBAs. Each matching rule adds hw-comp-<key> when that Profile exists, and its entry in inventory/components-data lists the matched devices:

Bash
drpcli machines get <machine-uuid> param inventory/components-data | jq 'map_values({Count, Profile, Applied})'

As with chassis rules, a Profile from a rule that no longer matches is removed. Virtual machines are evaluated, so passthrough devices receive their Profiles.

Site Rules

Rather than override the shipped rule maps, add rules to inventory/dmi-site or inventory/components-site. Site rules are merged over the shipped rules by key, and a null value disables the shipped rule with that key:

YAML
# Profile applied to the machines in a group
inventory/components-site:
  acme-fpga:
    Vendor: "xilinx"
    Profile: "acme-fpga-node"
  intel-nic: null

See Hardware Inventory for the rule fields and for writing the Profiles that rules apply.

Network Interfaces (inventory-network)

inventory-network writes the physical and loopback interfaces reported by Gohai to inventory/net-interface-data. It sets BootIf: true on the interface whose MAC address matches last-boot-macaddr. Netwrangler reads this data to build network configuration.

Bash
drpcli machines get <machine-uuid> param inventory/net-interface-data | jq -r '.[] | "\(.Name) \(.HardwareAddr) \(.BootIf)"'

Deprecated: inventory-minimal Task

The inventory-minimal task is deprecated and no longer runs by default. It added a single hw-<manufacturer>-base Profile, such as hw-dell-base or hw-hp-base. inventory-dmi and inventory-components replace it. To migrate:

  • Move the Params from a hw-<manufacturer>-base Profile into the matching hw-dmi-<key> Profile, or point a site rule at the existing Profile name with Profile:.
  • Remove inventory-minimal from any custom inventory-minimal-tasks value.

The inventory-minimal stage remains, and existing workflows that reference it pick up the new tasks without changes.

What Inventory Tracks

The inventory system uses drpcli gohai to collect low-level hardware information from the machine while it is running in Sledgehammer (or another managed environment). The collected data is processed through JQ filters defined in the inventory/collect parameter and stored as flat key-value pairs in inventory/data. Default collected fields include:

  • Memory — Total RAM (MB), number of populated DIMM slots, DIMM sizes
  • Processors — CPU count, type, speed, and core count
  • Networking — NIC count, NIC info (vendor, model, bus address), NIC speed, MAC addresses
  • Storage — Disk names, disk IDs, disk paths; RAID controller count and disk inventory
  • Display — GPU/display controller count, product, vendor, version
  • System identity — Manufacturer, serial number, product name, family, hypervisor presence
  • TPM — TPM version and public key (when TPM tooling is available)

Additional inventory sources (RAID controllers, IPMI, HPE iLO) are contributed by their respective content pack stages (raid-inventory, ipmi-inventory, hpe-ilorest-inventory).

How Machines Get Added to Inventory

Inventory collection occurs as part of the discovery or provisioning workflow. When a machine PXE boots into Sledgehammer, the universal-discover workflow runs inventory-minimal early and inventory near the end. The inventory stage runs drpcli gohai on the machine, applies the JQ field extraction rules from inventory/collect, and writes the results back to the machine's inventory/data parameter via the DRP API.

The inventory/flatten parameter (boolean) controls whether individual inventory fields are also written back as top-level machine parameters. When flattening is enabled, fields like inventory/RAM and inventory/CPUs become directly addressable parameters, which is useful for classification rules.

Querying Inventory Data

Inventory data is stored in the inventory/data parameter on each machine and can be queried via drpcli:

Bash
# Show all inventory data for a machine
drpcli machines get <machine-uuid> param inventory/data

# List all machines with their RAM values (when flattening is enabled)
drpcli machines list | jq '.[] | {Name: .Name, RAM: .Params["inventory/RAM"]}'

# Find machines with more than 128 GB RAM
drpcli machines list | jq '[.[] | select(.Params["inventory/RAM"] > 131072) | {Name, UUID: .Uuid}]'

Inventory and Machine Objects

Inventory data is attached to the machine object as parameters, not as a separate inventory object. This means inventory travels with the machine throughout its lifecycle and is visible wherever the machine's parameters are visible. When a machine is decommissioned and its machine record deleted, the inventory data is removed as well. To preserve inventory history across decommission cycles, use the auditor or event-router plugin to capture inventory snapshots as audit events before deletion.

Compliance Checking

The inventory/check parameter accepts a map of field names to regular expressions. The inventory stage evaluates each check against the collected data and fails the job if any check does not pass. This allows an operator to enforce hardware baseline requirements (e.g., minimum RAM, required NIC count) as part of the discovery workflow before a machine proceeds to provisioning.

YAML
# Example inventory/check configuration
inventory/check:
  RAM: "^(131072|262144|524288)$"   # Must be exactly 128, 256, or 512 GB
  CPUs: "^(2|4)$"                   # Must have 2 or 4 sockets
  NICs: "^[2-9]$"                   # Must have at least 2 NICs