diff options
author | Bob Fournier <bfournie@redhat.com> | 2020-11-09 13:33:49 -0500 |
---|---|---|
committer | Bob Fournier <bfournie@redhat.com> | 2020-11-10 14:57:20 -0500 |
commit | 9b18336f76ca1ff68140e253cafed560784b4500 (patch) | |
tree | 01ad8de3f2ed9dd2b927c78ac4ea3db96b754f74 /ironic/conductor | |
parent | 08bf8dee65acead2b08ca4563a273cd9bb60c5b4 (diff) | |
download | ironic-9b18336f76ca1ff68140e253cafed560784b4500.tar.gz |
Retrieve BIOS configuration when moving node to ``manageable``
When moving the node to ``manageable``, in addition to
``cleaning``, retrieve the BIOS configuration settings. In the
case of ``manageable``, this may allow the settings to be used
when choosing which node to deploy.
Change-Id: Ic2b162f31d4a1465fcb61671e7f48b3d31de788c
Story: 2008326
Task: 41224
Diffstat (limited to 'ironic/conductor')
-rw-r--r-- | ironic/conductor/cleaning.py | 15 | ||||
-rw-r--r-- | ironic/conductor/manager.py | 4 | ||||
-rw-r--r-- | ironic/conductor/utils.py | 16 |
3 files changed, 22 insertions, 13 deletions
diff --git a/ironic/conductor/cleaning.py b/ironic/conductor/cleaning.py index 269d63004..ed684ce6e 100644 --- a/ironic/conductor/cleaning.py +++ b/ironic/conductor/cleaning.py @@ -77,19 +77,8 @@ def do_node_clean(task, clean_steps=None): node.driver_internal_info = info node.save() - # Do caching of bios settings if supported by driver, - # this will be called for both manual and automated cleaning. - try: - task.driver.bios.cache_bios_settings(task) - except exception.UnsupportedDriverExtension: - LOG.warning('BIOS settings are not supported for node %s, ' - 'skipping', task.node.uuid) - # TODO(zshi) remove this check when classic drivers are removed - except Exception: - msg = (_('Caching of bios settings failed on node %(node)s. ' - 'Continuing with node cleaning.') - % {'node': node.uuid}) - LOG.exception(msg) + # Retrieve BIOS config settings for this node + utils.node_cache_bios_settings(task, node) # Allow the deploy driver to set up the ramdisk again (necessary for # IPA cleaning) diff --git a/ironic/conductor/manager.py b/ironic/conductor/manager.py index 7fcccec04..35eee97b1 100644 --- a/ironic/conductor/manager.py +++ b/ironic/conductor/manager.py @@ -1169,6 +1169,9 @@ class ConductorManager(base_manager.BaseConductorManager): LOG.error(error, exc_info=log_traceback) if error is None: + # Retrieve BIOS config settings for this node + utils.node_cache_bios_settings(task, node) + if power_state != node.power_state: old_power_state = node.power_state node.power_state = power_state @@ -1694,6 +1697,7 @@ class ConductorManager(base_manager.BaseConductorManager): # is called as part of the transition from ENROLL to MANAGEABLE # states. As such it is redundant to call here. self._do_takeover(task) + LOG.info("Successfully adopted node %(node)s", {'node': node.uuid}) task.process_event('done') diff --git a/ironic/conductor/utils.py b/ironic/conductor/utils.py index 5830011fa..209092c1b 100644 --- a/ironic/conductor/utils.py +++ b/ironic/conductor/utils.py @@ -1313,3 +1313,19 @@ def store_agent_certificate(node, agent_verify_ca): LOG.debug('Saved the custom certificate for node %(node)s to %(file)s', {'node': node.uuid, 'file': fname}) return fname + + +def node_cache_bios_settings(task, node): + """Do caching of bios settings if supported by driver""" + try: + LOG.debug('BF getting BIOS info for node %s', + node.uuid) + task.driver.bios.cache_bios_settings(task) + except exception.UnsupportedDriverExtension: + LOG.warning('BIOS settings are not supported for node %s, ' + 'skipping', node.uuid) + # TODO(zshi) remove this check when classic drivers are removed + except Exception: + msg = (_('Caching of bios settings failed on node %(node)s.') + % {'node': node.uuid}) + LOG.exception(msg) |