dell / iDRAC-Redfish-Scripting

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

Firmware update completion not recognized - script loop stuck #266

Closed squirrlien closed 9 months ago

squirrlien commented 10 months ago

Set-DeviceFirmwareSimpleUpdateTransferProtocolREDFISH.psm1 Line: 392

Firmware update, specifically Emulex firmware, but it makes no difference anyway.

Rest-API JSON response: "Job completed, server reboot pending In order to apply changes, recover from errors, or complete the operation, a component reset is required with the Reset action URI '/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset' and ResetType 'PowerCycle'."

Web GUI Status message: "Completed, Server Reboot Pending (100%)"

However the loop is stuck on: "- Job ID 'JID_946819174107' not marked scheduled or completed, checking job status again"

I had to add the following to the line 392 to make the module recognize that the Job completed, server reboot pending: -or $overall_job_output.Messages.Message.Contains("Job completed, server reboot pending")

texroemer commented 10 months ago

Hi @squirrlien

Thanks for pointing this out, certain network cards now support applying the firmware immediately but still need a server reboot or a/c cycle once the update job is marked completed, reason you see "Job Completed, server reboot pending" status.

I've updated the cmdlet code, example below running it:

PS C:\> Set-DeviceFirmwareSimpleUpdateTransferProtocolREDFISH -idrac_ip 192.168.0.120 -idrac_username root -idrac_password calvin -protocol_type NFS -uri_path 192.168.0.130:/nfs/BCOM_10G.EXE  -reboot_server y

- PASS, statuscode 202 returned successfully for POST command to create update job ID 'JID_950691921772'

- INFO, script will now loop polling the job status every 5 seconds until marked either scheduled or completed

- Job ID 'JID_950691921772' not marked completed, current status: New
- Job ID 'JID_950691921772' not marked completed, current status: Downloading the Network_rebootless.EXE update package.
- Job ID 'JID_950691921772' not marked completed, current status: Downloading the Network_rebootless.EXE update package.
- Job ID 'JID_950691921772' not marked completed, current status: Downloading the Network_rebootless.EXE update package.
- Job ID 'JID_950691921772' not marked completed, current status: Downloading the Network_rebootless.EXE update package.
- Job ID 'JID_950691921772' not marked completed, current status: Downloading the Network_rebootless.EXE update package.
- Job ID 'JID_950691921772' not marked completed, current status: Downloading the Network_rebootless.EXE update package.
- Job ID 'JID_950691921772' not marked completed, current status: Downloading the Network_rebootless.EXE update package.
- Job ID 'JID_950691921772' not marked completed, current status: Package successfully downloaded.
- Job ID 'JID_950691921772' not marked completed, current status: Job in progress.
- Job ID 'JID_950691921772' not marked completed, current status: Job in progress.
- Job ID 'JID_950691921772' not marked completed, current status: Job in progress.
- Job ID 'JID_950691921772' not marked completed, current status: Job in progress.
- Job ID 'JID_950691921772' not marked completed, current status: Job in progress.
- Job ID 'JID_950691921772' not marked completed, current status: Job in progress.
- Job ID 'JID_950691921772' not marked completed, current status: Job in progress.
- Job ID 'JID_950691921772' not marked completed, current status: Job in progress.
- INFO, job ID JID_950691921772 marked completed but user invention is needed, final job message: Job completed, server reboot pending
- INFO, user selected to reboot the server now for the new firmware to become effective

- PASS, statuscode 200 returned successfully to get current power state
- INFO, Server current power state is ON, performing graceful shutdown
- PASS, statuscode 204 returned to attempt graceful server shutdown
- PASS, validated server in OFF state
- PASS, statuscode 204 returned successfully to power ON the server

PS C:\> 

Thanks Tex