summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules
diff options
context:
space:
mode:
authorAija Jauntēva <aija.jaunteva@dell.com>2022-01-20 11:51:47 -0500
committerAija Jauntēva <aija.jaunteva@dell.com>2022-01-21 05:32:23 -0500
commit69e6152ac3824aed6531ca0e820d6c1ba178f1f0 (patch)
tree549e604b32603fb172e7f6f1f4dce67ed2c966e0 /ironic/drivers/modules
parentc65cbb7aef1289b44d2f1ff0c3f0aaa7c31284c0 (diff)
downloadironic-69e6152ac3824aed6531ca0e820d6c1ba178f1f0.tar.gz
Add idrac-redfish clean steps to not require ramdisk
Includes idrac-redfish RAID and management steps. Update helper utility to not prepare agent on reboots if cleaning without it. Change-Id: I3c06e12f82908fba2b2587d0e3bec4b8bbdeba4b
Diffstat (limited to 'ironic/drivers/modules')
-rw-r--r--ironic/drivers/modules/deploy_utils.py5
-rw-r--r--ironic/drivers/modules/drac/management.py15
-rw-r--r--ironic/drivers/modules/drac/raid.py12
3 files changed, 23 insertions, 9 deletions
diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py
index f46250e2a..36e9b6295 100644
--- a/ironic/drivers/modules/deploy_utils.py
+++ b/ironic/drivers/modules/deploy_utils.py
@@ -1422,7 +1422,10 @@ def reboot_to_finish_step(task):
:returns: states.CLEANWAIT if cleaning operation in progress
or states.DEPLOYWAIT if deploy operation in progress.
"""
- prepare_agent_boot(task)
+ disable_ramdisk = task.node.driver_internal_info.get(
+ 'cleaning_disable_ramdisk')
+ if not disable_ramdisk:
+ prepare_agent_boot(task)
manager_utils.node_power_action(task, states.REBOOT)
return get_async_step_return_state(task.node)
diff --git a/ironic/drivers/modules/drac/management.py b/ironic/drivers/modules/drac/management.py
index f18f5e29e..58aa0af2a 100644
--- a/ironic/drivers/modules/drac/management.py
+++ b/ironic/drivers/modules/drac/management.py
@@ -362,7 +362,8 @@ class DracRedfishManagement(redfish_management.RedfishManagement):
**IMPORT_CONFIGURATION_ARGSINFO}
@base.deploy_step(priority=0, argsinfo=EXPORT_CONFIGURATION_ARGSINFO)
- @base.clean_step(priority=0, argsinfo=EXPORT_CONFIGURATION_ARGSINFO)
+ @base.clean_step(priority=0, argsinfo=EXPORT_CONFIGURATION_ARGSINFO,
+ requires_ramdisk=False)
def export_configuration(self, task, export_configuration_location):
"""Export the configuration of the server.
@@ -410,7 +411,8 @@ class DracRedfishManagement(redfish_management.RedfishManagement):
{'node': task.node.uuid}))
@base.deploy_step(priority=0, argsinfo=IMPORT_CONFIGURATION_ARGSINFO)
- @base.clean_step(priority=0, argsinfo=IMPORT_CONFIGURATION_ARGSINFO)
+ @base.clean_step(priority=0, argsinfo=IMPORT_CONFIGURATION_ARGSINFO,
+ requires_ramdisk=False)
def import_configuration(self, task, import_configuration_location):
"""Import and apply the configuration to the server.
@@ -456,7 +458,8 @@ class DracRedfishManagement(redfish_management.RedfishManagement):
return deploy_utils.reboot_to_finish_step(task)
@base.clean_step(priority=0,
- argsinfo=IMPORT_EXPORT_CONFIGURATION_ARGSINFO)
+ argsinfo=IMPORT_EXPORT_CONFIGURATION_ARGSINFO,
+ requires_ramdisk=False)
@base.deploy_step(priority=0,
argsinfo=IMPORT_EXPORT_CONFIGURATION_ARGSINFO)
def import_export_configuration(self, task, import_configuration_location,
@@ -611,7 +614,7 @@ class DracRedfishManagement(redfish_management.RedfishManagement):
@METRICS.timer('DracRedfishManagement.clear_job_queue')
@base.verify_step(priority=0)
- @base.clean_step(priority=0)
+ @base.clean_step(priority=0, requires_ramdisk=False)
def clear_job_queue(self, task):
"""Clear iDRAC job queue.
@@ -625,7 +628,7 @@ class DracRedfishManagement(redfish_management.RedfishManagement):
@METRICS.timer('DracRedfishManagement.reset_idrac')
@base.verify_step(priority=0)
- @base.clean_step(priority=0)
+ @base.clean_step(priority=0, requires_ramdisk=False)
def reset_idrac(self, task):
"""Reset the iDRAC.
@@ -641,7 +644,7 @@ class DracRedfishManagement(redfish_management.RedfishManagement):
@METRICS.timer('DracRedfishManagement.known_good_state')
@base.verify_step(priority=0)
- @base.clean_step(priority=0)
+ @base.clean_step(priority=0, requires_ramdisk=False)
def known_good_state(self, task):
"""Reset iDRAC to known good state.
diff --git a/ironic/drivers/modules/drac/raid.py b/ironic/drivers/modules/drac/raid.py
index d4e633f9c..c2a063ec0 100644
--- a/ironic/drivers/modules/drac/raid.py
+++ b/ironic/drivers/modules/drac/raid.py
@@ -27,6 +27,7 @@ import tenacity
from ironic.common import exception
from ironic.common.i18n import _
from ironic.common import raid as raid_common
+from ironic.common import states
from ironic.conductor import periodics
from ironic.conductor import utils as manager_utils
from ironic.conf import CONF
@@ -1171,6 +1172,13 @@ def _wait_till_realtime_ready(task):
:raises RedfishError: If can't find OEM extension or it fails to
execute
"""
+ # If running without IPA, check that system is ON, if not, turn it on
+ disable_ramdisk = task.node.driver_internal_info.get(
+ 'cleaning_disable_ramdisk')
+ power_state = task.driver.power.get_power_state(task)
+ if disable_ramdisk and power_state == states.POWER_OFF:
+ task.driver.power.set_power_state(task, states.POWER_ON)
+
try:
_retry_till_realtime_ready(task)
except tenacity.RetryError:
@@ -1238,7 +1246,7 @@ class DracRedfishRAID(redfish_raid.RedfishRAID):
),
'required': False,
}
- })
+ }, requires_ramdisk=False)
def create_configuration(self, task, create_root_volume=True,
create_nonroot_volumes=True,
delete_existing=False):
@@ -1267,7 +1275,7 @@ class DracRedfishRAID(redfish_raid.RedfishRAID):
task, create_root_volume, create_nonroot_volumes,
delete_existing)
- @base.clean_step(priority=0)
+ @base.clean_step(priority=0, requires_ramdisk=False)
@base.deploy_step(priority=0)
def delete_configuration(self, task):
"""Delete RAID configuration on the node.