Add new actions “power on” and “power off” in Watcher

For a data center with large amount of VMs and physical hosts,the total power consumption is tremendous. When workload is not heavy, Watcher can be used to reduce power consumption by triggering a request to power off some idle hosts without VMs. And when the workload increases watcher will trigger a “power on” request to fulfill the service requirements.

This feature includes four sub-features:

  • Build a new baremetal data model in Watcher.

  • Add new actions “power on” and “power off” in Watcher.

  • Implement a new strategy based on ‘baremetal’ and ‘compute’ data models, which could trigger ‘compute’ and ‘baremetal’ actions.

  • Update bare metal data model by ironic notifications.

This spec implements the second sub-feature:Add new actions “power on” and “power off” in Watcher.

Problem description

The telecommunication network traffic tidal [1] is an actual phenomenon in the telecommunication. For example, during the daytime, large amount of users gather in the CBD[2] area and the workload of network traffic system is high. When they get off work, the number of users declines rapidly and so does the network traffic workload. The problem is how to fulfill user network service requirements with minimal energy consumption given the changing network traffic workloads.

As a real case from ZTE corporation, this problem is addressed by the following way. Firstly, a boundary value is set to describe the maximum percentage of idle hosts in a cluster, which is configurable by User. When the ratio of idle hosts gets higher than the boundary value, we power off some idle hosts until the ratio reduces to the boundary value. Correspondingly, when this ratio becomes lower than the preset value, we power on some hosts until the ration increases to the boundary value.

The feature in this spec will implement only the power on and power off actions, the feature of deciding which hosts will be powered off/on according to a boundary value will be left for future work.

Use Cases

As a deployer, I want to have a “power off” action in watcher to help reduce energy consumption by automatically cutting down the number of running hosts when workload is low.

As a deployer, I want to have a “power off” action in watcher to automatically increase the number of running hosts when workload increases and requires more resources.

Proposed change

Given the target hosts, we use Ironic Client to call IPMI tools to do the “power on” and “power off” actions through the follwing Ironic API:

Host state verification before executing the power on/off audit.



Data model impact


REST API impact


Security impact


Notifications impact


Other end user impact


Performance Impact


Other deployer impact


Developer impact

Test this new action using unit test. Or as an alternative, developer can use an actuator strategy to allow excplicit action execution. This actuator strategy is described in the following patchset:



Primary assignee:


Other contributors:


Work Items

Acquire target hosts from Watcher baremetal data model. Implement action:’change_node_power_state’,where the input parameters of this action is ‘on’ or ‘off’.


This feature is in dependent with the following blueprint:


  • Unit tests

  • Tempest test

Documentation Impact



[1] [2] [3]




Release Name