summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAija Jauntēva <aija.jaunteva@dell.com>2021-11-03 10:39:32 -0400
committerAija Jauntēva <aija.jaunteva@dell.com>2021-11-08 16:22:07 +0000
commitf360d0db32430c76dda15bccdca31e57ede7e199 (patch)
tree097b6b5b7f4ac547df072cd1a64bb3dec3a91bfb
parent66f4e123f2135a83441b2410fcf4f965981d936b (diff)
downloadironic-f360d0db32430c76dda15bccdca31e57ede7e199.tar.gz
Fix idrac-wsman deploy with existing non-BIOS jobs
As with WS-Man iDRAC API setting boot device requires creating BIOS job and there can be only 1 open job per subsystem present in iDRAC, there is validation to check that the job queue is empty before continuing setting boot device. This does not work well for cases when using autoupdatescheduler that creates `Repository Update` job that stays Scheduled until executed and then followed by new Scheduled `Repository Update` job. This patch allows non-BIOS jobs to be present in the queue when setting boot device. This will still fail for cases when there are BIOS jobs present. In such cases should consider moving to idrac-redfish that does not create BIOS or any other job to set boot device. Story: 2009251 Task: 43437 Change-Id: I91e9ba3024a85897aeead21cede57464294b409b (cherry picked from commit b1d08ae80542b6b3aa9fab99cdc64b449d113115)
-rw-r--r--ironic/drivers/modules/drac/management.py2
-rw-r--r--ironic/tests/unit/drivers/modules/drac/test_management.py9
-rw-r--r--releasenotes/notes/fix-idrac-wsman-deploy-with-existing-non-bios-jobs-78aa2195d0c3016f.yaml12
3 files changed, 19 insertions, 4 deletions
diff --git a/ironic/drivers/modules/drac/management.py b/ironic/drivers/modules/drac/management.py
index ce864b79c..a1435d168 100644
--- a/ironic/drivers/modules/drac/management.py
+++ b/ironic/drivers/modules/drac/management.py
@@ -207,7 +207,7 @@ def set_boot_device(node, device, persistent=False):
client.delete_jobs(job_ids=[job.id for job in unfinished_jobs])
if validate_job_queue:
- drac_job.validate_job_queue(node)
+ drac_job.validate_job_queue(node, name_prefix="Configure: BIOS")
try:
drac_boot_devices = client.list_boot_devices()
diff --git a/ironic/tests/unit/drivers/modules/drac/test_management.py b/ironic/tests/unit/drivers/modules/drac/test_management.py
index 4d9c791c2..941272a19 100644
--- a/ironic/tests/unit/drivers/modules/drac/test_management.py
+++ b/ironic/tests/unit/drivers/modules/drac/test_management.py
@@ -277,7 +277,8 @@ class DracManagementInternalMethodsTestCase(test_utils.BaseDracTest):
self.assertEqual(0, mock_list_unfinished_jobs.call_count)
self.assertEqual(0, mock_client.delete_jobs.call_count)
- mock_validate_job_queue.assert_called_once_with(self.node)
+ mock_validate_job_queue.assert_called_once_with(
+ self.node, name_prefix="Configure: BIOS")
mock_client.change_boot_device_order.assert_called_once_with(
'OneTime', 'BIOS.Setup.1-1#BootSeq#NIC.Embedded.1-1-1')
self.assertEqual(0, mock_client.set_bios_settings.call_count)
@@ -541,7 +542,8 @@ class DracManagementInternalMethodsTestCase(test_utils.BaseDracTest):
self.assertEqual(0, mock_list_unfinished_jobs.call_count)
self.assertEqual(0, mock_client.delete_jobs.call_count)
- mock_validate_job_queue.assert_called_once_with(self.node)
+ mock_validate_job_queue.assert_called_once_with(
+ self.node, name_prefix="Configure: BIOS")
@mock.patch.object(drac_job, 'validate_job_queue', spec_set=True,
autospec=True)
@@ -592,7 +594,8 @@ class DracManagementInternalMethodsTestCase(test_utils.BaseDracTest):
self.assertEqual(0, mock_list_unfinished_jobs.call_count)
self.assertEqual(0, mock_client.delete_jobs.call_count)
- mock_validate_job_queue.assert_called_once_with(self.node)
+ mock_validate_job_queue.assert_called_once_with(
+ self.node, name_prefix="Configure: BIOS")
@mock.patch.object(drac_mgmt, '_get_next_persistent_boot_mode',
spec_set=True, autospec=True)
diff --git a/releasenotes/notes/fix-idrac-wsman-deploy-with-existing-non-bios-jobs-78aa2195d0c3016f.yaml b/releasenotes/notes/fix-idrac-wsman-deploy-with-existing-non-bios-jobs-78aa2195d0c3016f.yaml
new file mode 100644
index 000000000..b9382d3b9
--- /dev/null
+++ b/releasenotes/notes/fix-idrac-wsman-deploy-with-existing-non-bios-jobs-78aa2195d0c3016f.yaml
@@ -0,0 +1,12 @@
+---
+fixes:
+ - |
+ Fixes ``idrac-wsman`` management interface ``set_boot_device`` method that
+ would fail deployment when there are existing jobs present with error
+ "Failed to change power state to ''power on'' by ''rebooting''. Error: DRAC
+ operation failed. Reason: Unfinished config jobs found: <list of existing
+ jobs>. Make sure they are completed before retrying.". Now there can be
+ non-BIOS jobs present during deployment. This will still fail for cases
+ when there are BIOS jobs present. In such cases should consider moving to
+ ``idrac-redfish`` that does not have this limitation when setting boot
+ device. \ No newline at end of file