Ignore the previous comment, the cache refreshal happens during every periodic task like stated in the code comment through "get_available_nodes" function (https://github.com/openstack/nova/blob/a628d2f09a42a0faa5fcb36793e2304de634638e/nova/compute/manager.py#L8123), the reason for inconsistency is because at the time of saving the power state during nova start/stop, the power_state is taken from the cache at the time when the cache is not upto date and then saves it to the database. So even if the cache gets refreshed, the database has already saved the wrong information which is why it waits for 10mins (the next power sync) to change this information. So we should grab the latest info during the start/stop actions.
Ignore the previous comment, the cache refreshal happens during every periodic task like stated in the code comment through "get_available_ nodes" function (https:/ /github. com/openstack/ nova/blob/ a628d2f09a42a0f aa5fcb36793e230 4de634638e/ nova/compute/ manager. py#L8123), the reason for inconsistency is because at the time of saving the power state during nova start/stop, the power_state is taken from the cache at the time when the cache is not upto date and then saves it to the database. So even if the cache gets refreshed, the database has already saved the wrong information which is why it waits for 10mins (the next power sync) to change this information. So we should grab the latest info during the start/stop actions.