Comment 6 for bug 1301046

Revision history for this message
Mario Villaplana (mario-villaplana-j) wrote :

The logging didn't offer that much insight. The only consistent thing that I was able to glean was that on devstack startup the Port constructor is called and tries to set the node UUID to a real node UUID first, then it gets called again down the stack with the internal node ID. I'm not sure why there are two calls being made.

I attached the logs created by a test run with the logs defined in this commit: https://github.com/supermari0/ironic/blob/2b2bd8999daac64b476fa4c6f54f5a0d727e9026/ironic/api/controllers/v1/port.py

I eventually figured out that when any function needs to call the convert_with_links function on a port, the node UUID isn't present in the RPC node, since the node UUID isn't retained in the port from the DB. This is what prevents _set_node_uuid from calling objects.Node.get_by_uuid instead of objects.Node.get since the constructor attempts to set node_uuid to node_id. The setter eventually figures out what the correct node UUID should be after retrieving the node, and that's why calling the setter with the node ID doesn't cause failures.

I tried to retrieve the Node by its ID in convert_with_links and set the node UUID on the port before it's passed to the constructor, but tests were still failing when replacing objects.Node.get with objects.Node.get_by_uuid. The commit with that change is here: https://github.com/supermari0/ironic/commit/499e20e5270430a5d5765297a85f5709cc9f788b

I'm going to take a break from this bug to work on other things, but feel free to reassign if someone else wants to take it.