21.2. 启用自动发现

  1. undercloud.conf 文件中启用裸机自动发现:

    enable_node_discovery = True
    discovery_default_driver = ipmi
    • enable_node_discovery - 启用之后,任何使用 PXE 来引导内省虚拟内存盘的节点都在 Bare Metal 服务 (ironic) 中自动注册。
    • discovery_default_driver - 设置用于已发现节点的驱动程序。例如,ipmi
  2. 将您的 IPMI 凭证添加到 ironic:

    1. 将您的 IPMI 凭证添加到名为 ipmi-credentials.json 的文件。请替换本例中的 SampleUsernameRedactedSecurePasswordbmc_address 值,以适应您的环境:

      [
          {
              "description": "Set default IPMI credentials",
              "conditions": [
                  {"op": "eq", "field": "data://auto_discovered", "value": true}
              ],
              "actions": [
                  {"action": "set-attribute", "path": "driver_info/ipmi_username",
                   "value": "SampleUsername"},
                  {"action": "set-attribute", "path": "driver_info/ipmi_password",
                   "value": "RedactedSecurePassword"},
                  {"action": "set-attribute", "path": "driver_info/ipmi_address",
                   "value": "{data[inventory][bmc_address]}"}
              ]
          }
      ]
  3. 将 IPMI 凭证文件导入 ironic:

    $ openstack baremetal introspection rule import ipmi-credentials.json