In watcher, an audit generates a set of actions which aims at achieving a given goal (lower energy consumption, ...). It is possible to configure different strategies in order to achieve each goal. Each strategy is written as a Python class which produces a set of actions. Today, the set of possible actions is fixed for a given version of Watcher and enables optimization algorithms to include actions such as instance migration, changing hypervisor state, changing power state (ACPI level, ...). The objective of this patchset is to give the ability to extend the default set of planner algorithms currently available in Watcher using Stevedore. The doc need to explain how create a new planner. DocImpact Partially implements: blueprint watcher-add-actions-via-conf Change-Id: I2fd73f8c4a457ee391d764a7a3f494deecd2634f
36 lines
1.3 KiB
Python
36 lines
1.3 KiB
Python
# -*- encoding: utf-8 -*-
|
|
# Copyright 2014
|
|
# The Cloudscaling Group, Inc.
|
|
#
|
|
# 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.
|
|
|
|
import watcher.api.app
|
|
from watcher.applier import manager as applier_manager
|
|
from watcher.decision_engine import manager as decision_engine_manger
|
|
from watcher.decision_engine.planner import manager as planner_manager
|
|
from watcher.decision_engine.strategy.selection import default \
|
|
as strategy_selector
|
|
|
|
|
|
def list_opts():
|
|
return [
|
|
('api', watcher.api.app.API_SERVICE_OPTS),
|
|
('watcher_goals', strategy_selector.WATCHER_GOALS_OPTS),
|
|
('watcher_decision_engine',
|
|
decision_engine_manger.WATCHER_DECISION_ENGINE_OPTS),
|
|
('watcher_applier',
|
|
applier_manager.APPLIER_MANAGER_OPTS),
|
|
('watcher_planner', planner_manager.WATCHER_PLANNER_OPTS)
|
|
]
|