Skip to content

Commit 2c5ad3f

Browse files
rajshekarp87sachin-apaShivamSh3
authored
[idrac_system_erase] - Erase of system and storage components (#729)
* Initial code of system component erase * Addressed doc review comments --------- Co-authored-by: Sachin Apagundi <62133262+sachin-apa@users.noreply.github.com> Co-authored-by: Shivam Sharma <Shivam.sharma3@dell.com>
1 parent abe319f commit 2c5ad3f

9 files changed

+1346
-10
lines changed

docs/README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,23 @@ You may obtain a copy of the License at
2424
| [idrac_diagnostics](modules/idrac_diagnostics.rst) |||
2525
| [idrac_firmware](modules/idrac_firmware.rst) |||
2626
| [idrac_firmware_info](modules/idrac_firmware_info.rst) |||
27-
| [idrac_lifecycle_controller_jobs](modules/idrac_lifecycle_controller_jobs.rst) | ||
27+
| [idrac_license](modules/idrac_license.rst) | ||
2828
| [idrac_lifecycle_controller_job_status_info](modules/idrac_lifecycle_controller_job_status_info.rst) |||
29+
| [idrac_lifecycle_controller_jobs](modules/idrac_lifecycle_controller_jobs.rst) |||
2930
| [idrac_lifecycle_controller_logs](modules/idrac_lifecycle_controller_logs.rst) |||
3031
| [idrac_lifecycle_controller_status_info](modules/idrac_lifecycle_controller_status_info.rst) |||
31-
| [idrac_network_attributes](modules/idrac_network_attributes.rst) |||
3232
| [idrac_network](modules/idrac_network.rst) |||
33+
| [idrac_network_attributes](modules/idrac_network_attributes.rst) |||
3334
| [idrac_os_deployment](modules/idrac_os_deployment.rst) |||
3435
| [idrac_redfish_storage_controller](modules/idrac_redfish_storage_controller.rst) |||
3536
| [idrac_reset](modules/idrac_reset.rst) |||
37+
| [idrac_secure_boot](modules/idrac_secure_boot.rst) |||
3638
| [idrac_server_config_profile](modules/idrac_server_config_profile.rst) |||
3739
| [idrac_session](modules/idrac_session.rst) |||
3840
| [idrac_storage_volume](modules/idrac_storage_volume.rst) |||
41+
| [idrac_support_assist](modules/idrac_support_assists.rst) |||
3942
| [idrac_syslog](modules/idrac_syslog.rst) |||
43+
| [idrac_system_erase](modules/idrac_system_erase.rst) |||
4044
| [idrac_system_info](modules/idrac_system_info.rst) |||
4145
| [idrac_timezone_ntp](modules/idrac_timezone_ntp.rst) |||
4246
| [idrac_user](modules/idrac_user.rst) |||

docs/modules/idrac_diagnostics.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ Parameters
150150
ignore_certificate_warning (optional, str, off)
151151
Ignores the certificate warning while connecting to Share and is only applicable when \ :emphasis:`share\_type`\ is \ :literal:`https`\ .
152152

153-
\ :literal:`off`\ ignores the certificate warning.
153+
\ :literal:`on`\ ignores the certificate warning.
154154

155-
\ :literal:`on`\ does not ignore the certificate warning.
155+
\ :literal:`off`\ does not ignore the certificate warning.
156156

157157

158158
proxy_support (optional, str, off)

docs/modules/idrac_license.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ Parameters
116116
ignore_certificate_warning (optional, str, off)
117117
Ignores the certificate warning while connecting to Share and is only applicable when \ :emphasis:`share\_type`\ is \ :literal:`https`\ .
118118

119-
\ :literal:`off`\ ignores the certificate warning.
119+
\ :literal:`on`\ ignores the certificate warning.
120120

121-
\ :literal:`on`\ does not ignore the certificate warning.
121+
\ :literal:`off`\ does not ignore the certificate warning.
122122

123123

124124
proxy_support (optional, str, off)

docs/modules/idrac_system_erase.rst

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
.. _idrac_system_erase_module:
2+
3+
4+
idrac_system_erase -- Erase system and storage components of the server
5+
=======================================================================
6+
7+
.. contents::
8+
:local:
9+
:depth: 1
10+
11+
12+
Synopsis
13+
--------
14+
15+
This module allows you to erase system components such as iDRAC, BIOS, DIAG, and so forth. You can also erase storage components such as PERC NV cache, non-volatile memory, cryptographic erase of physical disks, and so on of the server
16+
17+
18+
19+
Requirements
20+
------------
21+
The below requirements are needed on the host that executes this module.
22+
23+
- python \>= 3.9.6
24+
25+
26+
27+
Parameters
28+
----------
29+
30+
component (True, list, None)
31+
List of system and storage components that can be deleted.
32+
33+
The following are the supported components. AllApps BIOS CryptographicErasePD DIAG DPU DrvPack IDRAC LCData NonVolatileMemory OverwritePD PERCNVCache ReinstallFW vFlash
34+
35+
36+
power_on (optional, bool, False)
37+
This parameter allows you to power on the server after the erase operation is completed. This is applicable when :emphasis:`job\_wait` is :literal:`true`.
38+
39+
:literal:`true` power on the server.
40+
41+
:literal:`false` does not power on the server.
42+
43+
44+
job_wait (optional, bool, True)
45+
Whether to wait till completion of the job. This is applicable when :emphasis:`power\_on` is :literal:`true`.
46+
47+
:literal:`true` waits for job completion.
48+
49+
:literal:`false` does not wait for job completion.
50+
51+
52+
job_wait_timeout (optional, int, 1200)
53+
The maximum wait time of :emphasis:`job\_wait` in seconds. The job is tracked only for this duration.
54+
55+
This option is applicable when :emphasis:`job\_wait` is :literal:`true`.
56+
57+
58+
resource_id (optional, str, None)
59+
Manager ID of the iDRAC.
60+
61+
62+
idrac_ip (True, str, None)
63+
iDRAC IP Address.
64+
65+
66+
idrac_user (False, str, None)
67+
iDRAC username.
68+
69+
If the username is not provided, then the environment variable :envvar:`IDRAC\_USERNAME` is used.
70+
71+
Example: export IDRAC\_USERNAME=username
72+
73+
74+
idrac_password (False, str, None)
75+
iDRAC user password.
76+
77+
If the password is not provided, then the environment variable :envvar:`IDRAC\_PASSWORD` is used.
78+
79+
Example: export IDRAC\_PASSWORD=password
80+
81+
82+
x_auth_token (False, str, None)
83+
Authentication token.
84+
85+
If the x\_auth\_token is not provided, then the environment variable :envvar:`IDRAC\_X\_AUTH\_TOKEN` is used.
86+
87+
Example: export IDRAC\_X\_AUTH\_TOKEN=x\_auth\_token
88+
89+
90+
idrac_port (optional, int, 443)
91+
iDRAC port.
92+
93+
94+
validate_certs (optional, bool, True)
95+
If :literal:`false`\ , the SSL certificates will not be validated.
96+
97+
Configure :literal:`false` only on personally controlled sites where self-signed certificates are used.
98+
99+
Prior to collection version :literal:`5.0.0`\ , the :emphasis:`validate\_certs` is :literal:`false` by default.
100+
101+
102+
ca_path (optional, path, None)
103+
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.
104+
105+
106+
timeout (optional, int, 30)
107+
The socket level timeout in seconds.
108+
109+
110+
111+
112+
113+
Notes
114+
-----
115+
116+
.. note::
117+
- Run this module from a system that has direct access to Dell iDRAC.
118+
- This module supports only iDRAC9 and above.
119+
- This module supports IPv4 and IPv6 addresses.
120+
121+
122+
123+
124+
Examples
125+
--------
126+
127+
.. code-block:: yaml+jinja
128+
129+
130+
---
131+
- name: Erase a single component and power on the server
132+
dellemc.openmanage.idrac_system_erase:
133+
idrac_ip: 198.162.0.1
134+
idrac_user: username
135+
idrac_password: passw0rd
136+
ca_path: "/path/to/ca_cert.pem"
137+
component: ["BIOS"]
138+
power_on: true
139+
140+
- name: Erase multiple components and do not power on the server after the erase operation is completed
141+
dellemc.openmanage.idrac_system_erase:
142+
idrac_ip: 198.162.0.1
143+
idrac_user: username
144+
idrac_password: passw0rd
145+
ca_path: "/path/to/ca_cert.pem"
146+
component: ["BIOS", "DIAG", "PERCNVCache"]
147+
148+
- name: Erase multiple components and do not wait for the job completion
149+
dellemc.openmanage.idrac_system_erase:
150+
idrac_ip: 198.162.0.1
151+
idrac_user: username
152+
idrac_password: passw0rd
153+
ca_path: "/path/to/ca_cert.pem"
154+
component: ["IDRAC", "DPU", "LCData"]
155+
job_wait: false
156+
157+
158+
159+
Return Values
160+
-------------
161+
162+
msg (always, str, Successfully completed the system erase operation.)
163+
Status of the component system erase operation.
164+
165+
166+
job_details (For system erase operation, dict, {'ActualRunningStartTime': None, 'ActualRunningStopTime': None, 'CompletionTime': '2024-08-06T19:55:01', 'Description': 'Job Instance', 'EndTime': 'TIME_NA', 'Id': 'JID_229917427823', 'JobState': 'Completed', 'JobType': 'SystemErase', 'Message': 'Job completed successfully.', 'MessageArgs': [], 'MessageArgs@odata.count': 0, 'MessageId': 'SYS018', 'Name': 'System_Erase', 'PercentComplete': 100, 'StartTime': '2024-08-06T19:49:02', 'TargetSettingsURI': None})
167+
Returns the output for status of the job.
168+
169+
170+
error_info (On HTTP error, dict, {'error': {'@Message.ExtendedInfo': [{'Message': 'Unable to complete the operation because the value NonVolatileMemor entered for the property Component is not in the list of acceptable values.', 'MessageArgs': ['NonVolatileMemor', 'Component'], 'MessageArgs@odata.count': 2, 'MessageId': 'IDRAC.2.9.SYS426', 'RelatedProperties': [], 'RelatedProperties@odata.count': 0, 'Resolution': "Enter a valid value from the enumeration list that Redfish service supports and retry the operation.For information about valid values, see the iDRAC User's Guide available on the support site.", 'Severity': 'Warning'}, {'Message': "The value 'NonVolatileMemor' for the property Component is not in the list of acceptable values.", 'MessageArgs': ['NonVolatileMemor', 'Component'], 'MessageArgs@odata.count': 2, 'MessageId': 'Base.1.12.PropertyValueNotInList', 'RelatedProperties': [], 'RelatedProperties@odata.count': 0, 'Resolution': 'Choose a value from the enumeration list that the implementation can support and resubmit the request if the operation failed.', 'Severity': 'Warning'}], 'code': 'Base.1.12.GeneralError', 'message': 'A general error has occurred. See ExtendedInfo for more information'}})
171+
Details of the HTTP Error.
172+
173+
174+
175+
176+
177+
Status
178+
------
179+
180+
181+
182+
183+
184+
Authors
185+
~~~~~~~
186+
187+
- Rajshekar P(@rajshekarp87)
188+

plugins/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Here are the list of modules and module_utils supported by Dell.
4747
├── idrac_storage_volume.py
4848
├── idrac_support_assist.py
4949
├── idrac_syslog.py
50+
├── idrac_system_erase.py
5051
├── idrac_system_info.py
5152
├── idrac_timezone_ntp.py
5253
├── idrac_user.py

plugins/modules/idrac_diagnostics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@
130130
ignore_certificate_warning:
131131
description:
132132
- Ignores the certificate warning while connecting to Share and is only applicable when I(share_type) is C(https).
133-
- C(off) ignores the certificate warning.
134-
- C(on) does not ignore the certificate warning.
133+
- C(on) ignores the certificate warning.
134+
- C(off) does not ignore the certificate warning.
135135
type: str
136136
choices: ["off", "on"]
137137
default: "off"

plugins/modules/idrac_license.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
ignore_certificate_warning:
103103
description:
104104
- Ignores the certificate warning while connecting to Share and is only applicable when I(share_type) is C(https).
105-
- C(off) ignores the certificate warning.
106-
- C(on) does not ignore the certificate warning.
105+
- C(on) ignores the certificate warning.
106+
- C(off) does not ignore the certificate warning.
107107
type: str
108108
choices: ["off", "on"]
109109
default: "off"

0 commit comments

Comments
 (0)