The watcher.decision_engine.strategy.strategies.saving_energy Module

The watcher.decision_engine.strategy.strategies.saving_energy Module

class 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:

  • One parameter(“min_free_hosts_num”) is a constant int number. This number should be int type and larger than zero.
  • The other parameter(“free_used_percent”) is a percentage number, which describes the quotient of min_free_hosts_num/nodes_with_VMs_num, where nodes_with_VMs_num is the number of nodes with VMs running on it. This parameter is used to calculate a dynamic min_free_hosts_num. The nodes with VMs refer to those nodes with VMs running on it.

Then choose the larger one as the final min_free_hosts_num.

Limitations

  • at least 2 physical compute hosts

Spec URL

http://specs.openstack.org/openstack/watcher-specs/specs/pike/implemented/energy-saving-strategy.html

add_action_poweronoff_node(node_uuid, state)[source]

Add an action for node disability into the solution.

Parameters:
  • node – node uuid
  • state – node power state, power on or power off
Returns:

None

do_execute()[source]

Strategy execution phase

This phase is where you should put the main logic of your strategy.

classmethod get_display_name()[source]

The goal display name for the strategy

get_hosts_pool()[source]

Get three pools, with_vms_node_pool, free_poweron_node_pool,

free_poweroff_node_pool.

classmethod get_name()[source]

The name of the strategy

classmethod get_schema()[source]

return a schema of two input parameters

The standby nodes refer to those nodes unused but still poweredon to deal with boom of new instances.

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.

save_energy()[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.