Skip to content

Command · pk-metal

pk-metal check

changes no machineno cluster necessary

pk-metal check tests one BMC before you enroll the machine. It reads only. The command talks to the BMC directly. It does not use the operator or the cluster.

pk-metal check [flags] <bmc-url>
<bmc-url>
The address of the BMC, for example https://192.0.2.11. Give one address.
FlagDefaultDescription
--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).
--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.

--bmc-ca names a PEM file with the CA certificates of your site. The command then accepts only a BMC certificate that chains to one of them. --insecure stops the certificate check. The command then prints a warning: a host on the network path can read the BMC password.

Each request to the BMC must answer in 30 seconds. Ctrl+C stops the command at once.

  1. The command logs in to the BMC with a Redfish session, and deletes the session when it stops. A BMC without sessions gets HTTP Basic authentication.
  2. It reads the manager: the vendor and the firmware version.
  3. It reads each virtual media slot and the dialect that the slot uses to mount an image.
  4. It reads each system: the serial number and the power state.
  5. It prints check: OK (read-only).

The session cannot change the BMC. The client refuses all requests that write.

pk-metal check
export PK_METAL_BMC_PASSWORD=...
pk-metal check --user admin https://192.0.2.11
manager:  Huawei fw 6.72
media:    CD             dialect=vmm-control
media:    USBStick       dialect=none
system:   1 serial=SIMHW2288V5000397 power=On
check:    OK (read-only)

A slot with dialect=none cannot mount an image. This BMC has one slot that can: it is a one-slot BMC.

Check a BMC whose certificate comes from the CA of your site:

Terminal window
pk-metal check --bmc-ca site-ca.pem https://192.0.2.11

A BMC in the lab has a self-signed certificate. Add --insecure only for such a BMC.

Terminal window
pk-metal check --insecure https://10.77.0.1:8441

The test suite has read-only checks for a real BMC. They test that each read answers, that the identity of the machine is there, and that two reads give the same chassis and systems. The client of the checks refuses each request that writes.

Terminal window
export PK_METAL_BMC_PASSWORD=...
PK_METAL_HW_URL=https://192.0.2.11 PK_METAL_HW_CA=site-ca.pem mise run test:hardware

Without PK_METAL_HW_CA, the checks do not verify the BMC certificate. PK_METAL_HW_USER sets the user. The default is admin.

The command reads and writes no object in the cluster. The operator does the same checks when it reconciles a ManagementEndpoint.

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