Add idrac-wsman clean steps to not require ramdisk

For BIOS factory_reset updated to use power interface
as direct REBOOT call fails when system is OFF that
can happen if running without ramdisk.

Change-Id: I9baf13e9a089bc692e8010dc7e291d7791d1f73c
This commit is contained in:
Aija Jauntēva 2022-01-20 05:56:55 -05:00
parent c65cbb7aef
commit bfea8f17b0
5 changed files with 17 additions and 8 deletions

View File

@ -71,7 +71,7 @@ class DracWSManBIOS(base.BIOSInterface):
reason=_("Unable to import dracclient.exceptions library"))
@METRICS.timer('DracWSManBIOS.apply_configuration')
@base.clean_step(priority=0, argsinfo=_args_info)
@base.clean_step(priority=0, argsinfo=_args_info, requires_ramdisk=False)
@base.deploy_step(priority=0, argsinfo=_args_info)
def apply_configuration(self, task, settings):
"""Apply the BIOS configuration to the node
@ -352,7 +352,7 @@ class DracWSManBIOS(base.BIOSInterface):
manager_utils.notify_conductor_resume_deploy(task)
@METRICS.timer('DracWSManBIOS.factory_reset')
@base.clean_step(priority=0)
@base.clean_step(priority=0, requires_ramdisk=False)
@base.deploy_step(priority=0)
def factory_reset(self, task):
"""Reset the BIOS settings of the node to the factory default.
@ -418,7 +418,7 @@ class DracWSManBIOS(base.BIOSInterface):
node.timestamp_driver_internal_info('factory_reset_time')
# rebooting the server to apply factory reset value
client.set_power_state('REBOOT')
task.driver.power.reboot(task)
# This method calls node.save(), bios_config_job_id will be
# saved automatically

View File

@ -763,7 +763,7 @@ class DracWSManManagement(base.ManagementInterface):
@METRICS.timer('DracManagement.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.
@ -778,7 +778,7 @@ class DracWSManManagement(base.ManagementInterface):
@METRICS.timer('DracManagement.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 the iDRAC, Clear the job queue.
@ -794,7 +794,7 @@ class DracWSManManagement(base.ManagementInterface):
@METRICS.timer('DracManagement.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 the job queue.

View File

@ -1593,7 +1593,7 @@ class DracWSManRAID(base.RAIDInterface):
),
"required": False,
}
})
}, requires_ramdisk=False)
def create_configuration(self, task,
create_root_volume=True,
create_nonroot_volumes=True,
@ -1690,7 +1690,7 @@ class DracWSManRAID(base.RAIDInterface):
return _create_virtual_disks(task, node)
@METRICS.timer('DracRAID.delete_configuration')
@base.clean_step(priority=0)
@base.clean_step(priority=0, requires_ramdisk=False)
@base.deploy_step(priority=0)
def delete_configuration(self, task):
"""Delete the RAID configuration.

View File

@ -22,6 +22,7 @@ Test class for DRAC BIOS configuration specific methods
from unittest import mock
from dracclient import exceptions as drac_exceptions
from oslo_utils import importutils
from oslo_utils import timeutils
from ironic.common import exception
@ -36,6 +37,8 @@ from ironic import objects
from ironic.tests.unit.drivers.modules.drac import utils as test_utils
from ironic.tests.unit.objects import utils as obj_utils
drac_constants = importutils.try_import('dracclient.constants')
INFO_DICT = test_utils.INFO_DICT
@ -73,6 +76,7 @@ class DracWSManBIOSConfigurationTestCase(test_utils.BaseDracTest):
}
self.mock_client.commit_pending_bios_changes.return_value = \
"JID_5678"
self.mock_client.get_power_state.return_value = drac_constants.POWER_ON
@mock.patch.object(drac_common, 'parse_driver_info',
autospec=True)

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds support for ``idrac-wsman`` RAID, BIOS and management clean steps to
be run without IPA when disabling ramdisk during cleaning.