I'm pretty sure we still have a problem in current master (Newton). In nova.compute.manager.ComputeManager._post_live_migration() we call self.compute_rpcapi.post_live_migration_at_destination(), which is an RPC cast so we have no idea when it'll actually run. (That routine is what actually updates instance.host to point to the new destination.)
Then we call self.update_available_resource(). If post_live_migration_at_destination() hasn't run yet, then the instance.host will still be be the source host and we'll account for its resources in nova.compute.resource_tracker.ResourceTracker._update_available_resource() when we call self._update_usage_from_instances(). This basically means that we called self.update_available_resource() for nothing.
The only sure fix is to make the call to post_live_migration_at_destination() an RPC cast. Barring that, we could put in a delay before calling self.update_available_resource(), or maybe move it down to the bottom of the function to increase the likelihood that post_live_migration_at_destination() has run by the time we get to it.
I'm pretty sure we still have a problem in current master (Newton). In nova.compute. manager. ComputeManager. _post_live_ migration( ) we call self.compute_ rpcapi. post_live_ migration_ at_destination( ), which is an RPC cast so we have no idea when it'll actually run. (That routine is what actually updates instance.host to point to the new destination.)
Then we call self.update_ available_ resource( ). If post_live_ migration_ at_destination( ) hasn't run yet, then the instance.host will still be be the source host and we'll account for its resources in nova.compute. resource_ tracker. ResourceTracker ._update_ available_ resource( ) when we call self._update_ usage_from_ instances( ). This basically means that we called self.update_ available_ resource( ) for nothing.
The only sure fix is to make the call to post_live_ migration_ at_destination( ) an RPC cast. Barring that, we could put in a delay before calling self.update_ available_ resource( ), or maybe move it down to the bottom of the function to increase the likelihood that post_live_ migration_ at_destination( ) has run by the time we get to it.