The watcher.decision_engine.strategy.strategies.base Module

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
filter_instances_by_audit_tag(instances)[source]
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
classmethod get_display_name()[source]

The goal display name for the strategy

classmethod get_goal()[source]

The goal the strategy achieves

classmethod get_goal_name()[source]

The goal name the strategy achieves

classmethod get_name()[source]

The name of the strategy

classmethod get_schema()[source]

Defines a Schema that the input parameters shall comply to

Returns:A jsonschema format (mandatory default setting)
Return type:dict
classmethod get_translatable_display_name()[source]

The translatable msgid of the strategy

post_execute()[source]

Post-execution phase

This can be used to compute the global efficacy

pre_execute()[source]

Pre-execution phase

This can be used to fetch some pre-requisites or data.

class watcher.decision_engine.strategy.strategies.base.DummyBaseStrategy(config, osc=None)[source]

Bases: watcher.decision_engine.strategy.strategies.base.BaseStrategy

classmethod get_goal_name()[source]
class watcher.decision_engine.strategy.strategies.base.NoisyNeighborBaseStrategy(config, osc=None)[source]

Bases: watcher.decision_engine.strategy.strategies.base.BaseStrategy

classmethod get_goal_name()[source]
class watcher.decision_engine.strategy.strategies.base.SavingEnergyBaseStrategy(config, osc=None)[source]

Bases: watcher.decision_engine.strategy.strategies.base.BaseStrategy

classmethod get_goal_name()[source]
class watcher.decision_engine.strategy.strategies.base.ServerConsolidationBaseStrategy(config, osc=None)[source]

Bases: watcher.decision_engine.strategy.strategies.base.BaseStrategy

classmethod get_goal_name()[source]
class watcher.decision_engine.strategy.strategies.base.StrategyEndpoint(messaging)[source]

Bases: object

get_strategy_info(context, strategy_name)[source]
class watcher.decision_engine.strategy.strategies.base.ThermalOptimizationBaseStrategy(config, osc=None)[source]

Bases: watcher.decision_engine.strategy.strategies.base.BaseStrategy

classmethod get_goal_name()[source]
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 omitting the need for the strategy developer to define a goal straight away.

classmethod get_goal_name()[source]
class watcher.decision_engine.strategy.strategies.base.WorkloadStabilizationBaseStrategy(config, osc=None)[source]

Bases: watcher.decision_engine.strategy.strategies.base.BaseStrategy

classmethod get_goal_name()[source]
class watcher.decision_engine.strategy.strategies.base.ZoneMigrationBaseStrategy(config, osc=None)[source]

Bases: watcher.decision_engine.strategy.strategies.base.BaseStrategy

classmethod get_goal_name()[source]
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.