summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api-ref/source/samples/driver-property-response.json2
-rw-r--r--ironic/conf/ipmi.py8
-rw-r--r--ironic/drivers/modules/ipmitool.py25
-rw-r--r--ironic/tests/unit/conductor/test_manager.py2
-rw-r--r--ironic/tests/unit/drivers/modules/test_ipmitool.py18
-rw-r--r--releasenotes/notes/ipmi-disable-timeout-option-e730362007f9bedd.yaml11
-rw-r--r--releasenotes/notes/story-2004266-4725d327900850bf.yaml4
7 files changed, 54 insertions, 16 deletions
diff --git a/api-ref/source/samples/driver-property-response.json b/api-ref/source/samples/driver-property-response.json
index 0cab58c..ca94685 100644
--- a/api-ref/source/samples/driver-property-response.json
+++ b/api-ref/source/samples/driver-property-response.json
@@ -7,7 +7,7 @@
7 "image_no_proxy": "A comma-separated list of host names, IP addresses and domain names (with optional :port) that will be excluded from proxying. To denote a domain name, use a dot to prefix the domain name. This value will be ignored if ``image_http_proxy`` and ``image_https_proxy`` are not specified. Optional.", 7 "image_no_proxy": "A comma-separated list of host names, IP addresses and domain names (with optional :port) that will be excluded from proxying. To denote a domain name, use a dot to prefix the domain name. This value will be ignored if ``image_http_proxy`` and ``image_https_proxy`` are not specified. Optional.",
8 "ipmi_address": "IP address or hostname of the node. Required.", 8 "ipmi_address": "IP address or hostname of the node. Required.",
9 "ipmi_bridging": "bridging_type; default is \"no\". One of \"single\", \"dual\", \"no\". Optional.", 9 "ipmi_bridging": "bridging_type; default is \"no\". One of \"single\", \"dual\", \"no\". Optional.",
10 "ipmi_disable_timeout": "By default ironic will send a raw IPMI command to disable the 60 second timeout for booting. Setting this option to False will NOT send that command; default value is True. Optional.", 10 "ipmi_disable_boot_timeout": "By default ironic will send a raw IPMI command to disable the 60 second timeout for booting. Setting this option to False will NOT send that command; default value is True. Optional.",
11 "ipmi_force_boot_device": "Whether Ironic should specify the boot device to the BMC each time the server is turned on, eg. because the BMC is not capable of remembering the selected boot device across power cycles; default value is False. Optional.", 11 "ipmi_force_boot_device": "Whether Ironic should specify the boot device to the BMC each time the server is turned on, eg. because the BMC is not capable of remembering the selected boot device across power cycles; default value is False. Optional.",
12 "ipmi_local_address": "local IPMB address for bridged requests. Used only if ipmi_bridging is set to \"single\" or \"dual\". Optional.", 12 "ipmi_local_address": "local IPMB address for bridged requests. Used only if ipmi_bridging is set to \"single\" or \"dual\". Optional.",
13 "ipmi_password": "password. Optional.", 13 "ipmi_password": "password. Optional.",
diff --git a/ironic/conf/ipmi.py b/ironic/conf/ipmi.py
index 80ade23..466888e 100644
--- a/ironic/conf/ipmi.py
+++ b/ironic/conf/ipmi.py
@@ -41,6 +41,14 @@ opts = [
41 'node power state if `ipmitool` process does not exit ' 41 'node power state if `ipmitool` process does not exit '
42 'after `command_retry_timeout` timeout expires. ' 42 'after `command_retry_timeout` timeout expires. '
43 'Recommended setting is True')), 43 'Recommended setting is True')),
44 cfg.BoolOpt('disable_boot_timeout',
45 default=True,
46 help=_('Default timeout behavior whether ironic sends a raw '
47 'IPMI command to disable the 60 second timeout for '
48 'booting. Setting this option to False will NOT send '
49 'that command, the default value is True. It may be '
50 'overridden by per-node \'ipmi_disable_boot_timeout\' '
51 'option in node\'s \'driver_info\' field.')),
44] 52]
45 53
46 54
diff --git a/ironic/drivers/modules/ipmitool.py b/ironic/drivers/modules/ipmitool.py
index 28e3792..d2f42ed 100644
--- a/ironic/drivers/modules/ipmitool.py
+++ b/ironic/drivers/modules/ipmitool.py
@@ -99,11 +99,14 @@ OPTIONAL_PROPERTIES = {
99 "capable of remembering the selected boot " 99 "capable of remembering the selected boot "
100 "device across power cycles; default value " 100 "device across power cycles; default value "
101 "is False. Optional."), 101 "is False. Optional."),
102 'ipmi_disable_timeout': _('By default ironic will send a raw IPMI ' 102 'ipmi_disable_boot_timeout': _('By default ironic will send a raw IPMI '
103 'command to disable the 60 second timeout ' 103 'command to disable the 60 second timeout '
104 'for booting. Setting this option to ' 104 'for booting. Setting this option to '
105 'False will NOT send that command; default ' 105 'False will NOT send that command on '
106 'value is True. Optional.'), 106 'this node. The '
107 '[ipmi]disable_boot_timeout will be '
108 'used if this option is not set. '
109 'Optional.'),
107} 110}
108COMMON_PROPERTIES = REQUIRED_PROPERTIES.copy() 111COMMON_PROPERTIES = REQUIRED_PROPERTIES.copy()
109COMMON_PROPERTIES.update(OPTIONAL_PROPERTIES) 112COMMON_PROPERTIES.update(OPTIONAL_PROPERTIES)
@@ -963,8 +966,12 @@ class IPMIManagement(base.ManagementInterface):
963 # NOTE(tonyb): Some BMCs do not implement Option 0x03, such as OpenBMC 966 # NOTE(tonyb): Some BMCs do not implement Option 0x03, such as OpenBMC
964 # and will error when we try to set this. Resulting in an abort. If 967 # and will error when we try to set this. Resulting in an abort. If
965 # the BMC doesn't support this timeout there isn't a need to disable 968 # the BMC doesn't support this timeout there isn't a need to disable
966 # it. Let's use a driver option to signify that 969 # it. Let's use a driver option to signify that.
967 idt = task.node.driver_info.get('ipmi_disable_timeout', True) 970 # NOTE(kaifeng) [ipmi]disable_boot_timeout provides default value if
971 # driver_info/ipmi_disable_boot_timeout is not set.
972 idt = task.node.driver_info.get('ipmi_disable_boot_timeout')
973 if idt is None:
974 idt = CONF.ipmi.disable_boot_timeout
968 if strutils.bool_from_string(idt): 975 if strutils.bool_from_string(idt):
969 # note(JayF): IPMI spec indicates unless you send these raw bytes 976 # note(JayF): IPMI spec indicates unless you send these raw bytes
970 # the boot device setting times out after 60s. Since it's possible 977 # the boot device setting times out after 60s. Since it's possible
@@ -975,8 +982,8 @@ class IPMIManagement(base.ManagementInterface):
975 send_raw(task, timeout_disable) 982 send_raw(task, timeout_disable)
976 else: 983 else:
977 LOG.info('For node %(node_uuid)s, ' 984 LOG.info('For node %(node_uuid)s, '
978 'driver_info[\'ipmi_disable_timeout\'] is set to False, ' 985 'driver_info[\'ipmi_disable_boot_timeout\'] is set '
979 'so not sending ipmi boot-timeout-disable', 986 'to False, so not sending ipmi boot-timeout-disable',
980 {'node_uuid', task.node.uuid}) 987 {'node_uuid', task.node.uuid})
981 988
982 if task.node.driver_info.get('ipmi_force_boot_device', False): 989 if task.node.driver_info.get('ipmi_force_boot_device', False):
diff --git a/ironic/tests/unit/conductor/test_manager.py b/ironic/tests/unit/conductor/test_manager.py
index 4bdf86e..0cfb7de 100644
--- a/ironic/tests/unit/conductor/test_manager.py
+++ b/ironic/tests/unit/conductor/test_manager.py
@@ -6964,7 +6964,7 @@ class ManagerTestProperties(mgr_utils.ServiceSetUpMixin, db_base.DbTestCase):
6964 'force_persistent_boot_device', 'ipmi_protocol_version', 6964 'force_persistent_boot_device', 'ipmi_protocol_version',
6965 'ipmi_force_boot_device', 'deploy_forces_oob_reboot', 6965 'ipmi_force_boot_device', 'deploy_forces_oob_reboot',
6966 'rescue_kernel', 'rescue_ramdisk', 6966 'rescue_kernel', 'rescue_ramdisk',
6967 'ipmi_disable_timeout'] 6967 'ipmi_disable_boot_timeout']
6968 self._check_driver_properties("ipmi", expected) 6968 self._check_driver_properties("ipmi", expected)
6969 6969
6970 def test_driver_properties_snmp(self): 6970 def test_driver_properties_snmp(self):
diff --git a/ironic/tests/unit/drivers/modules/test_ipmitool.py b/ironic/tests/unit/drivers/modules/test_ipmitool.py
index c953019..461d683 100644
--- a/ironic/tests/unit/drivers/modules/test_ipmitool.py
+++ b/ironic/tests/unit/drivers/modules/test_ipmitool.py
@@ -1967,13 +1967,13 @@ class IPMIToolDriverTestCase(Base):
1967 task, 'fake-device') 1967 task, 'fake-device')
1968 1968
1969 @mock.patch.object(ipmi, '_exec_ipmitool', autospec=True) 1969 @mock.patch.object(ipmi, '_exec_ipmitool', autospec=True)
1970 def test_management_interface_set_boot_device_without_timeout(self, 1970 def test_management_interface_set_boot_device_without_timeout_1(self,
1971 mock_exec): 1971 mock_exec):
1972 mock_exec.return_value = [None, None] 1972 mock_exec.return_value = [None, None]
1973 1973
1974 with task_manager.acquire(self.context, self.node.uuid) as task: 1974 with task_manager.acquire(self.context, self.node.uuid) as task:
1975 driver_info = task.node.driver_info 1975 driver_info = task.node.driver_info
1976 driver_info['ipmi_disable_timeout'] = 'False' 1976 driver_info['ipmi_disable_boot_timeout'] = 'False'
1977 task.node.driver_info = driver_info 1977 task.node.driver_info = driver_info
1978 self.management.set_boot_device(task, boot_devices.PXE) 1978 self.management.set_boot_device(task, boot_devices.PXE)
1979 1979
@@ -1981,6 +1981,18 @@ class IPMIToolDriverTestCase(Base):
1981 mock_exec.assert_has_calls(mock_calls) 1981 mock_exec.assert_has_calls(mock_calls)
1982 1982
1983 @mock.patch.object(ipmi, '_exec_ipmitool', autospec=True) 1983 @mock.patch.object(ipmi, '_exec_ipmitool', autospec=True)
1984 def test_management_interface_set_boot_device_without_timeout_2(self,
1985 mock_exec):
1986 CONF.set_override('disable_boot_timeout', False, 'ipmi')
1987 mock_exec.return_value = [None, None]
1988
1989 with task_manager.acquire(self.context, self.node.uuid) as task:
1990 self.management.set_boot_device(task, boot_devices.PXE)
1991
1992 mock_calls = [mock.call(self.info, "chassis bootdev pxe")]
1993 mock_exec.assert_has_calls(mock_calls)
1994
1995 @mock.patch.object(ipmi, '_exec_ipmitool', autospec=True)
1984 def test_management_interface_set_boot_device_exec_failed(self, mock_exec): 1996 def test_management_interface_set_boot_device_exec_failed(self, mock_exec):
1985 mock_exec.side_effect = processutils.ProcessExecutionError() 1997 mock_exec.side_effect = processutils.ProcessExecutionError()
1986 with task_manager.acquire(self.context, self.node.uuid) as task: 1998 with task_manager.acquire(self.context, self.node.uuid) as task:
diff --git a/releasenotes/notes/ipmi-disable-timeout-option-e730362007f9bedd.yaml b/releasenotes/notes/ipmi-disable-timeout-option-e730362007f9bedd.yaml
new file mode 100644
index 0000000..4be19d5
--- /dev/null
+++ b/releasenotes/notes/ipmi-disable-timeout-option-e730362007f9bedd.yaml
@@ -0,0 +1,11 @@
1---
2features:
3 - |
4 Adds a configuration option ``[ipmi]disable_boot_timeout`` which is used
5 to set the default behavior whether ironic should send a raw IPMI command
6 to disable timeout. This configuration option can be overidden by the
7 per-node option ``ipmi_disable_boot_timeout`` in node's ``driver_info``
8 field.
9 See `story 2004266 <https://storyboard.openstack.org/#!/story/2004266>`_
10 and `Story 2002977 <https://storyboard.openstack.org/#!/story/2002977>`_
11 for additional information.
diff --git a/releasenotes/notes/story-2004266-4725d327900850bf.yaml b/releasenotes/notes/story-2004266-4725d327900850bf.yaml
index 41f34de..c8e27e8 100644
--- a/releasenotes/notes/story-2004266-4725d327900850bf.yaml
+++ b/releasenotes/notes/story-2004266-4725d327900850bf.yaml
@@ -6,8 +6,8 @@ fixes:
6 received within 60-second timeout (countdown restarts when a Chassis 6 received within 60-second timeout (countdown restarts when a Chassis
7 Control command is received). Some BMCs do not support setting this; if 7 Control command is received). Some BMCs do not support setting this; if
8 sent it causes the boot to be aborted instead. For IPMI hardware type a 8 sent it causes the boot to be aborted instead. For IPMI hardware type a
9 new driver option ``node['driver_info']['ipmi_disable_timeout']`` can be 9 new driver option ``node['driver_info']['ipmi_disable_boot_timeout']`` can
10 specified. It is ``True`` by default; set it to ``False`` to bypass 10 be specified. It is ``True`` by default; set it to ``False`` to bypass
11 sending this command. See `story 2004266 11 sending this command. See `story 2004266
12 <https://storyboard.openstack.org/#!/story/2004266>`_ for additional 12 <https://storyboard.openstack.org/#!/story/2004266>`_ for additional
13 information. 13 information.