From f87c2e8334306cb7ef78b64a4bf5949b73d87617 Mon Sep 17 00:00:00 2001 From: Arata Notsu Date: Sat, 24 Nov 2012 02:09:25 +0900 Subject: RetryFilter checks 'node' as well as 'host' FilterScheduler and RetryFilter use "(host, node)" instead of "host" to filter candidates. It makes rescheduling on different nodes in the same host possible. Fix bug 1081370 Change-Id: Id51b262de7b47b5f9215463eca5ae07a29109c3f --- nova/scheduler/filter_scheduler.py | 15 ++++++++------- nova/scheduler/filters/retry_filter.py | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'nova/scheduler') diff --git a/nova/scheduler/filter_scheduler.py b/nova/scheduler/filter_scheduler.py index 7e158765a..95a0df799 100644 --- a/nova/scheduler/filter_scheduler.py +++ b/nova/scheduler/filter_scheduler.py @@ -146,24 +146,25 @@ class FilterScheduler(driver.Scheduler): def _post_select_populate_filter_properties(self, filter_properties, host_state): - """Add additional information to the filter properties after a host has + """Add additional information to the filter properties after a node has been selected by the scheduling process. """ - # Add a retry entry for the selected compute host: - self._add_retry_host(filter_properties, host_state.host) + # Add a retry entry for the selected compute host and node: + self._add_retry_host(filter_properties, host_state.host, + host_state.nodename) self._add_oversubscription_policy(filter_properties, host_state) - def _add_retry_host(self, filter_properties, host): - """Add a retry entry for the selected compute host. In the event that + def _add_retry_host(self, filter_properties, host, node): + """Add a retry entry for the selected compute node. In the event that the request gets re-scheduled, this entry will signal that the given - host has already been tried. + node has already been tried. """ retry = filter_properties.get('retry', None) if not retry: return hosts = retry['hosts'] - hosts.append(host) + hosts.append((host, node)) def _add_oversubscription_policy(self, filter_properties, host_state): filter_properties['limits'] = host_state.limits diff --git a/nova/scheduler/filters/retry_filter.py b/nova/scheduler/filters/retry_filter.py index 6740ec099..108e4d206 100644 --- a/nova/scheduler/filters/retry_filter.py +++ b/nova/scheduler/filters/retry_filter.py @@ -20,12 +20,12 @@ LOG = logging.getLogger(__name__) class RetryFilter(filters.BaseHostFilter): - """Filter out hosts that have already been attempted for scheduling + """Filter out nodes that have already been attempted for scheduling purposes """ def host_passes(self, host_state, filter_properties): - """Skip hosts that have already been attempted""" + """Skip nodes that have already been attempted""" retry = filter_properties.get('retry', None) if not retry: # Re-scheduling is disabled @@ -33,7 +33,7 @@ class RetryFilter(filters.BaseHostFilter): return True hosts = retry.get('hosts', []) - host = host_state.host + host = (host_state.host, host_state.nodename) LOG.debug(_("Previously tried hosts: %(hosts)s. (host=%(host)s)") % locals()) -- cgit