It is not possible to tell from the baremetal node status that a deployment has failed because a machine's BIOS hung or was improperly configured. This would be discernable with an additional state change between BUILDING and DEPLOYING.
Details
=====
During a baremetal deployment, the state is tracked in the nova_bm.bm_nodes table. The state is set to BUILDING when virt/driver/baremetal.py:driver.spawn() acquires the node and begins preparing the deployment. After the power_driver's activate_node() method is called, the PXE driver goes into a wait loop to see when the deployment is done. The state is changed to DEPLOYING when baremetal-deploy-helper receives a connection from the deployment ramdisk, and then either set to DEPLOYDONE or DEPLOYFAIL, accordingly.
There is a middle step which is not currently represented. If the baremetal node powers on but never connects to the deploy-helper, it is impossible to tell from the database whether the deploy environment was not created or whether the machine is dead.
Proposed fix
==========
Add a PREPARED state to baremetal_states.py, and set the node to this state immediately after calling activate_node().
The code is now different, but I think your proposal is always good to add.
What do you think about to add this states at the just after the call: /github. com/openstack/ nova/blob/ master/ nova/virt/ baremetal/ driver. py#L250
https:/