Chapter 24. 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 . 24.1. Enabling auto-discovery Enable and configure Bare Metal auto-discovery to automatically discover and import nodes that join your provisioning network when booting with PXE. Procedure 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: 24.2. Testing auto-discovery PXE boot a node that is connected to your provisioning network to test the Bare Metal auto-discovery feature. Procedure 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: 24.3. 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. Procedure 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