diff options
author | Joe Gordon <jogo@cloudscaling.com> | 2013-04-03 16:54:08 -0700 |
---|---|---|
committer | Joe Gordon <jogo@cloudscaling.com> | 2013-04-04 01:10:46 +0000 |
commit | 820f43fc6113b39d55d13fbff8dca67eb954cfd9 (patch) | |
tree | 5da7c8ed41467cc76b93f012c18b56e661b20179 /nova/scheduler | |
parent | f3d6e5ccdad2520ee4261835517e1db2c80b8f3a (diff) | |
download | nova-820f43fc6113b39d55d13fbff8dca67eb954cfd9.tar.gz nova-820f43fc6113b39d55d13fbff8dca67eb954cfd9.tar.xz nova-820f43fc6113b39d55d13fbff8dca67eb954cfd9.zip |
Remove deprecated Grizzly code.
Now that Havana development has started remove code deprecated in Grizzly.
Change-Id: Ie3e7611347c334c359dea98d759345b97c66c9c1
Diffstat (limited to 'nova/scheduler')
-rw-r--r-- | nova/scheduler/filters/__init__.py | 7 | ||||
-rw-r--r-- | nova/scheduler/filters/trusted_filter.py | 6 | ||||
-rw-r--r-- | nova/scheduler/filters/type_filter.py | 4 | ||||
-rw-r--r-- | nova/scheduler/weights/__init__.py | 7 | ||||
-rw-r--r-- | nova/scheduler/weights/least_cost.py | 126 |
5 files changed, 2 insertions, 148 deletions
diff --git a/nova/scheduler/filters/__init__.py b/nova/scheduler/filters/__init__.py index 0bd069826..720c2807a 100644 --- a/nova/scheduler/filters/__init__.py +++ b/nova/scheduler/filters/__init__.py @@ -48,10 +48,3 @@ def all_filters(): and should return a list of all filter classes available. """ return HostFilterHandler().get_all_classes() - - -def standard_filters(): - """Deprecated. Configs should change to use all_filters().""" - LOG.deprecated(_("Use 'nova.scheduler.filters.all_filters' instead " - "of 'nova.scheduler.filters.standard_filters'")) - return all_filters() diff --git a/nova/scheduler/filters/trusted_filter.py b/nova/scheduler/filters/trusted_filter.py index 411ae93bd..bb1962ebe 100644 --- a/nova/scheduler/filters/trusted_filter.py +++ b/nova/scheduler/filters/trusted_filter.py @@ -61,24 +61,18 @@ LOG = logging.getLogger(__name__) trusted_opts = [ cfg.StrOpt('attestation_server', - # deprecated in Grizzly - deprecated_name='server', default=None, help='attestation server http'), cfg.StrOpt('attestation_server_ca_file', - deprecated_name='server_ca_file', default=None, help='attestation server Cert file for Identity verification'), cfg.StrOpt('attestation_port', - deprecated_name='port', default='8443', help='attestation server port'), cfg.StrOpt('attestation_api_url', - deprecated_name='api_url', default='/OpenAttestationWebServices/V1.0', help='attestation web API URL'), cfg.StrOpt('attestation_auth_blob', - deprecated_name='auth_blob', default=None, help='attestation authorization blob - must change'), cfg.IntOpt('attestation_auth_timeout', diff --git a/nova/scheduler/filters/type_filter.py b/nova/scheduler/filters/type_filter.py index 3f7c631b7..89cddf3c2 100644 --- a/nova/scheduler/filters/type_filter.py +++ b/nova/scheduler/filters/type_filter.py @@ -21,8 +21,8 @@ from nova.scheduler import filters class TypeAffinityFilter(filters.BaseHostFilter): """TypeAffinityFilter doesn't allow more then one VM type per host. - Note: this works best with compute_fill_first_cost_fn_weight - (dispersion) set to 1 (-1 by default). + Note: this works best with ram_weight_multiplier + (spread) set to 1 (default). """ def host_passes(self, host_state, filter_properties): diff --git a/nova/scheduler/weights/__init__.py b/nova/scheduler/weights/__init__.py index 1a8a15c43..321bb42b8 100644 --- a/nova/scheduler/weights/__init__.py +++ b/nova/scheduler/weights/__init__.py @@ -20,7 +20,6 @@ Scheduler host weights from oslo.config import cfg from nova.openstack.common import log as logging -from nova.scheduler.weights import least_cost from nova import weights LOG = logging.getLogger(__name__) @@ -52,10 +51,4 @@ class HostWeightHandler(weights.BaseWeightHandler): def all_weighers(): """Return a list of weight plugin classes found in this directory.""" - - if (CONF.least_cost_functions is not None or - CONF.compute_fill_first_cost_fn_weight is not None): - LOG.deprecated(_('least_cost has been deprecated in favor of ' - 'the RAM Weigher.')) - return least_cost.get_least_cost_weighers() return HostWeightHandler().get_all_classes() diff --git a/nova/scheduler/weights/least_cost.py b/nova/scheduler/weights/least_cost.py deleted file mode 100644 index d3e04f47e..000000000 --- a/nova/scheduler/weights/least_cost.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2011-2012 OpenStack Foundation -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -""" -Least Cost is an algorithm for choosing which host machines to -provision a set of resources to. The input is a WeightedHost object which -is decided upon by a set of objective-functions, called the 'cost-functions'. -The WeightedHost contains a combined weight for each cost-function. - -The cost-function and weights are tabulated, and the host with the least cost -is then selected for provisioning. - -NOTE(comstud): This is deprecated. One should use the RAMWeigher and/or -create other weight modules. -""" - -from oslo.config import cfg - -from nova import exception -from nova.openstack.common import importutils -from nova.openstack.common import log as logging - - -LOG = logging.getLogger(__name__) - -least_cost_opts = [ - cfg.ListOpt('least_cost_functions', - default=None, - help='Which cost functions the LeastCostScheduler should use'), - cfg.FloatOpt('noop_cost_fn_weight', - default=1.0, - help='How much weight to give the noop cost function'), - cfg.FloatOpt('compute_fill_first_cost_fn_weight', - default=None, - help='How much weight to give the fill-first cost function. ' - 'A negative value will reverse behavior: ' - 'e.g. spread-first'), - ] - -CONF = cfg.CONF -CONF.register_opts(least_cost_opts) - - -def noop_cost_fn(host_state, weight_properties): - """Return a pre-weight cost of 1 for each host.""" - return 1 - - -def compute_fill_first_cost_fn(host_state, weight_properties): - """Higher weights win, so we should return a lower weight - when there's more free ram available. - - Note: the weight modifier for this function in default configuration - is -1.0. With -1.0 this function runs in reverse, so systems - with the most free memory will be preferred. - """ - return -host_state.free_ram_mb - - -def _get_cost_functions(): - """Returns a list of tuples containing weights and cost functions to - use for weighing hosts - """ - cost_fns_conf = CONF.least_cost_functions - if cost_fns_conf is None: - # The old default. This will get fixed up below. - fn_str = 'nova.scheduler.least_cost.compute_fill_first_cost_fn' - cost_fns_conf = [fn_str] - cost_fns = [] - for cost_fn_str in cost_fns_conf: - short_name = cost_fn_str.split('.')[-1] - if not (short_name.startswith('compute_') or - short_name.startswith('noop')): - continue - # Fix up any old paths to the new paths - if cost_fn_str.startswith('nova.scheduler.least_cost.'): - cost_fn_str = ('nova.scheduler.weights.least_cost' + - cost_fn_str[25:]) - try: - # NOTE: import_class is somewhat misnamed since - # the weighing function can be any non-class callable - # (i.e., no 'self') - cost_fn = importutils.import_class(cost_fn_str) - except ImportError: - raise exception.SchedulerCostFunctionNotFound( - cost_fn_str=cost_fn_str) - - try: - flag_name = "%s_weight" % cost_fn.__name__ - weight = getattr(CONF, flag_name) - except AttributeError: - raise exception.SchedulerWeightFlagNotFound( - flag_name=flag_name) - # Set the original default. - if (flag_name == 'compute_fill_first_cost_fn_weight' and - weight is None): - weight = -1.0 - cost_fns.append((weight, cost_fn)) - return cost_fns - - -def get_least_cost_weighers(): - cost_functions = _get_cost_functions() - - # Unfortunately we need to import this late so we don't have an - # import loop. - from nova.scheduler import weights - - class _LeastCostWeigher(weights.BaseHostWeigher): - def weigh_objects(self, weighted_hosts, weight_properties): - for host in weighted_hosts: - host.weight = sum(weight * fn(host.obj, weight_properties) - for weight, fn in cost_functions) - - return [_LeastCostWeigher] |