d693d4c06c
Add power state change callbacks of an instance to nova by performing API requests. Whenever there is a change in the power state of a physical instance (example a "power on" or "power off" IPMI command is issued or the periodic ``_sync_power_states`` task detects a change in power state) ironic will create and send a ``power-update`` external event to nova using which nova will update the power state of the instance in its database. By conveying the power state changes to nova, ironic becomes the source of truth thus preventing nova from forcing wrong power states on the instance during the nova-ironic periodic sync. It also adds the possibility of bringing up/down a physical instance through the ironic API even if it was put down/up through the nova API. Note that ironic only sends requests to nova if the target power state is either "power on" or "power off". Other error states will be ignored. In cases where the power state change is originally coming from nova, the event will still be created and sent to nova and on the nova side it will be a no-op with a debug log saying the node is already powering on/off. NOTE: Although an exclusive lock (task_manager.upgrade_lock() method) is used when calling the nova API to send events, there can still be a race condition if the nova-ironic power sync happens to happen a nano-second before the power state change event is received from ironic in which case the nova state will be forced on the node. Credit for introducing ksa adapter: Eric Fried <openstack@fried.cc> Depends-On: https://review.opendev.org/#/c/645611/ Part of blueprint nova-support-instance-power-update Story: 2004969 Task: 29424 Change-Id: I6d105524e1645d9a40dfeae2850c33cf2d110826
31 lines
1.7 KiB
YAML
31 lines
1.7 KiB
YAML
---
|
|
features:
|
|
- |
|
|
Adds power state change callbacks of an instance to the Compute service by
|
|
performing API notifications. This is configurable through the
|
|
``nova.send_power_notifications`` config option. Whenever there is a change
|
|
in the power state of a physical instance (for example a "power on" or
|
|
"power off" API command is issued or during the periodic power state
|
|
synchronization between nova and ironic) the Baremetal service will create
|
|
and send a ``power-update`` external event to the Compute service which will
|
|
cause the power state of the instance to be updated in its database. It
|
|
also adds the possibility of bringing up/down a physical instance through
|
|
the Baremetal service API even if it was put down/up through the Compute
|
|
service API.
|
|
fixes:
|
|
- |
|
|
By immediately conveying all the power state changes (note that the
|
|
Baremetal service only sends requests to the Compute service if the target
|
|
power state is either "power on" or "power off") of an instance through
|
|
external events to the Compute service, the Baremetal service becomes the
|
|
source of truth thus preventing the Compute service from forcing wrong
|
|
power states on the instance during the periodic power state
|
|
synchronization between nova and ironic. An exception would be if a race
|
|
condition were to occur due to the nova-ironic power sync task happening
|
|
a nano-second before the power state change event is received from the
|
|
Baremetal service in which case the nova instance state will be forced
|
|
on the baremetal node.
|
|
upgrade:
|
|
- |
|
|
In order to support power state change call backs to nova, the ``[nova]``
|
|
section must be configured in the baremetal service configuration. |