3a69fdb333
If the instances per host are not cached in the HostManager we lookup the HostMapping per candidate compute node during each scheduling request to get the CellMapping so we can target that cell database to pull the instance uuids on the given host. For example, if placement returned 20 compute node allocation candidates and we don't have the instances cached for any of those, we'll do 20 queries to the API DB to get host mappings. We can improve this by caching the host to cell uuid after the first lookup for a given host and then after that, get the CellMapping from the cells cache (which is a dict, keyed by cell uuid, to the CellMapping for that cell). Change-Id: Ic6b1edfad2e384eb32c6942edc522ee301123cbc Related-Bug: #1737465