Inspection hooks

Inspection hooks are a type of the Bare Metal service plug-ins responsible for processing data from inspection. These hooks work with both the agent (in-band) and redfish (out-of-band) inspection interfaces. By configuring these hooks, an operator can fully customize the inspection processing phase.

For agent inspection, how the data is collected can be configured with inspection collectors.

Configuring hooks

Inspection hooks are configured separately for each inspection interface type.

Agent inspection hooks

For the agent inspection interface, two configuration options are responsible for inspection hooks: inspector.default_hooks defines which hooks run by default, while inspector.hooks defines which hooks to run in your deployment. Only the second option should be modified by operators, while the first one is to provide the defaults without hardcoding them:

[inspector]
hooks = $default_hooks

To make a hook run after the default ones, append it to the list, e.g.

[inspector]
hooks = $default_hooks,extra-hardware

Redfish inspection hooks

For the redfish inspection interface, the configuration is in the [redfish] section:

[redfish]
inspection_hooks = $default_inspection_hooks

To add additional hooks:

[redfish]
inspection_hooks = $default_inspection_hooks,extra-hardware

Default hooks

In the order they go in the inspector.default_hooks option:

ramdisk-error

Processes the error field from the ramdisk, aborting inspection if it is not empty.

validate-interfaces

Validates network interfaces and stores the result in the plugin_data in two fields:

  • all_interfaces - all interfaces that pass the basic functional check.

  • valid_interfaces - interfaces that satisfy the configuration in the inspector.add_ports option.

In both cases, interfaces get an addition field:

  • pxe_enabled - whether PXE was enabled on this interface during the inspection boot.

ports

Creates ports for interfaces in valid_interfaces as set by the validate-interfaces hook.

Deletes ports that don’t match the inspector.keep_ports setting.

architecture

Populates the cpu_arch property on the node.

Optional hooks

accelerators

Populates the accelerators property based on the reported PCI devices. The known accelerators are specified in the YAML file linked in the inspector.known_accelerators option. The default file is the following:

