This proposal adds the ability to perform out-of-band node inspection and automatically update node properties using node-set-provision-state (new target ‘inspect’) process. The same set of APIs can be used by in-band properties discovery too.
Today, Ironic is unable to automatically detect node properties which are required for scheduling or for deploy (ports creation).
The properties required by scheduler/deploy:
The spec proposes to add these abilities:
Following would be done to achieve properties inspection:
A new target ‘inspect’ would be added to the end point provision /v1/nodes/<uuid>/states/provision
When inspection is finished, puts node.provision_state as MANAGED and node.target_provision_state as None.
The possible new states are: INSPECTING, INSPECTFAIL, MANAGED, INSPECTED.
Refer to  for more details on each state.
Initial state : node.provision_state = INSPECTING node.target_provision_state = INSPECTED
On Success: Final State : node.provision_state = MANAGED node.target_provision_state = None
On Failure: Final State: node.provision_state = INSPECTFAIL node.target_provision_state = None And the error is updated at the last error.
The provision state will be marked as INSPECTFAIL if any of the properties (scheduler required properties) could not be inspected. In this case, no properties will be updated. So its either all or none.
A node must be in MANAGED state before initiating inspection.
The properties values will be overwritten with every invocation of discovery APIs. It is done so because there may be addition/deletions in the hardware between two invocations of the discovery CLI/APIs.
Implement timeouts for inspection. There should be a periodic task in the conductor, checking that every mapped node is not in INSPECTING state for more then inspect_timeout. This will be added as a config option in /etc/ironic/ironic.conf.
The Node.properties introspected properties will be updated whenever introspection is executed.
The following properties would be discovered :
The NICs data would be used to auto-create the ports. The other properties are mandatory properties for the scheduler, hence will be updated in Node.properties field.
The discovery can be initiated by node-create with single request to the API as below:
POST /v1/nodes/?discover=true :
In this, it requires the Nodes.post to be completely asynchronous. This would be a compatibility break for node-create as it requires a node object to be returned back. On the other hand, if discovery is done synchronously then Nodes.post will become slow. In this if Nodes.post still returns the node object without properties updated to the CLI and still do discovery in the background then Nodes.post becomes half synchronous and half asynchronous, then it will be wrong for REST API structure as the REST API shall be either synchronous or asynchronous. Hence, here node-create becomes partly synchronous and partly asynchronous. Given above reasons, this approach is not chosen.
The auto-discovery can also be used for discovering node properties but it also doesn’t provide the ability to discover properties at node-create and node-set-provision-state.
The discovered properties will be stored as part of the ‘properties’ field of the node. It will add two fields to the nodes table:
The node-set-provision-state target ‘inspect’ need to be defined. The synopsis will look like:
usage: ironic node-set-provision-state <UUID> inspect
The endpoint ‘provision’ will be enhanced with a new target:
It will add new interface InspectInterface with the method inspect_hardware():
def inspect_hardware(self, task): """Inspect hardware. :param task: a task from TaskManager. """
A driver may choose to implement the InspectInterface.
Since InspectInterface is a standard interface, following methods will also be added:
This feature will improve user experience as users no longer need to manually update the node properties info.
The inspect_timeout is introduced in the ironic.conf under conductor. The default value for same shall be 1800 secs as required by in-band implementations.
The drivers who need to implement base.InspectInterface(), may decide to implement/define the abstract methods added by this proposal.
Requires implementation of http://specs.openstack.org/openstack/ironic-specs/specs/kilo/new-ironic-state-machine.html for the states MANAGED, INSPECTED, INSPECTING and INSPECTFAIL.
Unit tests will be added conforming to ironic testing requirements. The test suites for tempest can be written for specific implementations.
It needs to be documented properly.
 All possible states for a ironic node spec: http://specs.openstack.org/openstack/ironic-specs/specs/kilo/new-ironic-state-machine.html