检查数据

带内检查过程会收集关于节点的大量信息。这些数据包含两部分

  • 清单 (Inventory) 取决于使用的检查接口。请参阅 清单

  • 插件数据 是由 ramdisk 端和服务器端插件填充的数据。请参阅 插件数据

在成功检查后,你可以使用以下命令以 JSON 格式获取这两部分数据

$ baremetal node inventory save <NODE>

使用 jq 过滤你需要的部分,例如仅获取清单本身

$ # System vendor information from the inventory
$ baremetal node inventory save <NODE> | jq .inventory.system_vendor
{
  "product_name": "KVM (9.2.0)",
  "serial_number": "",
  "manufacturer": "Red Hat",
  "firmware": {
    "vendor": "EDK II",
    "version": "edk2-20221207gitfff6d81270b5-7.el9",
    "build_date": "12/07/2022"
  }
}

$ # Interfaces used to create ports
$ baremetal node inventory save <NODE> | jq .plugin_data.valid_interfaces
{
  "eth0": {
    "name": "eth0",
    "mac_address": "52:54:00:5e:09:ff",
    "ipv4_address": "192.168.122.164",
    "ipv6_address": "fe80::5054:ff:fe5e:9ff",
    "has_carrier": true,
    "lldp": null,
    "vendor": "0x1af4",
    "product": "0x0001",
    "client_id": null,
    "biosdevname": null,
    "speed_mbps": null,
    "pxe_enabled": true
  }
}

库存

inventory 的结构取决于使用的检查接口。

  • agent - 关于此接口报告的信息,请参阅 硬件清单

  • redfish - 此接口的目标是实现 agent 实现,但目前已知尚未完成。

由于许多服务器端插件,被称为 检查钩子 (Inspection hooks) 位于 Ironic 源代码树中,因此正在努力在此处定义它们。

顶层

细节

cpu

CPU 详情的 JSON 对象

memory

内存详情的 JSON 对象

bmc_address

可选的 IPv4 地址,字符串形式

bmc_v6address

可选的 IPv6 地址,字符串形式

disk

磁盘详情的 JSON 对象列表

interfaces

网卡详情的 JSON 对象列表

system_vendor

SMBIOS 详情的 JSON 对象

boot

启动详情的 JSON 对象

lldp_raw

可选的 LLDP 数据的 JSON 对象

pci_devices

可选的 PCI 详情的 JSON 对象列表

usb_devices

可选的 USB 详情的 JSON 对象列表

插件数据

插件数据是各种插件收集或处理的所有信息的存储位置。其格式不属于 API 稳定性承诺的一部分,并且可能根据你的配置而更改。

插件数据来自两个来源

数据存储

有几种选项可以存储检查数据,通过 inventory.data_backend 选项指定

none

完全不存储检查数据。API 将始终返回 404 NOT FOUND。

database

将检查数据存储在主数据库中的单独表中。

swift

将检查数据存储在对象存储服务 (swift) 中,存储在由 inventory.swift_data_container 选项指定的容器中。

警告

目前无法在后端之间迁移数据。更改后端将删除对现有数据的访问权限。