Chapter 20. Automatically discovering bare metal nodes You can use auto-discovery to register overcloud nodes and generate their metadata, without the need to create an instackenv.json file. This improvement can help to reduce the time it takes to collect information about a node. For example, if you use auto-discovery, you do not to collate the IPMI IP addresses and subsequently create the instackenv.json . 20.1. Prerequisites You have configured all overcloud nodes BMCs to be accessible to director through the IPMI. You have configured all overcloud nodes to PXE boot from the NIC that is connected to the undercloud control plane network. 20.2. Enabling auto-discovery Enable Bare Metal auto-discovery in the undercloud.conf file: enable_node_discovery - When enabled, any node that boots the introspection ramdisk using PXE is enrolled in the Bare Metal service (ironic) automatically. discovery_default_driver - Sets the driver to use for discovered nodes. For example, ipmi . Add your IPMI credentials to ironic: Add your IPMI credentials to a file named ipmi-credentials.json . Replace the SampleUsername , RedactedSecurePassword , and bmc_address values in this example to suit your environment: Import the IPMI credentials file into ironic: 20.3. Testing auto-discovery Power on the required nodes. Run the openstack baremetal node list command. You should see the new nodes listed in an enrolled state: Set the resource class for each node: Configure the kernel and ramdisk for each node: Set all nodes to available: 20.4. Using rules to discover different vendor hardware If you have a heterogeneous hardware environment, you can use introspection rules to assign credentials and remote management credentials. For example, you might want a separate discovery rule to handle your Dell nodes that use DRAC: Create a file named dell-drac-rules.json with the following contents: Replace the user name and password values in this example to suit your environment: Import the rule into ironic:

Commands:
enable_node_discovery = True discovery_default_driver = ipmi
[ { "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]}"} ] } ]
openstack baremetal introspection rule import ipmi-credentials.json
openstack baremetal node list +--------------------------------------+------+---------------+-------------+--------------------+-------------+ | UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance | +--------------------------------------+------+---------------+-------------+--------------------+-------------+ | c6e63aec-e5ba-4d63-8d37-bd57628258e8 | None | None | power off | enroll | False | | 0362b7b2-5b9c-4113-92e1-0b34a2535d9b | None | None | power off | enroll | False | +--------------------------------------+------+---------------+-------------+--------------------+-------------+
for NODE in `openstack baremetal node list -c UUID -f value` ; do openstack baremetal node set USDNODE --resource-class baremetal ; done
for NODE in `openstack baremetal node list -c UUID -f value` ; do openstack baremetal node manage USDNODE ; done openstack overcloud node configure --all-manageable
for NODE in `openstack baremetal node list -c UUID -f value` ; do openstack baremetal node provide USDNODE ; done
[ { "description": "Set default IPMI credentials", "conditions": [ {"op": "eq", "field": "data://auto_discovered", "value": true}, {"op": "ne", "field": "data://inventory.system_vendor.manufacturer", "value": "Dell Inc."} ], "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]}"} ] }, { "description": "Set the vendor driver for Dell hardware", "conditions": [ {"op": "eq", "field": "data://auto_discovered", "value": true}, {"op": "eq", "field": "data://inventory.system_vendor.manufacturer", "value": "Dell Inc."} ], "actions": [ {"action": "set-attribute", "path": "driver", "value": "idrac"}, {"action": "set-attribute", "path": "driver_info/drac_username", "value": "SampleUsername"}, {"action": "set-attribute", "path": "driver_info/drac_password", "value": "RedactedSecurePassword"}, {"action": "set-attribute", "path": "driver_info/drac_address", "value": "{data[inventory][bmc_address]}"} ] } ]
openstack baremetal introspection rule import dell-drac-rules.json