conf: Improve consistency in scheduler opts
* Updated header flags * Moved opts to lists * Improved indentation * Removed not needed sections * Updated unit tests Change-Id: Icdcf839b6d28893694bfa1355e9dbe8dbb5ea8c3 Co-Authored-By: Stephen Finucane <sfinucan@redhat.com> Blueprint centralize-config-options-ocata
This commit is contained in:
parent
69784047ea
commit
6832a417c9
|
@ -1,6 +1,4 @@
|
|||
# needs:check_opt_group_and_type
|
||||
# needs:fix_opt_registration_consistency
|
||||
|
||||
|
||||
# Copyright 2015 OpenStack Foundation
|
||||
# All Rights Reserved.
|
||||
|
@ -19,17 +17,13 @@
|
|||
|
||||
from oslo_config import cfg
|
||||
|
||||
DEFAULT_GROUP_NAME = "DEFAULT"
|
||||
# The scheduler has options in several groups
|
||||
METRICS_GROUP_NAME = "metrics"
|
||||
TRUSTED_GROUP_NAME = "trusted_computing"
|
||||
|
||||
|
||||
# scheduler opts
|
||||
|
||||
rpc_sched_topic_opt = cfg.StrOpt("scheduler_topic",
|
||||
scheduler_opts = [
|
||||
# TODO(sfinucan): Deprecate this option
|
||||
cfg.StrOpt("scheduler_topic",
|
||||
default="scheduler",
|
||||
help="""
|
||||
Scheduler message queue topic.
|
||||
|
||||
This is the message queue topic that the scheduler 'listens' on. It is used
|
||||
when the scheduler service is started up to configure the queue, and whenever
|
||||
an RPC call to the scheduler is made. There is almost never any reason to ever
|
||||
|
@ -38,72 +32,60 @@ change this value.
|
|||
Possible values:
|
||||
|
||||
* A valid AMQP topic name
|
||||
""")
|
||||
|
||||
scheduler_json_config_location_opt = cfg.StrOpt(
|
||||
"""),
|
||||
cfg.StrOpt(
|
||||
"scheduler_json_config_location",
|
||||
default="",
|
||||
help="""
|
||||
The absolute path to the scheduler configuration JSON file, if any. This file
|
||||
location is monitored by the scheduler for changes and reloads it if needed. It
|
||||
is converted from JSON to a Python data structure, and passed into the
|
||||
filtering and weighing functions of the scheduler, which can use it for dynamic
|
||||
configuration.
|
||||
The absolute path to the scheduler configuration JSON file, if any.
|
||||
|
||||
This file location is monitored by the scheduler for changes and reloads it if
|
||||
needed. It is converted from JSON to a Python data structure, and passed into
|
||||
the filtering and weighing functions of the scheduler, which can use it for
|
||||
dynamic configuration.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any valid file path, or an empty string
|
||||
""")
|
||||
|
||||
sched_driver_host_mgr_opt = cfg.StrOpt("scheduler_host_manager",
|
||||
* A valid file path, or an empty string
|
||||
"""),
|
||||
cfg.StrOpt("scheduler_host_manager",
|
||||
default="host_manager",
|
||||
choices=("host_manager", "ironic_host_manager"),
|
||||
help="""
|
||||
The scheduler host manager to use, which manages the in-memory picture of the
|
||||
hosts that the scheduler uses.
|
||||
The scheduler host manager to use.
|
||||
|
||||
The option value should be chosen from one of the entrypoints under the
|
||||
namespace 'nova.scheduler.host_manager' of file 'setup.cfg'. For example,
|
||||
'host_manager' is the default setting. Aside from the default, the only other
|
||||
option as of the Mitaka release is 'ironic_host_manager', which should be used
|
||||
if you're using Ironic to provision bare-metal instances.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Either 'host_manager' (default), or "ironic_hos
|
||||
""")
|
||||
|
||||
driver_opt = cfg.StrOpt("scheduler_driver",
|
||||
The host manager manages the in-memory picture of the hosts that the scheduler
|
||||
uses. The options values are chosen from the entry points under the namespace
|
||||
'nova.scheduler.host_manager' in 'setup.cfg'.
|
||||
"""),
|
||||
cfg.StrOpt("scheduler_driver",
|
||||
default="filter_scheduler",
|
||||
choices=("filter_scheduler", "caching_scheduler",
|
||||
"chance_scheduler", "fake_scheduler"),
|
||||
help="""
|
||||
The class of the driver used by the scheduler. This should be chosen from one
|
||||
of the entrypoints under the namespace 'nova.scheduler.driver' of file
|
||||
'setup.cfg'. If nothing is specified in this option, the 'filter_scheduler' is
|
||||
used.
|
||||
The class of the driver used by the scheduler.
|
||||
|
||||
Other options are:
|
||||
|
||||
* 'caching_scheduler' which aggressively caches the system state for better
|
||||
individual scheduler performance at the risk of more retries when running
|
||||
multiple schedulers.
|
||||
* 'chance_scheduler' which simply picks a host at random.
|
||||
* 'fake_scheduler' which is used for testing.
|
||||
The options are chosen from the entry points under the namespace
|
||||
'nova.scheduler.driver' in 'setup.cfg'.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any of the drivers included in Nova:
|
||||
** filter_scheduler
|
||||
** caching_scheduler
|
||||
** chance_scheduler
|
||||
** fake_scheduler
|
||||
* You may also set this to the class name of a custom scheduler driver, but you
|
||||
will be responsible for creating and maintaining the entrypoint in your
|
||||
setup.cfg file.
|
||||
""")
|
||||
|
||||
driver_period_opt = cfg.IntOpt("scheduler_driver_task_period",
|
||||
* A string, where the string corresponds to the class name of a scheduler
|
||||
driver. There are a number of options available:
|
||||
** 'caching_scheduler', which aggressively caches the system state for better
|
||||
individual scheduler performance at the risk of more retries when running
|
||||
multiple schedulers
|
||||
** 'chance_scheduler', which simply picks a host at random
|
||||
** 'fake_scheduler', which is used for testing
|
||||
** A custom scheduler driver. In this case, you will be responsible for
|
||||
creating and maintaining the entry point in your 'setup.cfg' file
|
||||
"""),
|
||||
# TODO(sfinucan): Add 'min' paramter
|
||||
cfg.IntOpt("scheduler_driver_task_period",
|
||||
default=60,
|
||||
help="""
|
||||
Periodic task interval.
|
||||
|
||||
This value controls how often (in seconds) to run periodic tasks in the
|
||||
scheduler. The specific tasks that are run for each period are determined by
|
||||
the particular scheduler being used.
|
||||
|
@ -116,16 +98,19 @@ be sure to test this with your selected scheduler.
|
|||
|
||||
Possible values:
|
||||
|
||||
* Any positive integer
|
||||
* An integer, where the integer corresponds to periodic task interval in
|
||||
seconds. A negative value disables periodic tasks.
|
||||
|
||||
Related options:
|
||||
|
||||
* ``nova-service service_down_time``
|
||||
""")
|
||||
|
||||
scheduler_max_att_opt = cfg.IntOpt("scheduler_max_attempts",
|
||||
"""),
|
||||
cfg.IntOpt("scheduler_max_attempts",
|
||||
default=3,
|
||||
min=1,
|
||||
help="""
|
||||
Maximum number of schedule attempts for a chosen host.
|
||||
|
||||
This is the maximum number of attempts that will be made to schedule an
|
||||
instance before it is assumed that the failures aren't due to normal occasional
|
||||
race conflicts, but rather some other problem. When this is reached a
|
||||
|
@ -134,17 +119,19 @@ state.
|
|||
|
||||
Possible values:
|
||||
|
||||
* Any positive integer
|
||||
""")
|
||||
* A positive integer, where the integer corresponds to the max number of
|
||||
attempts that can be made when scheduling an instance.
|
||||
""")]
|
||||
|
||||
# filter scheduler opts
|
||||
|
||||
host_subset_size_opt = cfg.IntOpt("scheduler_host_subset_size",
|
||||
filter_scheduler_opts = [
|
||||
# TODO(sfinucan): Add 'min' paramter
|
||||
cfg.IntOpt("scheduler_host_subset_size",
|
||||
default=1,
|
||||
help="""
|
||||
Size of subset of best hosts selected by scheduler.
|
||||
|
||||
New instances will be scheduled on a host chosen randomly from a subset of the
|
||||
N best hosts, where N is the value set by this option. Valid values are 1 or
|
||||
greater. Any value less than one will be treated as 1.
|
||||
N best hosts, where N is the value set by this option.
|
||||
|
||||
Setting this to a value greater than 1 will reduce the chance that multiple
|
||||
scheduler processes handling similar requests will select the same host,
|
||||
|
@ -158,17 +145,17 @@ a different scheduler, this option has no effect.
|
|||
|
||||
Possible values:
|
||||
|
||||
* Any integer, although any value less than 1 will be treated as 1
|
||||
""")
|
||||
|
||||
max_io_ops_per_host_opt = cfg.IntOpt("max_io_ops_per_host",
|
||||
* An integer, where the integer corresponds to the size of a host subset. Any
|
||||
integer is valid, although any value less than 1 will be treated as 1
|
||||
"""),
|
||||
cfg.IntOpt("max_io_ops_per_host",
|
||||
default=8,
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
This setting caps the number of instances on a host that can be actively
|
||||
performing IO (in a build, resize, snapshot, migrate, rescue, or unshelve task
|
||||
state) before that host becomes ineligible to build new instances.
|
||||
The number of instances that can be actively performing IO on a host.
|
||||
|
||||
Valid values are positive integers: 1 or greater.
|
||||
Instances performing IO includes those in the following states: build, resize,
|
||||
snapshot, migrate, rescue, unshelve.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect. Also note that this setting
|
||||
|
@ -176,34 +163,33 @@ only affects scheduling if the 'io_ops_filter' filter is enabled.
|
|||
|
||||
Possible values:
|
||||
|
||||
* Any integer is valid, although a value of zero or less will cause all hosts
|
||||
to fail the IoOpsFilter.
|
||||
""")
|
||||
|
||||
max_instances_per_host_opt = cfg.IntOpt("max_instances_per_host",
|
||||
* An integer, where the integer corresponds to the max number of instances
|
||||
that can be actively performing IO on any given host.
|
||||
"""),
|
||||
cfg.IntOpt("max_instances_per_host",
|
||||
default=50,
|
||||
help="""
|
||||
Maximum number of instances that be active on a host.
|
||||
|
||||
If you need to limit the number of instances on any given host, set this option
|
||||
to the maximum number of instances you want to allow. The num_instances_filter
|
||||
will reject any host that has at least as many instances as this option's
|
||||
value.
|
||||
|
||||
Valid values are positive integers; setting it to zero or less will cause all
|
||||
hosts to be rejected if the num_instances_filter is active.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect. Also note that this setting
|
||||
only affects scheduling if the 'num_instances_filter' filter is enabled.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any integer, although setting it to zero or less will cause all hosts to be
|
||||
rejected if the num_instances_filter is active.
|
||||
""")
|
||||
|
||||
host_mgr_tracks_inst_chg_opt = cfg.BoolOpt("scheduler_tracks_instance_changes",
|
||||
* An integer, where the integer corresponds to the max instances that can be
|
||||
scheduled on a host.
|
||||
"""),
|
||||
cfg.BoolOpt("scheduler_tracks_instance_changes",
|
||||
default=True,
|
||||
help="""
|
||||
Enable querying of individual hosts for instance information.
|
||||
|
||||
The scheduler may need information about the instances on a host in order to
|
||||
evaluate its filters and weighers. The most common need for this information is
|
||||
for the (anti-)affinity filters, which need to choose a host based on the
|
||||
|
@ -216,34 +202,31 @@ usage data to query the database on each request instead.
|
|||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect.
|
||||
""")
|
||||
|
||||
host_mgr_avail_filt_opt = cfg.MultiStrOpt("scheduler_available_filters",
|
||||
"""),
|
||||
cfg.MultiStrOpt("scheduler_available_filters",
|
||||
default=["nova.scheduler.filters.all_filters"],
|
||||
help="""
|
||||
This is an unordered list of the filter classes the Nova scheduler may apply.
|
||||
Only the filters specified in the 'scheduler_default_filters' option will be
|
||||
used, but any filter appearing in that option must also be included in this
|
||||
list.
|
||||
Filters that the scheduler can use.
|
||||
|
||||
By default, this is set to all filters that are included with Nova. If you wish
|
||||
to change this, replace this with a list of strings, where each element is the
|
||||
path to a filter.
|
||||
An unordered list of the filter classes the nova scheduler may apply. Only the
|
||||
filters specified in the 'scheduler_default_filters' option will be used, but
|
||||
any filter appearing in that option must also be included in this list.
|
||||
|
||||
By default, this is set to all filters that are included with nova.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any list of zero or more strings, with each string being the name of a filter
|
||||
that may be used for selecting a host.
|
||||
* A list of zero or more strings, where each string corresponds to the name of
|
||||
a filter that may be used for selecting a host
|
||||
|
||||
Related options:
|
||||
|
||||
* scheduler_default_filters
|
||||
""")
|
||||
|
||||
host_mgr_default_filt_opt = cfg.ListOpt("scheduler_default_filters",
|
||||
"""),
|
||||
cfg.ListOpt("scheduler_default_filters",
|
||||
default=[
|
||||
"RetryFilter",
|
||||
"AvailabilityZoneFilter",
|
||||
|
@ -256,28 +239,29 @@ host_mgr_default_filt_opt = cfg.ListOpt("scheduler_default_filters",
|
|||
"ServerGroupAffinityFilter",
|
||||
],
|
||||
help="""
|
||||
This option is the list of filter class names that will be used for filtering
|
||||
hosts. The use of 'default' in the name of this option implies that other
|
||||
filters may sometimes be used, but that is not the case. These filters will be
|
||||
applied in the order they are listed, so place your most restrictive filters
|
||||
first to make the filtering process more efficient.
|
||||
Filters that the scheduler will use.
|
||||
|
||||
An ordered list of filter class names that will be used for filtering
|
||||
hosts. Ignore the word 'default' in the name of this option: these filters will
|
||||
*always* be applied, and they will be applied in the order they are listed so
|
||||
place your most restrictive filters first to make the filtering process more
|
||||
efficient.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any list of zero or more strings, with each string being the name of a filter
|
||||
to be used for selecting a host.
|
||||
* A list of zero or more strings, where each string corresponds to the name of
|
||||
a filter to be used for selecting a host
|
||||
|
||||
Related options:
|
||||
|
||||
* All of the filters in this option *must* be present in the
|
||||
'scheduler_available_filters' option, or a SchedulerHostFilterNotFound
|
||||
exception will be raised.
|
||||
""")
|
||||
|
||||
bm_default_filter_opt = cfg.ListOpt("baremetal_scheduler_default_filters",
|
||||
"""),
|
||||
cfg.ListOpt("baremetal_scheduler_default_filters",
|
||||
default=[
|
||||
"RetryFilter",
|
||||
"AvailabilityZoneFilter",
|
||||
|
@ -289,28 +273,29 @@ bm_default_filter_opt = cfg.ListOpt("baremetal_scheduler_default_filters",
|
|||
"ExactCoreFilter",
|
||||
],
|
||||
help="""
|
||||
This option specifies the filters used for filtering baremetal hosts. The value
|
||||
should be a list of strings, with each string being the name of a filter class
|
||||
to be used. When used, they will be applied in order, so place your most
|
||||
restrictive filters first to make the filtering process more efficient.
|
||||
Filters used for filtering baremetal hosts.
|
||||
|
||||
Filters are applied in order, so place your most restrictive filters first to
|
||||
make the filtering process more efficient.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any list of zero or more strings, with each string being the name of a filter
|
||||
to be used for selecting a baremetal host.
|
||||
* A list of zero or more strings, where each string corresponds to the name of
|
||||
a filter to be used for selecting a baremetal host
|
||||
|
||||
Related options:
|
||||
|
||||
* If the 'scheduler_use_baremetal_filters' option is False, this option has
|
||||
no effect.
|
||||
""")
|
||||
|
||||
use_bm_filters_opt = cfg.BoolOpt("scheduler_use_baremetal_filters",
|
||||
"""),
|
||||
cfg.BoolOpt("scheduler_use_baremetal_filters",
|
||||
default=False,
|
||||
help="""
|
||||
Enable baremetal filters.
|
||||
|
||||
Set this to True to tell the nova scheduler that it should use the filters
|
||||
specified in the 'baremetal_scheduler_default_filters' option. If you are not
|
||||
scheduling baremetal nodes, leave this at the default setting of False.
|
||||
|
@ -323,35 +308,33 @@ Related options:
|
|||
* If this option is set to True, then the filters specified in the
|
||||
'baremetal_scheduler_default_filters' are used instead of the filters
|
||||
specified in 'scheduler_default_filters'.
|
||||
""")
|
||||
|
||||
host_mgr_sched_wgt_cls_opt = cfg.ListOpt("scheduler_weight_classes",
|
||||
"""),
|
||||
cfg.ListOpt("scheduler_weight_classes",
|
||||
default=["nova.scheduler.weights.all_weighers"],
|
||||
help="""
|
||||
This is a list of weigher class names. Only hosts which pass the filters are
|
||||
weighed. The weight for any host starts at 0, and the weighers order these
|
||||
hosts by adding to or subtracting from the weight assigned by the previous
|
||||
weigher. Weights may become negative.
|
||||
Weighers that the scheduler will use.
|
||||
|
||||
An instance will be scheduled to one of the N most-weighted hosts, where N is
|
||||
Only hosts which pass the filters are weighed. The weight for any host starts
|
||||
at 0, and the weighers order these hosts by adding to or subtracting from the
|
||||
weight assigned by the previous weigher. Weights may become negative. An
|
||||
instance will be scheduled to one of the N most-weighted hosts, where N is
|
||||
'scheduler_host_subset_size'.
|
||||
|
||||
By default, this is set to all weighers that are included with Nova. If you
|
||||
wish to change this, replace this with a list of strings, where each element is
|
||||
the path to a weigher.
|
||||
By default, this is set to all weighers that are included with Nova.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any list of zero or more strings, with each string being the name of a
|
||||
weigher that will be used for selecting a host.
|
||||
""")
|
||||
|
||||
ram_weight_mult_opt = cfg.FloatOpt("ram_weight_multiplier",
|
||||
* A list of zero or more strings, where each string corresponds to the name of
|
||||
a weigher that will be used for selecting a host
|
||||
"""),
|
||||
cfg.FloatOpt("ram_weight_multiplier",
|
||||
default=1.0,
|
||||
help="""
|
||||
Ram weight multipler ratio.
|
||||
|
||||
This option determines how hosts with more or less available RAM are weighed. A
|
||||
positive value will result in the scheduler preferring hosts with more
|
||||
available RAM, and a negative number will result in the scheduler preferring
|
||||
|
@ -365,21 +348,33 @@ This option is only used by the FilterScheduler and its subclasses; if you use
|
|||
a different scheduler, this option has no effect. Also note that this setting
|
||||
only affects scheduling if the 'ram' weigher is enabled.
|
||||
|
||||
Valid values are numeric, either integer or float.
|
||||
Possible values:
|
||||
|
||||
* An integer or float value, where the value corresponds to the multipler
|
||||
ratio for this weigher.
|
||||
"""),
|
||||
cfg.FloatOpt("disk_weight_multiplier",
|
||||
default=1.0,
|
||||
help="""
|
||||
Disk weight multipler ratio.
|
||||
|
||||
Multiplier used for weighing free disk space. Negative numbers mean to
|
||||
stack vs spread.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect. Also note that this setting
|
||||
only affects scheduling if the 'ram' weigher is enabled.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any numeric value
|
||||
""")
|
||||
|
||||
disk_weight_mult_opt = cfg.FloatOpt("disk_weight_multiplier",
|
||||
default=1.0,
|
||||
help="Multiplier used for weighing free disk space. Negative "
|
||||
"numbers mean to stack vs spread.")
|
||||
|
||||
io_ops_weight_mult_opt = cfg.FloatOpt("io_ops_weight_multiplier",
|
||||
* An integer or float value, where the value corresponds to the multipler
|
||||
ratio for this weigher.
|
||||
"""),
|
||||
cfg.FloatOpt("io_ops_weight_multiplier",
|
||||
default=-1.0,
|
||||
help="""
|
||||
IO operations weight multipler ratio.
|
||||
|
||||
This option determines how hosts with differing workloads are weighed. Negative
|
||||
values, such as the default, will result in the scheduler preferring hosts with
|
||||
lighter workloads whereas positive values will prefer hosts with heavier
|
||||
|
@ -393,39 +388,42 @@ This option is only used by the FilterScheduler and its subclasses; if you use
|
|||
a different scheduler, this option has no effect. Also note that this setting
|
||||
only affects scheduling if the 'io_ops' weigher is enabled.
|
||||
|
||||
Valid values are numeric, either integer or float.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any numeric value
|
||||
""")
|
||||
|
||||
soft_affinity_weight_opt = cfg.FloatOpt("soft_affinity_weight_multiplier",
|
||||
* An integer or float value, where the value corresponds to the multipler
|
||||
ratio for this weigher.
|
||||
"""),
|
||||
cfg.FloatOpt("soft_affinity_weight_multiplier",
|
||||
default=1.0,
|
||||
help="""
|
||||
This is the multiplier used for weighing hosts for group soft-affinity.
|
||||
Multiplier used for weighing hosts for group soft-affinity.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any numeric, although only a positive value is meaningful, as negative values
|
||||
would make this behave as a soft-anti-affinity weigher.
|
||||
""")
|
||||
|
||||
soft_anti_affinity_weight_opt = cfg.FloatOpt(
|
||||
* An integer or float value, where the value corresponds to weight multiplier
|
||||
for hosts with group soft affinity. Only a positive value are meaningful, as
|
||||
negative values would make this behave as a soft anti-affinity weigher.
|
||||
"""),
|
||||
cfg.FloatOpt(
|
||||
"soft_anti_affinity_weight_multiplier",
|
||||
default=1.0,
|
||||
help="""
|
||||
This is the multiplier used for weighing hosts for group soft-anti-affinity.
|
||||
Multiplier used for weighing hosts for group soft-anti-affinity.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any numeric, although only a positive value is meaningful, as negative values
|
||||
would make this behave as a soft-affinity weigher.
|
||||
""")
|
||||
* An integer or float value, where the value corresponds to weight multiplier
|
||||
for hosts with group soft anti-affinity. Only a positive value are
|
||||
meaningful, as negative values would make this behave as a soft affinity
|
||||
weigher.
|
||||
"""),
|
||||
|
||||
isolated_img_opt = cfg.ListOpt("isolated_images",
|
||||
# TODO(mikal): replace this option with something involving host aggregates
|
||||
cfg.ListOpt("isolated_images",
|
||||
default=[],
|
||||
help="""
|
||||
List of UUIDs for images that can only be run on certain hosts.
|
||||
|
||||
If there is a need to restrict some images to only run on certain designated
|
||||
hosts, list those image UUIDs here.
|
||||
|
||||
|
@ -435,17 +433,19 @@ only affects scheduling if the 'IsolatedHostsFilter' filter is enabled.
|
|||
|
||||
Possible values:
|
||||
|
||||
* A list of UUID strings, where each is the UUID of an image
|
||||
* A list of UUID strings, where each string corresponds to the UUID of an
|
||||
image
|
||||
|
||||
Related options:
|
||||
|
||||
* scheduler/isolated_hosts
|
||||
* scheduler/restrict_isolated_hosts_to_isolated_images
|
||||
""")
|
||||
|
||||
isolated_host_opt = cfg.ListOpt("isolated_hosts",
|
||||
"""),
|
||||
cfg.ListOpt("isolated_hosts",
|
||||
default=[],
|
||||
help="""
|
||||
List of hosts that can only run certain images.
|
||||
|
||||
If there is a need to restrict some images to only run on certain designated
|
||||
hosts, list those host names here.
|
||||
|
||||
|
@ -455,23 +455,18 @@ only affects scheduling if the 'IsolatedHostsFilter' filter is enabled.
|
|||
|
||||
Possible values:
|
||||
|
||||
* A list of stings, where each is the name of a host
|
||||
* A list of strings, where each string corresponds to the name of a host
|
||||
|
||||
Related options:
|
||||
|
||||
* scheduler/isolated_images
|
||||
* scheduler/restrict_isolated_hosts_to_isolated_images
|
||||
""")
|
||||
|
||||
restrict_iso_host_img_opt = cfg.BoolOpt(
|
||||
"""),
|
||||
cfg.BoolOpt(
|
||||
"restrict_isolated_hosts_to_isolated_images",
|
||||
default=True,
|
||||
help="""
|
||||
This setting determines if the scheduler's isolated_hosts filter will allow
|
||||
non-isolated images on a host designated as an isolated host. When set to True
|
||||
(the default), non-isolated images will not be allowed to be built on isolated
|
||||
hosts. When False, non-isolated images can be built on both isolated and
|
||||
non-isolated hosts alike.
|
||||
Prevent non-isolated images from being built on isolated hosts.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect. Also note that this setting
|
||||
|
@ -483,11 +478,12 @@ Related options:
|
|||
|
||||
* scheduler/isolated_images
|
||||
* scheduler/isolated_hosts
|
||||
""")
|
||||
|
||||
agg_img_prop_iso_namespace_opt = cfg.StrOpt(
|
||||
"""),
|
||||
cfg.StrOpt(
|
||||
"aggregate_image_properties_isolation_namespace",
|
||||
help="""
|
||||
Image property namespace for use in the host aggregate.
|
||||
|
||||
Images and hosts can be configured so that certain images can only be scheduled
|
||||
to hosts in a particular aggregate. This is done with metadata values set on
|
||||
the host aggregate that are identified by beginning with the value of this
|
||||
|
@ -495,8 +491,6 @@ option. If the host is part of an aggregate with such a metadata key, the image
|
|||
in the request spec must have the value of that metadata in its properties in
|
||||
order for the scheduler to consider the host as acceptable.
|
||||
|
||||
Valid values are strings.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect. Also note that this setting
|
||||
only affects scheduling if the 'aggregate_image_properties_isolation' filter is
|
||||
|
@ -504,24 +498,22 @@ enabled.
|
|||
|
||||
Possible values:
|
||||
|
||||
* Any string
|
||||
* A string, where the string corresponds to an image property namespace
|
||||
|
||||
Related options:
|
||||
|
||||
* aggregate_image_properties_isolation_separator
|
||||
""")
|
||||
|
||||
agg_img_prop_iso_separator_opt = cfg.StrOpt(
|
||||
"""),
|
||||
cfg.StrOpt(
|
||||
"aggregate_image_properties_isolation_separator",
|
||||
default=".",
|
||||
help="""
|
||||
Separator character(s) for image property namespace and name.
|
||||
|
||||
When using the aggregate_image_properties_isolation filter, the relevant
|
||||
metadata keys are prefixed with the namespace defined in the
|
||||
aggregate_image_properties_isolation_namespace configuration option plus a
|
||||
separator. This option defines the separator to be used. It defaults to a
|
||||
period ('.').
|
||||
|
||||
Valid values are strings.
|
||||
separator. This option defines the separator to be used.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect. Also note that this setting
|
||||
|
@ -530,14 +522,21 @@ enabled.
|
|||
|
||||
Possible values:
|
||||
|
||||
* Any string
|
||||
* A string, where the string corresponds to an image property namespace
|
||||
separator character
|
||||
|
||||
Related options:
|
||||
|
||||
* aggregate_image_properties_isolation_namespace
|
||||
"""),
|
||||
]
|
||||
|
||||
trust_group = cfg.OptGroup(name="trusted_computing",
|
||||
title="Trust parameters",
|
||||
help="""
|
||||
Configuration options for enabling Trusted Platform Module.
|
||||
""")
|
||||
|
||||
# These opts are registered as a separate OptGroup
|
||||
trusted_opts = [
|
||||
cfg.StrOpt("attestation_server",
|
||||
help="""
|
||||
|
@ -549,16 +548,14 @@ identify a node's trustworthiness. When using the Trusted filter, users can
|
|||
request that their VMs only be placed on nodes that have been verified by the
|
||||
attestation server specified in this option.
|
||||
|
||||
The value is a string, and can be either an IP address or FQDN.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect. Also note that this setting
|
||||
only affects scheduling if the 'TrustedFilter' filter is enabled.
|
||||
|
||||
Possible values:
|
||||
|
||||
* A string representing the host name of the attestation server, or an empty
|
||||
string.
|
||||
* A string representing the host name or IP address of the attestation server,
|
||||
or an empty string.
|
||||
|
||||
Related options:
|
||||
|
||||
|
@ -575,9 +572,6 @@ The absolute path to the certificate to use for authentication when connecting
|
|||
to the attestation server. See the `attestation_server` help text for more
|
||||
information about host verification.
|
||||
|
||||
The value is a string, and must point to a file that is readable by the
|
||||
scheduler.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect. Also note that this setting
|
||||
only affects scheduling if the 'TrustedFilter' filter is enabled.
|
||||
|
@ -596,23 +590,16 @@ Related options:
|
|||
* attestation_auth_timeout
|
||||
* attestation_insecure_ssl
|
||||
"""),
|
||||
cfg.StrOpt("attestation_port",
|
||||
default="8443",
|
||||
cfg.PortOpt("attestation_port",
|
||||
default=8443,
|
||||
help="""
|
||||
The port to use when connecting to the attestation server. See the
|
||||
`attestation_server` help text for more information about host verification.
|
||||
|
||||
Valid values are strings, not integers, but must be digits only.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect. Also note that this setting
|
||||
only affects scheduling if the 'TrustedFilter' filter is enabled.
|
||||
|
||||
Possible values:
|
||||
|
||||
* A string of digits representing the port number of the attestation server, or
|
||||
an empty string.
|
||||
|
||||
Related options:
|
||||
|
||||
* attestation_server
|
||||
|
@ -649,6 +636,7 @@ Related options:
|
|||
* attestation_insecure_ssl
|
||||
"""),
|
||||
cfg.StrOpt("attestation_auth_blob",
|
||||
secret=True,
|
||||
help="""
|
||||
Attestation servers require a specific blob that is used to authenticate. The
|
||||
content and format of the blob are determined by the particular attestation
|
||||
|
@ -674,6 +662,7 @@ Related options:
|
|||
* attestation_auth_timeout
|
||||
* attestation_insecure_ssl
|
||||
"""),
|
||||
# TODO(stephenfin): Add min parameter
|
||||
cfg.IntOpt("attestation_auth_timeout",
|
||||
default=60,
|
||||
help="""
|
||||
|
@ -681,18 +670,15 @@ This value controls how long a successful attestation is cached. Once this
|
|||
period has elapsed, a new attestation request will be made. See the
|
||||
`attestation_server` help text for more information about host verification.
|
||||
|
||||
The value is in seconds. Valid values must be positive integers for any
|
||||
caching; setting this to zero or a negative value will result in calls to the
|
||||
attestation_server for every request, which may impact performance.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect. Also note that this setting
|
||||
only affects scheduling if the 'TrustedFilter' filter is enabled.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any integer is valid, although setting this to zero or negative values can
|
||||
greatly impact performance when using an attestation service.
|
||||
* A integer value, corresponding to the timeout interval for attestations in
|
||||
seconds. Any integer is valid, although setting this to zero or negative
|
||||
values can greatly impact performance when using an attestation service.
|
||||
|
||||
Related options:
|
||||
|
||||
|
@ -710,8 +696,6 @@ When set to True, the SSL certificate verification is skipped for the
|
|||
attestation service. See the `attestation_server` help text for more
|
||||
information about host verification.
|
||||
|
||||
Valid values are True or False. The default is False.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect. Also note that this setting
|
||||
only affects scheduling if the 'TrustedFilter' filter is enabled.
|
||||
|
@ -727,7 +711,17 @@ Related options:
|
|||
"""),
|
||||
]
|
||||
|
||||
# These opts are registered as a separate OptGroup
|
||||
|
||||
metrics_group = cfg.OptGroup(name="metrics",
|
||||
title="Metrics parameters",
|
||||
help="""
|
||||
Configuration options for metrics
|
||||
|
||||
Options under this group allow to adjust how values assigned to metrics are
|
||||
calculated.
|
||||
""")
|
||||
|
||||
|
||||
metrics_weight_opts = [
|
||||
cfg.FloatOpt("weight_multiplier",
|
||||
default=1.0,
|
||||
|
@ -736,25 +730,22 @@ When using metrics to weight the suitability of a host, you can use this option
|
|||
to change how the calculated weight influences the weight assigned to a host as
|
||||
follows:
|
||||
|
||||
* Greater than 1.0: increases the effect of the metric on overall weight.
|
||||
|
||||
* Equal to 1.0: No change to the calculated weight.
|
||||
* Less than 1.0, greater than 0: reduces the effect of the metric on overall
|
||||
weight.
|
||||
* 0: The metric value is ignored, and the value of the 'weight_of_unavailable'
|
||||
option is returned instead.
|
||||
* Greater than -1.0, less than 0: the effect is reduced and reversed.
|
||||
* >1.0: increases the effect of the metric on overall weight
|
||||
* 1.0: no change to the calculated weight
|
||||
* >0.0,<1.0: reduces the effect of the metric on overall weight
|
||||
* 0.0: the metric value is ignored, and the value of the
|
||||
'weight_of_unavailable' option is returned instead
|
||||
* >-1.0,<0.0: the effect is reduced and reversed
|
||||
* -1.0: the effect is reversed
|
||||
* Less than -1.0: the effect is increased proportionally and reversed.
|
||||
|
||||
Valid values are numeric, either integer or float.
|
||||
* <-1.0: the effect is increased proportionally and reversed
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any numeric value
|
||||
* An integer or float value, where the value corresponds to the multipler
|
||||
ratio for this weigher.
|
||||
|
||||
Related options:
|
||||
|
||||
|
@ -786,8 +777,9 @@ a different scheduler, this option has no effect.
|
|||
Possible values:
|
||||
|
||||
* A list of zero or more key/value pairs separated by commas, where the key is
|
||||
a string representing the name of a metric, and the value is a numeric weight
|
||||
for that metric
|
||||
a string representing the name of a metric and the value is a numeric weight
|
||||
for that metric. If any value is set to 0, the value is ignored and the
|
||||
weight will be set to the value of the 'weight_of_unavailable' option.
|
||||
|
||||
Related options:
|
||||
|
||||
|
@ -801,12 +793,14 @@ is set to True, any hosts for which a metric is unavailable will raise an
|
|||
exception, so it is recommended to also use the MetricFilter to filter out
|
||||
those hosts before weighing.
|
||||
|
||||
When this option is False, any metric being unavailable for a host will set the
|
||||
host weight to 'weight_of_unavailable'.
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect.
|
||||
|
||||
Possible values:
|
||||
|
||||
* True or False, where False ensures any metric being unavailable for a host
|
||||
will set the host weight to 'weight_of_unavailable'.
|
||||
|
||||
Related options:
|
||||
|
||||
* weight_of_unavailable
|
||||
|
@ -818,16 +812,17 @@ When any of the following conditions are met, this value will be used in place
|
|||
of any actual metric value:
|
||||
|
||||
* One of the metrics named in 'weight_setting' is not available for a host,
|
||||
and the value of 'required' is False.
|
||||
* The ratio specified for a metric in 'weight_setting' is 0.
|
||||
* The 'weight_multiplier' option is set to 0.
|
||||
and the value of 'required' is False
|
||||
* The ratio specified for a metric in 'weight_setting' is 0
|
||||
* The 'weight_multiplier' option is set to 0
|
||||
|
||||
This option is only used by the FilterScheduler and its subclasses; if you use
|
||||
a different scheduler, this option has no effect.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any numeric value
|
||||
* An integer or float value, where the value corresponds to the multipler
|
||||
ratio for this weigher.
|
||||
|
||||
Related options:
|
||||
|
||||
|
@ -838,45 +833,17 @@ Related options:
|
|||
]
|
||||
|
||||
|
||||
default_opts = [host_subset_size_opt,
|
||||
bm_default_filter_opt,
|
||||
use_bm_filters_opt,
|
||||
host_mgr_avail_filt_opt,
|
||||
host_mgr_default_filt_opt,
|
||||
host_mgr_sched_wgt_cls_opt,
|
||||
host_mgr_tracks_inst_chg_opt,
|
||||
rpc_sched_topic_opt,
|
||||
sched_driver_host_mgr_opt,
|
||||
driver_opt,
|
||||
driver_period_opt,
|
||||
scheduler_json_config_location_opt,
|
||||
isolated_img_opt,
|
||||
isolated_host_opt,
|
||||
restrict_iso_host_img_opt,
|
||||
max_io_ops_per_host_opt,
|
||||
agg_img_prop_iso_namespace_opt,
|
||||
agg_img_prop_iso_separator_opt,
|
||||
max_instances_per_host_opt,
|
||||
ram_weight_mult_opt,
|
||||
disk_weight_mult_opt,
|
||||
io_ops_weight_mult_opt,
|
||||
scheduler_max_att_opt,
|
||||
soft_affinity_weight_opt,
|
||||
soft_anti_affinity_weight_opt,
|
||||
]
|
||||
|
||||
|
||||
def register_opts(conf):
|
||||
conf.register_opts(default_opts)
|
||||
trust_group = cfg.OptGroup(name=TRUSTED_GROUP_NAME,
|
||||
title="Trust parameters")
|
||||
conf.register_opts(scheduler_opts + filter_scheduler_opts)
|
||||
|
||||
conf.register_group(trust_group)
|
||||
conf.register_opts(trusted_opts, group=trust_group)
|
||||
conf.register_opts(metrics_weight_opts, group=METRICS_GROUP_NAME)
|
||||
|
||||
conf.register_group(metrics_group)
|
||||
conf.register_opts(metrics_weight_opts, group=metrics_group)
|
||||
|
||||
|
||||
def list_opts():
|
||||
return {DEFAULT_GROUP_NAME: default_opts,
|
||||
TRUSTED_GROUP_NAME: trusted_opts,
|
||||
METRICS_GROUP_NAME: metrics_weight_opts,
|
||||
}
|
||||
return {"DEFAULT": scheduler_opts + filter_scheduler_opts,
|
||||
trust_group: trusted_opts,
|
||||
metrics_group: metrics_weight_opts}
|
||||
|
|
|
@ -18,6 +18,7 @@ Tests For Scheduler
|
|||
"""
|
||||
|
||||
import mock
|
||||
import testtools
|
||||
|
||||
from nova import context
|
||||
from nova import objects
|
||||
|
@ -68,8 +69,8 @@ class SchedulerManagerInitTestCase(test.NoDBTestCase):
|
|||
def test_init_nonexist_schedulerdriver(self,
|
||||
mock_init_agg,
|
||||
mock_init_inst):
|
||||
self.flags(scheduler_driver='nonexist_scheduler')
|
||||
self.assertRaises(RuntimeError, self.manager_cls)
|
||||
with testtools.ExpectedException(ValueError):
|
||||
self.flags(scheduler_driver='nonexist_scheduler')
|
||||
|
||||
|
||||
class SchedulerManagerTestCase(test.NoDBTestCase):
|
||||
|
|
Loading…
Reference in New Issue