pci_devices:
  # NVIDIA enterprise GPUs
  - vendor_id: "10de"
    device_id: "1eb8"
    type: GPU
    device_info: NVIDIA Corporation Tesla T4
  - vendor_id: "10de"
    device_id: "1df6"
    type: GPU
    device_info: NVIDIA Corporation Tesla V100S PCIe 32GB
  - vendor_id: "10de"
    device_id: "2236"
    type: GPU
    device_info: NVIDIA Corporation A10
  - vendor_id: "10de"
    device_id: "2235"
    type: GPU
    device_info: NVIDIA Corporation A40
  - vendor_id: "10de"
    device_id: "20b7"
    type: GPU
    device_info: NVIDIA Corporation A30
  - vendor_id: "10de"
    device_id: "26b9"
    type: GPU
    device_info: NVIDIA Corporation L40S
  - vendor_id: "10de"
    device_id: "26b5"
    type: GPU
    device_info: NVIDIA Corporation L40
  - vendor_id: "10de"
    device_id: "26ba"
    type: GPU
    device_info: NVIDIA Corporation L20
  - vendor_id: "10de"
    device_id: "27b8"
    type: GPU
    device_info: NVIDIA Corporation L4
  - vendor_id: "10de"
    device_id: "1db1"
    type: GPU
    device_info: NVIDIA Corporation Tesla V100 SXM2 16GB
  - vendor_id: "10de"
    device_id: "1db5"
    type: GPU
    device_info: NVIDIA Corporation Tesla V100 SXM2 32GB
  - vendor_id: "10de"
    device_id: "1db4"
    type: GPU
    device_info: NVIDIA Corporation Tesla V100 PCIe 16GB
  - vendor_id: "10de"
    device_id: "20b0"
    type: GPU
    device_info: NVIDIA Corporation A100 SXM4 40GB
  - vendor_id: "10de"
    device_id: "20b2"
    type: GPU
    device_info: NVIDIA Corporation A100 SXM4 80GB
  - vendor_id: "10de"
    device_id: "20f1"
    type: GPU
    device_info: NVIDIA Corporation A100 PCIe 40GB
  - vendor_id: "10de"
    device_id: "20b5"
    type: GPU
    device_info: NVIDIA Corporation A100 PCIe 80GB
  - vendor_id: "10de"
    device_id: "2330"
    type: GPU
    device_info: NVIDIA Corporation H100 SXM5
  - vendor_id: "10de"
    device_id: "2331"
    type: GPU
    device_info: NVIDIA Corporation H100 PCIe
  - vendor_id: "10de"
    device_id: "2321"
    type: GPU
    device_info: NVIDIA Corporation H100 NVL
  - vendor_id: "10de"
    device_id: "2335"
    type: GPU
    device_info: NVIDIA Corporation H200 SXM
  - vendor_id: "10de"
    device_id: "233b"
    type: GPU
    device_info: NVIDIA Corporation H200 NVL
  - vendor_id: "10de"
    device_id: "2901"
    type: GPU
    device_info: NVIDIA Corporation B200
  - vendor_id: "10de"
    device_id: "3182"
    type: GPU
    device_info: NVIDIA Corporation B300
  - vendor_id: "10de"
    device_id: ["31c2", "31c3"]
    type: GPU
    device_info: NVIDIA Corporation GB300 NVL
  - vendor_id: "10de"
    device_id: "2342"
    type: GPU
    device_info: NVIDIA Corporation GH200
  - vendor_id: "10de"
    device_id: "2348"
    type: GPU
    device_info: NVIDIA Corporation GH200 144GB
  # NVIDIA professional and workstation GPUs sometimes used in servers
  - vendor_id: "10de"
    device_id: "27b2"
    type: GPU
    device_info: NVIDIA Corporation RTX 4000 Ada Generation
  - vendor_id: "10de"
    device_id: "27b1"
    type: GPU
    device_info: NVIDIA Corporation RTX 4500 Ada Generation
  - vendor_id: "10de"
    device_id: "26b2"
    type: GPU
    device_info: NVIDIA Corporation RTX 5000 Ada Generation
  - vendor_id: "10de"
    device_id: "26b1"
    type: GPU
    device_info: NVIDIA Corporation RTX 6000 Ada Generation
  - vendor_id: "10de"
    device_id: "2c3a"  # server edition only
    type: GPU
    device_info: NVIDIA Corporation RTX PRO 4500
  - vendor_id: "10de"
    device_id: ["2bbc", "2bb4", "2bb5"] # workstation Max-Q vs server editions
    type: GPU
    device_info: NVIDIA Corporation RTX PRO 6000
  # AMD enterprise GPUs
  - vendor_id: "1002"
    device_id: "740f"
    type: GPU
    device_info: AMD Instinct MI210
  - vendor_id: "1002"
    device_id: "7408"
    type: GPU
    device_info: AMD Instinct MI250X
  - vendor_id: "1002"
    device_id: "74a1"
    type: GPU
    device_info: AMD Instinct MI300X
  - vendor_id: "1002"
    device_id: "74a5"
    type: GPU
    device_info: AMD Instinct MI325X
  - vendor_id: "1002"
    device_id: "75a0"
    type: GPU
    device_info: AMD Instinct MI350X
  - vendor_id: "1002"
    device_id: "75a8"
    type: GPU
    device_info: AMD Instinct MI350P
boot-mode

Sets the boot_mode capability based on the observed boot mode, see Boot mode support.

cpu-capabilities

Uses the CPU flags to discover CPU capabilities. The exact mapping can be customized via configuration:

[inspector]
cpu_capabilities = vmx:cpu_vt,svm:cpu_vt

See inspector.cpu_capabilities for the default mapping.

extra-hardware

Converts the data collected by python-hardware from its raw format into nested dictionaries under the extra plugin data field.

local-link-connection

Uses the LLDP information from the ramdisk to populate the local_link_connection field on ports with the physical switch information.

memory

Populates the memory_mb property based on physical RAM information from DMI.

parse-lldp

Parses the raw binary LLDP information from the ramdisk and populates the parsed_lldp dictionary in plugin data. The keys are network interface names, the values are dictionaries with LLDP values. Example:

"parsed_lldp": {
    "eth0": {
        "switch_chassis_id": "11:22:33:aa:bb:cc",
        "switch_system_name": "sw01-dist-1b-b12"
    }
}
pci-devices

Populates the capabilities based on PCI devices. The mapping is provided by the inspector.pci_device_alias option.

physical-network

Populates the physical_network port field for Networking with the Bare Metal service based on the detected IP addresses. The mapping is provided by the inspector.physical_network_cidr_map option.

raid-device

Detects the newly created RAID device and populates the root_device property used in root device hints. Requires two inspections: one before and one after the RAID creation.

root-device

Uses root device hints on the node and the storage device information from the ramdisk to calculate the expected root device and populate the local_gb property (taking the inspector.disk_partitioning_spacing option into account).