trivial: Add additional logs for NUMA scheduling

Expand logs to provide operators with future information on why NUMA
scheduling may have failed for a given host.

Change-Id: I57e639d5e25485e3fa1112adf48a35ff847e20f9
This commit is contained in:
Stephen Finucane
2015-12-08 14:29:01 +00:00
parent aaaba4a12e
commit 0eb41b75a5

View File

@@ -1200,8 +1200,16 @@ def numa_fit_instance_to_host(
InstanceNUMATopology with it's cell ids set to host cell id's of
the first successful permutation, or None.
"""
if (not (host_topology and instance_topology) or
len(host_topology) < len(instance_topology)):
if not (host_topology and instance_topology):
LOG.debug("Require both a host and instance NUMA topology to "
"fit instance on host.")
return
elif len(host_topology) < len(instance_topology):
LOG.debug("There are not enough free cores on the system to schedule "
"the instance correctly. Required: %(required)s, actual: "
"%(actual)s",
{'required': len(instance_topology),
'actual': len(host_topology)})
return
else:
# TODO(ndipanov): We may want to sort permutations differently