dell / iDRAC-Redfish-Scripting

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

iDRAC 8 response issue #230

Closed AciDCooL closed 1 year ago

AciDCooL commented 1 year ago

Hi,

Since upgrading our iDRAC firmwares on R730's to the latest 2.83.83.83 all of the Powershell scripts stopped working. PS version 5.1 and 7.2 I tried manually:

$uri = "https://******/redfish/v1/Systems/System.Embedded.1/Bios"
Invoke-WebRequest -SkipCertificateCheck -SkipHeaderValidation -Uri $uri -Credential $credential -Method Get -UseBasicParsing -ErrorVariable RespErr -Headers @{"Accept"="application/json"}

Invoke-WebRequest: The response ended prematurely.

Only When removing accessing the url "https://******/redfish/v1/" I get this content. But I cant access any of them.


@odata.context            : /redfish/v1/$metadata#ServiceRoot.ServiceRoot
@odata.id                 : /redfish/v1
@odata.type               : #ServiceRoot.v1_3_0.ServiceRoot
AccountService            : @{@odata.id=/redfish/v1/Managers/iDRAC.Embedded.1/AccountService}
Chassis                   : @{@odata.id=/redfish/v1/Chassis}
Description               : Root Service
EventService              : @{@odata.id=/redfish/v1/EventService}
Fabrics                   : @{@odata.id=/redfish/v1/Fabrics}
Id                        : RootService
JsonSchemas               : @{@odata.id=/redfish/v1/JSONSchemas}
Links                     : @{Sessions=}
Managers                  : @{@odata.id=/redfish/v1/Managers}
Name                      : Root Service
Oem                       : @{Dell=}
Product                   : Integrated Dell Remote Access Controller
ProtocolFeaturesSupported : @{ExpandQuery=; FilterQuery=True; SelectQuery=True}
RedfishVersion            : 1.4.0
Registries                : @{@odata.id=/redfish/v1/Registries}
SessionService            : @{@odata.id=/redfish/v1/SessionService}
Systems                   : @{@odata.id=/redfish/v1/Systems}
Tasks                     : @{@odata.id=/redfish/v1/TaskService}
UpdateService             : @{@odata.id=/redfish/v1/UpdateService}

normal run returns this:

Set-MultipleBIOSAttributesREDFISH -idrac_username *** -idrac_password *** -idrac_ip *** -view_attribute_list_only y

ErrorRecord                 : The response ended prematurely.
WasThrownFromThrowStatement : False
TargetSite                  : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext, System.Exception)
Message                     : The response ended prematurely.
Data                        : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException              : System.Net.Http.HttpRequestException: An error occurred while sending the request.
                               ---> System.IO.IOException: The response ended prematurely.
                                 at System.Net.Http.HttpConnection.FillAsync(Boolean async)
                                 at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean async, Boolean foldedHeadersAllowed)
                                 at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
                                 --- End of inner exception stack trace ---
                                 at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
                                 at System.Net.Http.AuthenticationHelper.SendWithNtAuthAsync(HttpRequestMessage request, Uri authUri, Boolean async, ICredentials credent
                              ials, Boolean isProxyAuth, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
                                 at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequest
                              Auth, CancellationToken cancellationToken)
                                 at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, Boolean async, ICredentials credentia
                              ls, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
                                 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
                                 at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTok
                              enSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
                                 at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(HttpClient client, HttpRequestMessage request, Boolean keepAuthorization
                              )
                                 at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
HelpLink                    :
Source                      : System.Management.Automation
HResult                     : -2146233087
StackTrace                  :    at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
                                 at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
                                 at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
                                 at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
texroemer commented 1 year ago

Hi @AciDCooL

This is a known issue with 2.83 iDRAC8 which has been reported by others (see link below). Please go ahead and log a ticket with Dell support, they will give you access to download iDRAC 2.83.100.83 which has the fix for this issue.

https://github.com/dell/iDRAC-Redfish-Scripting/issues/214

Thanks Tex

commonism commented 1 year ago

Have you set DNS Name & Domain for the iDRAC interface? If not - access via address and set values via browser - FQDN is not writable via iDRAC anyway.

texroemer commented 1 year ago

Hi @commonism

Example below shows setting iDRAC DNS name and static domain name using Redfish. Can you give me more details on the failure you're seeing?

C:\Python310>python SetIdracLcSystemAttributesREDFISH.py -ip 192.168.0.120 -u root -p calvin --set idrac --attribute-names NIC.1.DNSRacName,NIC.1.DNSDomainNameFromDHCP,NIC.1.DNSDomainName --attribute-values idrac-R650,Disabled,"test.example.com"

- INFO, configuring "IDRAC" attributes

 Attribute Name: NIC.1.DNSRacName, setting new value to: idrac-R650
 Attribute Name: NIC.1.DNSDomainNameFromDHCP, setting new value to: Disabled
 Attribute Name: NIC.1.DNSDomainName, setting new value to: test.example.com
{'Attributes': {'NIC.1.DNSRacName': 'idrac-R650', 'NIC.1.DNSDomainNameFromDHCP': 'Disabled', 'NIC.1.DNSDomainName': 'test.example.com'}}

- PASS, PATCH command passed to successfully set "IDRAC" attribute(s), status code 200 returned

- INFO, getting new attribute current values
- Attribute Name: NIC.1.DNSRacName, Attribute Value: idrac-R650
- Attribute Name: NIC.1.DNSDomainNameFromDHCP, Attribute Value: Disabled
- Attribute Name: NIC.1.DNSDomainName, Attribute Value: test.example.com

Thanks Tex

commonism commented 1 year ago

Due to the lack of python odata v4 clients, I interface the iDRAC via openapi. Some of the the Dell Extensions to the DMTF OpenAPI schema are not valid, referencing non-existing objects, basically useless. Therefore Dell extensions as DNSRacName are not accessible to me and the standards EthernetInterface.FQDN property is not writable (in violation of the spec).

https://downloads.dell.com/redfish/ - DNSRacName is not mentioned in any of those description documents.

Where is DNSRacName defined?

texroemer commented 1 year ago

Known iDRAC bug with DMTF property FQDN failing as read only attribute but DMTF spec states read write for redfish/v1/Managers/iDRAC.Embedded.1/EthernetInterfaces/{network id}, this will be fixed in iDRAC release planned for Feb 2023.

For setting OEM property DNSRacName, you can set DMTF property HostName. I confirmed this works on iDRAC 6.00.02 version.

For OEM attributes, these are defined in the Dell attribute registry.

redfish/v1/Managers/iDRAC.Embedded.1/Oem/Dell/DellAttributes/iDRAC.Embedded.1 redfish/v1/Registries/ManagerAttributeRegistry

AciDCooL commented 1 year ago

Problem has been mitigated by support through the suggested firmware version, thanks for the insider info :)