Display host chosen for instance by scheduler

The scheduler is configured to schedule an instance on a host chosen
randomly from a subset of the N best hosts. Where the size of the subset
is defined as 'scheduler_host_subset_size' from the configuration.

In a configuration where the subset is greater than the default (1) the
scheduler does not display where it has scheduled the instance to. It
gives a list of all those that it has weighed - just not the one chosen.

This patch displays the chosen host.

Closes-Bug: 1426364

Change-Id: Ibd7d6dcd67609217d5be5e50fbad130676f403d4
This commit is contained in:
Ryan Moore 2015-02-27 13:13:17 +00:00
parent afc2e675d7
commit f1b45a2a40
1 changed files with 1 additions and 0 deletions

View File

@ -155,6 +155,7 @@ class FilterScheduler(driver.Scheduler):
chosen_host = random.choice(
weighed_hosts[0:scheduler_host_subset_size])
LOG.debug("Selected host: %(host)s", {'host': chosen_host})
selected_hosts.append(chosen_host)
# Now consume the resources so the filter/weights