Skip to content

Command · pk-metal

pk-metal inventory

changes no machineno cluster necessary

pk-metal inventory reads the hardware facts of one machine from its BMC and prints them as a YAML fact file. It reads only. The command talks to the BMC directly. It does not use the operator or the cluster.

pk-metal inventory [flags] <bmc-url>
<bmc-url>
The address of the BMC, for example https://192.0.2.11. Give one address.
FlagDefaultDescription
--address<string>-Address label for the fact file (default: endpoint host).
--bmc-ca<string>-PEM file with the CA certificates that the BMC's TLS certificate must chain to.
--insecurefalseSkip TLS verification of the BMC (prefer --bmc-ca).
--node<string>-Node name for the fact file (default: derived from the endpoint host).
--system<string>-System id to describe (default: the BMC's only system).
--user<string>adminBMC username (password via PK_METAL_BMC_PASSWORD).

The password comes from the environment variable PK_METAL_BMC_PASSWORD. It is never a flag.

  1. The command logs in to the BMC with a Redfish session, or with HTTP Basic authentication if the BMC has no sessions. It cannot write.
  2. It reads the manager, the virtual media slots, the systems and the chassis.
  3. It selects the system of --system. A BMC with one system needs no --system. A BMC with more systems needs it, and the command stops with the list of system ids if you do not give it.
  4. It prints the fact file to stdout.

The fact file has these parts:

Part Content
node The name from --node, or the host part of the address.
bmc Address, MAC address, firmware version, host name and the virtual media slots.
system Manufacturer, model, serial number, UUID, power state, memory and processors.
nics The network interfaces of the system, with their MAC addresses.
adapters The network adapters of the chassis, when the BMC reports them.
pk-metal inventory
pk-metal inventory --node sim-0001 https://192.0.2.11 > sim-0001.yaml
head -n 12 sim-0001.yaml
# GENERATED by pk-metal inventory (2026-11-24T09:30:00Z) — re-run to refresh; do not hand-edit.
node: sim-0001
bmc:
  address: "192.0.2.11"
  mac: "02:00:00:00:03:97"
  firmware: "6.76"
  hostname: "SIMHW2288V5000397" # iBMC reports the chassis serial here
  virtualmedia:
    - { id: "CD", media_types: [], insert_standard: false, oem_actions: ["#VirtualMedia.VmmControl"] }
system:
  manufacturer: "Huawei"
  model: "2288H V5"

Use the serial number and the BMC MAC address from the fact file when you write the Asset.

The command reads and writes no object in the cluster. In the cluster, the Host controller writes the same facts into the status of the Host.

CodeMeaning
0Success.
1Error; the message is on stderr, as "pk-metal: <message>".