Created attachment 1030183 [details]
Description of problem:
Nodes discovery fails when instackenv.json file contains the nodes mac addresses.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Deploy undercloud
2. instack-ironic-deployment --nodes-json instackenv.json --register-nodes
3. instack-ironic-deployment --discover-nodes
[stack@bldr16cc09 ~]$ instack-ironic-deployment --discover-nodes
Preparing for deployment...
Sending node ID bda62f11-c51d-4dc2-9678-8568b0df2b52 to discoverd for discovery ... DONE.
Sending node ID 320892bc-8a4b-466d-82e4-46e6cda9be4d to discoverd for discovery ... DONE.
Sending node ID 1ef01a1a-e985-4c42-8a2a-fa9493927595 to discoverd for discovery ... DONE.
Polling discoverd for discovery results ...
Result for node bda62f11-c51d-4dc2-9678-8568b0df2b52 is ... DISCOVERED.
Node bda62f11-c51d-4dc2-9678-8568b0df2b52 is locked by host localhost.localdomain, please retry after the current operation is completed. (HTTP 409)
Nodes hardware parameters get discovered.
It looks that if I remove the mac addresses from the instackenv.json file the 'port with mac address already exits' error message disappears but discovery still fails for some of the nodes. I'm attaching relevant logs and steps I did.
It's definitely not a discoverd bug. Either my retrying solution in ironicclient is incomplete, or we should tune a couple of things in instack-undercloud. I'll have a look.
Something like https://review.gerrithub.io/#/c/234406/ should help
Tested the patch and nodes got discovered with provision state set to available this time. Thanks!
One thing I noticed is that errors still show up in the openstack-ironic-discoverd log, maybe showing those with warning severity would be better:
ERROR:ironicclient.common.http:Error contacting Ironic server: A port with MAC address d8:d3:85:be:01:0c already exists. (HTTP 409). Attempt 6 of 6
ERROR:ironicclient.common.http:Error contacting Ironic server: Node 5394855d-0423-40a4-b86a-45ebfd09abe1 can not be updated while a state transition is in progress. (HTTP 409). Attempt 6 of 6
Created attachment 1037336 [details]
more ironic logs
If I remove the MAC addresses from the instackenv.json file prior to registering the nodes, then only one node gets registered upon running "instack-ironic-deployment --nodes-json instackenv.json --register-nodes".
I actually had to re-run the above command 4 times to see 4 nodes in the output from "ironic node-list", where one node was added after every run of the command to the list.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.