watcher.decision_engine.strategy.strategies.saving_energy
Module¶watcher.decision_engine.strategy.strategies.saving_energy.
SavingEnergy
(config, osc=None)[source]¶Bases: watcher.decision_engine.strategy.strategies.base.SavingEnergyBaseStrategy
Saving Energy Strategy
Description
Saving Energy Strategy together with VM Workload Consolidation Strategy can perform the Dynamic Power Management (DPM) functionality, which tries to save power by dynamically consolidating workloads even further during periods of low resource utilization. Virtual machines are migrated onto fewer hosts and the unneeded hosts are powered off.
After consolidation, Saving Energy Strategy produces a solution of powering off/on according to the following detailed policy:
In this policy, a preset number(min_free_hosts_num) is given by user, and this min_free_hosts_num describes minimum free compute nodes that users expect to have, where “free compute nodes” refers to those nodes unused but still powered on.
If the actual number of unused nodes(in power-on state) is larger than the given number, randomly select the redundant nodes and power off them; If the actual number of unused nodes(in poweron state) is smaller than the given number and there are spare unused nodes(in poweroff state), randomly select some nodes(unused,poweroff) and power on them.
Requirements
In this policy, in order to calculate the min_free_hosts_num, users must provide two parameters:
Then choose the larger one as the final min_free_hosts_num.
Limitations
Spec URL
add_action_poweronoff_node
(node_uuid, state)[source]¶Add an action for node disability into the solution.
Parameters: |
|
---|---|
Returns: | None |
do_execute
()[source]¶Strategy execution phase
This phase is where you should put the main logic of your strategy.
get_hosts_pool
()[source]¶Get three pools, with_vms_node_pool, free_poweron_node_pool,
free_poweroff_node_pool.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.