Looking at nova/compute/manager.py in _allocate_network_async() there is code and comment
instance.system_metadata['network_allocated'] = 'True'
# NOTE(JoshNang) do not save the instance here, as it can cause
# races. The caller shares a reference to instance and waits
# for this async greenthread to finish before calling
# instance.save().
But that doesn't seem to be true, the corresponding code in
# NOTE(JoshNang) This also saves the changes to the # instance from _allocate_network_async, as they aren't # saved in that function to prevent races. instance.save(expected_task_state= task_states.BLOCK_DEVICE_MAPPING)
gets executed earlier, as in the log I can see the self.driver.spawn() call below this code being executed before _allocate_network_async logs the assigned network info.
Looking at nova/compute/ manager. py in _allocate_ network_ async() there is code and comment
# NOTE(JoshNang) do not save the instance here, as it can cause
# races. The caller shares a reference to instance and waits
# for this async greenthread to finish before calling
# instance.save().
But that doesn't seem to be true, the corresponding code in
gets executed earlier, as in the log I can see the self.driver.spawn() call below this code being executed before _allocate_ network_ async logs the assigned network info.