This change ensures that resources are updated only once per
update_available_resource() call.
Compute resources were previously updated during host
object initialization and at the end of
update_available_resource(). It could cause inconsistencies
in resource tracking between compute host and DB for couple
of second when final _update() at the end of
update_available_resource() is being called.
For example: nova-api shows that host uses 10GB of RAM, but
in fact its 12GB because DB doesn't have resources that belongs
to shutdown instance.
Because of that fact nova-scheduler (CachingScheduler) could
choose (based on imcomplete information) host which is already full.
For more informations please see realted bug: #1729621
Change-Id: I120a98cc4c11772f24099081ef3ac44a50daf71d
Closes-Bug: #1729621
(cherry picked from commit c9b74bcfa0)