diff options
author | Zuul <zuul@review.opendev.org> | 2020-09-06 11:21:35 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-09-06 11:21:35 +0000 |
commit | c2db0bbac30eb676a652abbb38fda72a6a43a71a (patch) | |
tree | 295d2835799546f5bcaba3eac47650395f83b7fb /ironic/drivers/modules/ilo | |
parent | edb1baa2dbc4a8e61cbb3c99b88bc98c3defa33c (diff) | |
parent | 9fb4074bfef7b6e4ead7d3cedf7120668966eaa1 (diff) | |
download | ironic-c2db0bbac30eb676a652abbb38fda72a6a43a71a.tar.gz |
Merge "OOB one button secure erase for iLO5 based HPE Proliant servers."
Diffstat (limited to 'ironic/drivers/modules/ilo')
-rw-r--r-- | ironic/drivers/modules/ilo/management.py | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/ironic/drivers/modules/ilo/management.py b/ironic/drivers/modules/ilo/management.py index 75b5934ea..7c96f355b 100644 --- a/ironic/drivers/modules/ilo/management.py +++ b/ironic/drivers/modules/ilo/management.py @@ -792,9 +792,6 @@ class Ilo5Management(IloManagement): task.node.save() def _set_clean_failed(self, task, msg): - LOG.error("Out-of-band sanitize disk erase job failed for node " - "%(node)s. Message: '%(message)s'.", - {'node': task.node.uuid, 'message': msg}) task.node.last_error = msg task.process_event('fail') @@ -927,9 +924,43 @@ class Ilo5Management(IloManagement): LOG.info("No drive found to perform out-of-band sanitize " "disk erase for node %(node)s", {'node': node.uuid}) except ilo_error.IloError as ilo_exception: + LOG.error("Out-of-band sanitize disk erase job failed for node " + "%(node)s. Message: '%(message)s'.", + {'node': task.node.uuid, 'message': ilo_exception}) self._pop_driver_internal_values(task, 'ilo_disk_erase_hdd_check', 'ilo_disk_erase_ssd_check', 'cleaning_reboot', 'skip_current_clean_step') self._set_clean_failed(task, ilo_exception) + + @base.clean_step(priority=0, abortable=False) + def one_button_secure_erase(self, task): + """Erase the whole system securely. + + The One-button secure erase process resets iLO and deletes all licenses + stored there, resets BIOS settings, and deletes all Active Health + System (AHS) and warranty data stored on the system. It also erases + supported non-volatile storage data and deletes any deployment settings + profiles. + + :param task: a TaskManager instance. + :raises: IloError on an error from iLO. + """ + node = task.node + LOG.info("Calling one button secure erase for node %(node)s", + {'node': node.uuid}) + try: + ilo_object = ilo_common.get_ilo_object(node) + ilo_object.do_one_button_secure_erase() + manager_utils.node_power_action(task, states.REBOOT) + node.maintenance = True + node.maintenance_reason = ( + "Running one button secure erase clean step.") + node.save() + return states.CLEANWAIT + except ilo_error.IloError as ilo_exception: + LOG.error("One button secure erase job failed for node " + "%(node)s. Message: '%(message)s'.", + {'node': task.node.uuid, 'message': ilo_exception}) + self._set_clean_failed(task, ilo_exception) |