Adding a new flag --check-disk to be used to check (only on iDRAC 9) if the disk supports secure erase without actually trying to erase it.
Adding exit code as 1 in cases where there is a failure so that this script can be used in simple automations.
Tests
Successful secure erase
- PASS: POST command passed to secure erase device "Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1", status code 202 returned
- PASS, realtime jid "JID_075079596314" successfully created. Server will apply the configuration changes in real time, no server reboot needed
- INFO, job status not completed, current status: "Job in progress"
- INFO, job status not completed, current status: "Job in progress"
- INFO, job status not completed, current status: "Job in progress"
- INFO, job status not completed, current status: "Job in progress"
- INFO, job status not completed, current status: "Job in progress"
- INFO, job status not completed, current status: "Job in progress"
- INFO, job status not completed, current status: "Job in progress"
- INFO, job status not completed, current status: "Job in progress"
--- PASS, Final Detailed Job Status Results ---
('@odata.context', '/redfish/v1/$metadata#DellJob.DellJob')
('@odata.id', '/redfish/v1/Managers/iDRAC.Embedded.1/Oem/Dell/Jobs/JID_075079596314')
('@odata.type', '#DellJob.v1_5_0.DellJob')
('ActualRunningStartTime', '2024-02-09T13:46:00')
('ActualRunningStopTime', '2024-02-09T13:47:21')
('CompletionTime', '2024-02-09T13:47:21')
('Description', 'Job Instance')
('EndTime', 'TIME_NA')
('Id', 'JID_075079596314')
('JobState', 'Completed')
('JobType', 'RealTimeNoRebootConfiguration')
('Message', 'Job completed successfully.')
('MessageArgs', [])
('MessageArgs@odata.count', 0)
('MessageId', 'PR19')
('Name', 'Configure: RAID.Integrated.1-1')
('PercentComplete', 100)
('StartTime', '2024-02-09T13:45:59')
('TargetSettingsURI', None)
Failed secure erase
- FAIL, POST command failed for secure erase, status code is 400
- POST command failure is:
{'error': {'@Message.ExtendedInfo': [{'Message': 'One or more storage device(s) are not in a state where the operation can be completed.', 'MessageArgs': [], 'MessageArgs@odata.count': 0, 'MessageId': 'IDRAC.2.8.STOR013', 'RelatedProperties': [], 'RelatedProperties@odata.count': 0, 'Resolution': 'Make sure the specified storage devices are in a state appropriate for the requested operation and retry the operation.', 'Severity': 'Warning'}], 'code': 'Base.1.12.GeneralError', 'message': 'A general error has occurred. See ExtendedInfo for more information'}}
--check-disk
to be used to check (only on iDRAC 9) if the disk supports secure erase without actually trying to erase it.1
in cases where there is a failure so that this script can be used in simple automations.Tests
Successful secure erase
Failed secure erase
Successful disk checks