From 1dda97c783653aef638113cb1faa250836ed99e1 Mon Sep 17 00:00:00 2001 From: Jacob Anders Date: Tue, 21 Jun 2022 13:18:12 +1000 Subject: Prevent clear_job_queue and reset_idrac failures on older iDRACs Currently, clear_job_queue and reset_idrac steps are only supported on idrac-redfish driver on iDRAC9 hardware. However, Ironic still attempts to run these steps on iDRAC8 BMCs configured with idrac-redfish driver which results in verification failures. This change attempts to resolve it by catching the related exception, logging a warning and continuing verification. In case of cleaning, it still fails. Story: 2010091 Task: 45630 Change-Id: Icd8c5378469887962ff32eea2f38697c539f7e95 --- ironic/drivers/modules/drac/management.py | 42 +++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 8 deletions(-) (limited to 'ironic/drivers/modules') diff --git a/ironic/drivers/modules/drac/management.py b/ironic/drivers/modules/drac/management.py index df6942611..ca250ae27 100644 --- a/ironic/drivers/modules/drac/management.py +++ b/ironic/drivers/modules/drac/management.py @@ -33,6 +33,7 @@ from ironic.common import boot_devices from ironic.common import exception from ironic.common.i18n import _ from ironic.common import molds +from ironic.common import states from ironic.conductor import periodics from ironic.conductor import task_manager from ironic.conductor import utils as manager_utils @@ -623,9 +624,22 @@ class DracRedfishManagement(redfish_management.RedfishManagement): on. :raises: RedfishError on an error. """ - drac_utils.execute_oem_manager_method( - task, 'clear job queue', - lambda m: m.job_service.delete_jobs(job_ids=['JID_CLEARALL'])) + try: + drac_utils.execute_oem_manager_method( + task, 'clear job queue', + lambda m: m.job_service.delete_jobs(job_ids=['JID_CLEARALL'])) + except exception.RedfishError as exc: + if "Oem/Dell/DellJobService is missing" in str(exc): + LOG.warning('iDRAC on node %(node)s does not support ' + 'clearing Lifecycle Controller job queue ' + 'using the idrac-redfish driver. ' + 'If using iDRAC9, consider upgrading firmware. ' + 'If using iDRAC8, consider switching to ' + 'idrac-wsman for management interface if ' + 'possible.', + {'node': task.node.uuid}) + if task.node.provision_state != states.VERIFYING: + raise @METRICS.timer('DracRedfishManagement.reset_idrac') @base.verify_step(priority=0) @@ -637,11 +651,23 @@ class DracRedfishManagement(redfish_management.RedfishManagement): on. :raises: RedfishError on an error. """ - drac_utils.execute_oem_manager_method( - task, 'reset iDRAC', lambda m: m.reset_idrac()) - redfish_utils.wait_until_get_system_ready(task.node) - LOG.info('Reset iDRAC for node %(node)s done', - {'node': task.node.uuid}) + try: + drac_utils.execute_oem_manager_method( + task, 'reset iDRAC', lambda m: m.reset_idrac()) + redfish_utils.wait_until_get_system_ready(task.node) + LOG.info('Reset iDRAC for node %(node)s done', + {'node': task.node.uuid}) + except exception.RedfishError as exc: + if "Oem/Dell/DelliDRACCardService is missing" in str(exc): + LOG.warning('iDRAC on node %(node)s does not support ' + 'iDRAC reset using the idrac-redfish driver. ' + 'If using iDRAC9, consider upgrading firmware. ' + 'If using iDRAC8, consider switching to ' + 'idrac-wsman for management interface if ' + 'possible.', + {'node': task.node.uuid}) + if task.node.provision_state != states.VERIFYING: + raise @METRICS.timer('DracRedfishManagement.known_good_state') @base.verify_step(priority=0) -- cgit v1.2.1