Saving Energy Strategy

Synopsis

display name: Saving Energy Strategy

goal: saving_energy

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

Requirements

This feature will use Ironic to do the power on/off actions, therefore this feature requires that the ironic component is configured. And the compute node should be managed by Ironic.

Ironic installation: https://docs.openstack.org/ironic/latest/install/index.html

Cluster data model

Default Watcher’s Compute cluster data model:

Nova cluster data model collector

The Nova cluster data model collector creates an in-memory representation of the resources exposed by the compute service.

Actions

action

description

change_node_power_state

Compute node power on/off

By using this action, you will be able to on/off the power of a compute node.

The action schema is:

schema = Schema({
 'resource_id': str,
 'state': str,
})

The resource_id references a ironic node id (list of available ironic node is returned by this command: ironic node-list). The state value should either be on or off.

Planner

Default Watcher’s planner:

Weight planner implementation

This implementation builds actions with parents in accordance with weights. Set of actions having a higher weight will be scheduled before the other ones. There are two config options to configure: action_weights and parallelization.

Limitations

  • This planner requires to have action_weights and parallelization configs tuned well.

Configuration

Strategy parameter is:

parameter

type

default Value

description

free_used_percent

Number

10.0

a rational number, which describes the the quotient of min_free_hosts_num/nodes_with_VMs_num

min_free_hosts_num

Int

1

an int number describes minimum free compute nodes

Efficacy Indicator

None

Algorithm

For more information on the Energy Saving Strategy please refer to: http://specs.openstack.org/openstack/watcher-specs/specs/pike/implemented/energy-saving-strategy.html

How to use it ?

step1: Add compute nodes info into ironic node management

$ ironic node-create  -d pxe_ipmitool -i ipmi_address=10.43.200.184 \
  ipmi_username=root  -i ipmi_password=nomoresecret -e compute_node_id=3

step 2: Create audit to do optimization

$ openstack optimize audittemplate create \
  saving_energy_template1 saving_energy --strategy saving_energy

$ openstack optimize audit create -a saving_energy_audit1 \
  -p free_used_percent=20.0