dell / iDRAC-Redfish-Scripting

Python and PowerShell scripting for Dell EMC PowerEdge iDRAC REST API with DMTF Redfish
GNU General Public License v2.0
609 stars 279 forks source link

Set-MultipleBIOSAttributesREDFISH: Pending BIOS Values are not applied #176

Closed oliverwolfat closed 3 years ago

oliverwolfat commented 3 years ago

Powershell-Module: Set-MultipleBIOSAttributesREDFISH

Script-Snippet:

# Set Workload Profile to VirtualizationMaximumPerformance and enable SecureBoot
$BIOS_settings="SecureBoot:Enabled|SysProfile:PerfOptimized|WorkloadProfile:VtOptimizedProfile"
Set-Content "$configPath\multiple_bios_attributes.txt" $BIOS_settings
Set-MultipleBIOSAttributesREDFISH -idrac_ip $server.iDRAC_DhcpIP -idrac_password $server.iDRAC_DefaultPW -idrac_username root -file_path $configPath
Set-PowerControlREDFISH -idrac_ip $server.iDRAC_DhcpIP -idrac_username root -idrac_password $server.iDRAC_DefaultPW -power_request_value GracefulShutdown
# Waiting for Powerstate Off
Set-PowerControlREDFISH -idrac_ip $server.iDRAC_DhcpIP -idrac_username root -idrac_password $server.iDRAC_DefaultPW -power_request_value On

Expected Result:

Values should be set according to the content of multiple_bios_attributes.txt

Actual Result:

Values are marked as Pending in the GUI

texroemer commented 3 years ago

Hi @lupuscon

I fixed the cmdlet issue and have made multiple updates (see below)

  1. No longer need to use a file to pass in attribute names/values. These are now passed in as arguments.
  2. Added support for reboot server now or not reboot but the job is still scheduled.
  3. Updated PATCH support for setting BIOS attributes which now leverages DMTF, not OEM
  4. Get individual BIOS attribute
  5. Get BIOS attribute registry

Example of running updated cmdlet.

PS C:\> Set-MultipleBIOSAttributesREDFISH -idrac_ip 192.168.0.120 -idrac_username root -idrac_password calvin -attribute_names "MemTest,EmbSata,PxeDev2EnDis,PxeDev3EnDis,PxeDev4EnDis" -attribute_values "Enabled,RaidMode,Disabled,Disabled,Disabled" -reboot_server y

- INFO, cmdlet will set BIOS attributes:

Name                           Value
----                           -----
MemTest                        Enabled
EmbSata                        RaidMode
PxeDev3EnDis                   Disabled
PxeDev4EnDis                   Disabled
PxeDev2EnDis                   Disabled

- PASS, PATCH command passed to set attribute pending values and create job ID
- PASS, JID_238889922045 job ID successfully marked as scheduled
- INFO, server power state ON, performing graceful shutdown
- PASS, statuscode 204 returned to gracefully shutdown the server
- PASS, verified server is in OFF state
- PASS, statuscode 204 returned successfully to power ON the server

- WARNING, cmdlet will now poll job ID every 30 seconds until marked completed

- INFO, current job status is: Task successfully scheduled.
- INFO, current job status is: Task successfully scheduled.
- INFO, current job status is: Task successfully scheduled.
- INFO, current job status is: Task successfully scheduled.
- INFO, current job status is: Job in progress.
- INFO, current job status is: Job in progress.
- INFO, current job status is: Job in progress.
- INFO, current job status is: Job in progress.
- INFO, current job status is: Job in progress.
- INFO, current job status is: Job completed successfully.

- PASS, JID_238889922045 job ID marked as completed!
  Job completed in @{Minutes=5; Seconds=17}
oliverwolfat commented 3 years ago

Hi @texroemer Excellent work! I was able to verify this with my script. Thank you very much.