summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ironic/conf/deploy.py16
-rw-r--r--ironic/drivers/modules/agent_base.py2
-rw-r--r--ironic/tests/unit/drivers/modules/test_agent.py12
-rw-r--r--ironic/tests/unit/drivers/modules/test_iscsi_deploy.py4
-rw-r--r--releasenotes/notes/add-clean-steps-priority-88d7de5973500a7d.yaml4
5 files changed, 35 insertions, 3 deletions
diff --git a/ironic/conf/deploy.py b/ironic/conf/deploy.py
index adc6f52a7..49975595c 100644
--- a/ironic/conf/deploy.py
+++ b/ironic/conf/deploy.py
@@ -55,6 +55,22 @@ opts = [
'ramdisk (defaults to 99 for the '
'GenericHardwareManager). If set to 0, will not run '
'during cleaning.')),
+ cfg.IntOpt('delete_configuration_priority',
+ mutable=True,
+ help=_('Priority to run in-band clean step that erases '
+ 'RAID configuration from devices, via the Ironic '
+ 'Python Agent ramdisk. If unset, will use the '
+ 'priority set in the ramdisk (defaults to 0 for the '
+ 'GenericHardwareManager). If set to 0, will not run '
+ 'during cleaning.')),
+ cfg.IntOpt('create_configuration_priority',
+ mutable=True,
+ help=_('Priority to run in-band clean step that creates '
+ 'RAID configuration from devices, via the Ironic '
+ 'Python Agent ramdisk. If unset, will use the '
+ 'priority set in the ramdisk (defaults to 0 for the '
+ 'GenericHardwareManager). If set to 0, will not run '
+ 'during cleaning.')),
cfg.IntOpt('shred_random_overwrite_iterations',
default=1,
min=0,
diff --git a/ironic/drivers/modules/agent_base.py b/ironic/drivers/modules/agent_base.py
index 35ad016f7..da90bb503 100644
--- a/ironic/drivers/modules/agent_base.py
+++ b/ironic/drivers/modules/agent_base.py
@@ -852,6 +852,8 @@ class AgentDeployMixin(HeartbeatMixin, AgentOobStepsMixin):
'erase_devices': CONF.deploy.erase_devices_priority,
'erase_devices_metadata':
CONF.deploy.erase_devices_metadata_priority,
+ 'delete_configuration': CONF.deploy.delete_configuration_priority,
+ 'create_configuration': CONF.deploy.create_configuration_priority
}
return get_steps(
task, 'clean', interface='deploy',
diff --git a/ironic/tests/unit/drivers/modules/test_agent.py b/ironic/tests/unit/drivers/modules/test_agent.py
index 56c971101..8b50b33e4 100644
--- a/ironic/tests/unit/drivers/modules/test_agent.py
+++ b/ironic/tests/unit/drivers/modules/test_agent.py
@@ -1163,15 +1163,21 @@ class TestAgentDeploy(db_base.DbTestCase):
mock_get_steps.assert_called_once_with(
task, 'clean', interface='deploy',
override_priorities={'erase_devices': None,
- 'erase_devices_metadata': None})
+ 'erase_devices_metadata': None,
+ 'delete_configuration': None,
+ 'create_configuration': None})
self.assertEqual(mock_steps, steps)
@mock.patch.object(agent_base, 'get_steps', autospec=True)
def test_get_clean_steps_config_priority(self, mock_get_steps):
# Test that we can override the priority of get clean steps
# Use 0 because it is an edge case (false-y) and used in devstack
+ # for erase_devices, and 42 for RAID cleaning steps as they are
+ # disabled by default.
self.config(erase_devices_priority=0, group='deploy')
self.config(erase_devices_metadata_priority=0, group='deploy')
+ self.config(delete_configuration_priority=42, group='deploy')
+ self.config(create_configuration_priority=42, group='deploy')
mock_steps = [{'priority': 10, 'interface': 'deploy',
'step': 'erase_devices'}]
mock_get_steps.return_value = mock_steps
@@ -1180,7 +1186,9 @@ class TestAgentDeploy(db_base.DbTestCase):
mock_get_steps.assert_called_once_with(
task, 'clean', interface='deploy',
override_priorities={'erase_devices': 0,
- 'erase_devices_metadata': 0})
+ 'erase_devices_metadata': 0,
+ 'delete_configuration': 42,
+ 'create_configuration': 42})
@mock.patch.object(deploy_utils, 'prepare_inband_cleaning', autospec=True)
def test_prepare_cleaning(self, prepare_inband_cleaning_mock):
diff --git a/ironic/tests/unit/drivers/modules/test_iscsi_deploy.py b/ironic/tests/unit/drivers/modules/test_iscsi_deploy.py
index 289e29e49..6ac184b53 100644
--- a/ironic/tests/unit/drivers/modules/test_iscsi_deploy.py
+++ b/ironic/tests/unit/drivers/modules/test_iscsi_deploy.py
@@ -980,7 +980,9 @@ class ISCSIDeployTestCase(db_base.DbTestCase):
task, 'clean', interface='deploy',
override_priorities={
'erase_devices': 10,
- 'erase_devices_metadata': 5})
+ 'erase_devices_metadata': 5,
+ 'delete_configuration': None,
+ 'create_configuration': None})
self.assertEqual(mock_steps, steps)
@mock.patch.object(agent_base, 'execute_step', autospec=True)
diff --git a/releasenotes/notes/add-clean-steps-priority-88d7de5973500a7d.yaml b/releasenotes/notes/add-clean-steps-priority-88d7de5973500a7d.yaml
new file mode 100644
index 000000000..8a01a7d71
--- /dev/null
+++ b/releasenotes/notes/add-clean-steps-priority-88d7de5973500a7d.yaml
@@ -0,0 +1,4 @@
+---
+features:
+ - It is now possible to configure a priority for both the delete and create
+ configuration RAID cleaning steps which are disabled by default. \ No newline at end of file