The proposal presents the work required to enhance the power
interface to support soft reboot and soft power off, and the
management interface to support diagnostic interrupt (NMI [1]).
There exists a problem in the current driver interface which doesn’t
provide with soft power off and diagnostic interrupt (NMI [1])
capabilities even though ipmitool [2] and most of BMCs support these
capabilities.
Here is a part of ipmitool man page in which describes soft power off and
diagnostic interrupt (NMI [1]).
From customer’s point of view, both tenant admin and tenant user, the
lack of the soft power off and diagnostic interrupt (NMI [1]) lead the
following inconveniences.
Customer cannot safely shutdown or soft power off their instance
without logging on.
Customer cannot take NMI dump to investigate OS related problem by
themselves.
From deployer’s point of view, that is cloud provider, the lack of the
two capabilities leads the following inconveniences.
Cloud provider support staff cannot shutdown customer’s instance
safely without logging on for hardware maintenance reason or etc.
Cloud provider support staff cannot ask customer to take NMI dump
as one of investigation materials.
In order to solve the problems described in the previous section,
this spec proposes to enhance the power states, the PowerInterface
base class and the ManagementInterface base class so that each driver
can implement to initiate soft reboot, soft power off and inject NMI.
And this enhancement enables the soft reboot, soft power off and
inject NMI through Ironic CLI and REST API for tenant admin and cloud
provider. Also this enhancement enables them through Nova CLI and REST
API for tenant user when Nova’s blueprint [3] is implemented.
As a reference implementation, this spec also proposes to implement
the enhanced PowerInterface base class into the IPMIPower concrete
class and the enhanced ManagementInterface base class into the
IPMIManagement concrete class.
add the following new power states to ironic.common.states:
SOFT_REBOOT='soft rebooting'SOFT_POWER_OFF='soft power off'
add “get_supported_power_states” method and its default implementation
to the base PowerInterface class in ironic/drivers/base.py:
defget_supported_power_states(self,task):"""Get a list of the supported power states. :param task: A TaskManager instance containing the node to act on. :returns: A list of the supported power states defined in :mod:`ironic.common.states`. """return[states.POWER_ON,states.POWER_OFF,states.REBOOT]
Note: WakeOnLanPower driver supports only states.POWER_ON.
add a default parameter timeout into the “set_power_state”
method in to the base PowerInterface class in ironic/drivers/base.py:
@abc.abstractmethoddefset_power_state(self,task,power_state,timeout=None):"""Set the power state of the task's node. :param task: a TaskManager instance containing the node to act on. :param power_state: Any power state from :mod:`ironic.common.states`. :param timeout: timeout positive integer (> 0) for any power state. ``None`` indicates to use default timeout which depends on ``power_state``[*]_ and driver. :raises: MissingParameterValue if a required parameter is missing. """
enhance “set_power_state” method in IPMIPower class so that the
new states can be accepted as “power_state” parameter.
IPMIPower reference implementation supports SOFT_REBOOT and
SOFT_POWER_OFF.
SOFT_REBOOT is implemented by first SOFT_POWER_OFF and then a plain POWER_ON
such that Ironic implemented REBOOT. This implementation enables
generic BMC detect the reboot completion as the power state change
from ON -> OFF -> ON which power transition is called powercycle.
The following table shows power state value of each state variables.
new_state is a value of the second parameter of set_power_state()
function.
power_state is a value of node property.
target_power_state is a value of node property.
add “get_supported_power_states” method and implementation in
IPMIPower:
defget_supported_power_states(self,task):"""Get a list of the supported power states. :param task: A TaskManager instance containing the node to act on. currently not used. :returns: A list of the supported power states defined in :mod:`ironic.common.states`. """return[states.POWER_ON,states.POWER_OFF,states.REBOOT,states.SOFT_REBOOT,states.SOFT_POWER_OFF]
add “inject_nmi” abstract method to the base ManagementInterface
class in ironic/drivers/base.py:
@abc.abstractmethoddefinject_nmi(self,task):"""Inject NMI, Non Maskable Interrupt. :param task: A TaskManager instance containing the node to act on. :returns: None """
add “inject_nmi” concrete method implementation in IPMIManagement
class.
Both the soft power off and diagnostic interrupt (NMI [1]) could be
implemented by vendor passthru. However the proposed change is
better than the vendor passthru, because users of Ironic API or
Ironic CLI can write script or program uniformly.
Add support of SOFT_REBOOT and SOFT_POWER_OFF to the target
parameter of following API:
PUT /v1/nodes/(node_ident)/states/power
The target parameter supports the following JSON data respectively.
``timeout`` is an optional parameter for any ``target`` parameter.
In case of "soft reboot" and "soft power off", ``timeout`` overrides
``soft_power_off_timeout`` in the in the Ironic configuration file,
typically /etc/ironic/ironic.conf.
Examples
{"target": "soft reboot",
"timeout": 900}
{"target": "soft power off",
"timeout": 600}
Add a new management API to support inject NMI:
PUT/v1/nodes/(node_ident)/management/inject_nmiRequestdoesn't take any parameter.
Enhance Ironic CLI “ironic node-set-power-state” to support power
graceful off/reboot by adding optional arguments.
This CLI is async. In order to get the latest status,
call “ironic node-show-states” and check the returned value.:
usage: ironic node-set-power-state <node> <power-state>
[--soft] [--timeout <timeout>]
Power a node on/off/reboot, power graceful off/reboot to a node.
Positional arguments
<node>
Name or UUID of the node.
<power-state>
'on', 'off', 'reboot'
Optional arguments:
--soft
power graceful off/reboot.
--timeout <timeout>
timeout positive integer value(> 0) for any ``power-state``.
If ``--soft`` option is also specified, it overrides
``soft_power_off_timeout`` in the in the Ironic configuration
file, typically /etc/ironic/ironic.conf.
Add a new Ironic CLI “ironic node-inject-nmi” to support inject nmi.
This CLI is async. In order to get the latest status, serial console
access is required.:
Enhance OSC plugin “openstack baremetal node” so that the parameter
can accept ‘reboot [–soft] [–timeout <timeout>]’, ‘power [on|off
[–soft] [–timeout <timeout>]’ and ‘inject nmi’.
This CLI is async. In order to get the latest status,
call “openstack baremetal node show” and check the returned value.:
PowerInterface base and ManagementInterface base are enhanced by
adding a new method respectively as described in the section “Proposed
change”.
And these enhancements keep API backward compatible.
Therefore it doesn’t have any risk to break out of tree drivers.
The default behavior of “nova reboot” command to a virtual machine
instance such as KVM is soft reboot.
And “nova reboot” command has a option ‘–hard’ to indicate hard reboot.
However the default behavior of “nova reboot” to an Ironic instance
is hard reboot, and –hard option is meaningless to the Ironic instance.
Therefore Ironic Nova driver needs to be update to unify the behavior
between virtual machine instance and bare-metal instance.
This problem is reported as a bug [6]. How to fix this problem is
specified in nova blueprint [10] and spec [11].
The default behavior change of “nova reboot” command is made by
following the standard deprecation policy [12]. How to deprecate nova
command is also specified in nova blueprint [10] and spec [11].
Enhance PowerInterface class and ManagementInterface class to
support soft power off and inject nmi [1] as described “Proposed
change”.
Enhance Ironic API as described in “REST API impact”.
Enhance Ironic CLI as described in “Client (CLI) impact”.
Implement the enhanced PowerInterface class into the concrete class
IPMIPower, and the enhanced ManagementInterface class into the
concrete class IPMIManagement.
Implementing vendor’s concrete class is up to each vendor.
Coordinate the work with Nova NMI support “Inject NMI to an
instance” [3] if necessary.
Update the deployer documentation from the ironic perspective.
Soft power off control depends on ACPI [7]. In case of Linux system,
acpid [8] has to be installed. In case of Windows system, local
security policy has to be set as described in “Shutdown: Allow
system to be shut down without having to log on” [9].
NMI [1] reaction depends on Kernel Crash Dump Configuration. How to
set up the kernel dump can be found for Linux system in [13], [14], and
for Windows in [15].
Note
The backwards compatibility issue of the default behavior change of
“nova reboot” command is solved by following the standard deprecation
policy [12].