diff --git a/ironic/drivers/modules/irmc/raid.py b/ironic/drivers/modules/irmc/raid.py index 25a856e8ca..8f1bd172af 100644 --- a/ironic/drivers/modules/irmc/raid.py +++ b/ironic/drivers/modules/irmc/raid.py @@ -27,6 +27,7 @@ from ironic.conductor import task_manager from ironic.conductor import utils as manager_utils from ironic import conf from ironic.drivers import base +from ironic.drivers.modules import deploy_utils from ironic.drivers.modules.irmc import common as irmc_common client = importutils.try_import('scciclient.irmc') @@ -206,6 +207,12 @@ def _commit_raid_config(task): LOG.info('RAID config is created successfully on node %s', node_uuid) + deploy_utils.set_async_step_flags( + task.node, + reboot=True, + skip_current_step=True, + polling=True) + return states.CLEANWAIT diff --git a/ironic/tests/unit/drivers/modules/irmc/test_raid.py b/ironic/tests/unit/drivers/modules/irmc/test_raid.py index d95f09d16c..c331b4d5cd 100644 --- a/ironic/tests/unit/drivers/modules/irmc/test_raid.py +++ b/ironic/tests/unit/drivers/modules/irmc/test_raid.py @@ -20,6 +20,7 @@ from unittest import mock from ironic.common import exception from ironic.conductor import task_manager +from ironic.drivers.modules import deploy_utils from ironic.drivers.modules.irmc import raid from ironic.tests.unit.drivers.modules.irmc import test_common @@ -604,8 +605,10 @@ class IRMCRaidConfigurationInternalMethodsTestCase(test_common.BaseIRMCTest): @mock.patch('ironic.common.raid.update_raid_info', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid.client.elcm.' 'get_raid_adapter', autospec=True) + @mock.patch.object(deploy_utils, 'set_async_step_flags', autospec=True) def test__commit_raid_config_with_logical_drives( - self, get_raid_adapter_mock, update_raid_info_mock): + self, set_async_step_flags_mock, + get_raid_adapter_mock, update_raid_info_mock): get_raid_adapter_mock.return_value = { "Server": { "HWConfigurationIrmc": { @@ -698,6 +701,8 @@ class IRMCRaidConfigurationInternalMethodsTestCase(test_common.BaseIRMCTest): task.node.driver_info) update_raid_info_mock.assert_called_once_with( task.node, task.node.raid_config) + set_async_step_flags_mock.assert_called_once_with( + task.node, reboot=True, skip_current_step=True, polling=True) self.assertEqual(task.node.raid_config['logical_disks'], expected_raid_config) diff --git a/releasenotes/notes/irmc-set-polling-after-raid-build-5f78ee3e93a92553.yaml b/releasenotes/notes/irmc-set-polling-after-raid-build-5f78ee3e93a92553.yaml new file mode 100644 index 0000000000..8c28df8881 --- /dev/null +++ b/releasenotes/notes/irmc-set-polling-after-raid-build-5f78ee3e93a92553.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + When configuring RAID on iRMC machines through ironic, + polling is not set when RAID is created. + After creating the RAID, set up polling will notify ironic to + wait for the RAID configuration to complete before + proceeding to the next step instead of check IPA.