The watcher.decision_engine.strategy.strategies.base
Module¶
A Strategy is an algorithm implementation which is able to find a Solution for a given Goal.
There may be several potential strategies which are able to achieve the same Goal. This is why it is possible to configure which specific Strategy should be used for each Goal.
Some strategies may provide better optimization results but may take more time to find an optimal Solution.
When a new Goal is added to the Watcher configuration, at least one default associated Strategy should be provided as well.
Some default implementations are provided, but it is possible to develop new implementations which are dynamically loaded by Watcher at launch time.
-
class
watcher.decision_engine.strategy.strategies.base.
BaseStrategy
(config, osc=None)[source]¶ Bases:
watcher.common.loader.loadable.Loadable
A base class for all the strategies
A Strategy is an algorithm implementation which is able to find a Solution for a given Goal.
-
do_execute
()[source]¶ Strategy execution phase
This phase is where you should put the main logic of your strategy.
-
execute
()[source]¶ Execute a strategy
Returns: A computed solution (via a placement algorithm) Return type: BaseSolution
instance
-
classmethod
get_config_opts
()[source]¶ Defines the configuration options to be associated to this loadable
Returns: A list of configuration options relative to this Loadable Return type: list of oslo_config.cfg.Opt
instances
-
-
class
watcher.decision_engine.strategy.strategies.base.
DummyBaseStrategy
(config, osc=None)[source]¶ Bases:
watcher.decision_engine.strategy.strategies.base.BaseStrategy
-
class
watcher.decision_engine.strategy.strategies.base.
ServerConsolidationBaseStrategy
(config, osc=None)[source]¶ Bases:
watcher.decision_engine.strategy.strategies.base.BaseStrategy
-
class
watcher.decision_engine.strategy.strategies.base.
ThermalOptimizationBaseStrategy
(config, osc=None)[source]¶ Bases:
watcher.decision_engine.strategy.strategies.base.BaseStrategy
-
class
watcher.decision_engine.strategy.strategies.base.
UnclassifiedStrategy
(config, osc=None)[source]¶ Bases:
watcher.decision_engine.strategy.strategies.base.BaseStrategy
This base class is used to ease the development of new strategies
The goal defined within this strategy can be used to simplify the documentation explaining how to implement a new strategy plugin by ommitting the need for the strategy developer to define a goal straight away.
-
class
watcher.decision_engine.strategy.strategies.base.
WorkloadStabilizationBaseStrategy
(config, osc=None)[source]¶ Bases:
watcher.decision_engine.strategy.strategies.base.BaseStrategy