1 Rookie

 • 

14 Posts

3052

May 19th, 2020 03:00

iDrac Redfish - Set static ip address for mgmt interface

Hi,

I'm trying to configure a static ipv4 address on the idrac mgmt interface.

I do that as follows:

REDFISH_OBJ.patch('Managers/iDRAC.Embedded.1/EthernetInterfaces/NIC.1',[{ 'IPv4Addresses' : [{ 'Address': '10.XXX.X.XX', 'AddressOrigin': 'Static', 'Gateway': '10.XXX.X.X', 'SubnetMask': '255.255.252.0' }])
 
But I get a result that the "Feature dhcp is enabled":
 
    {        "Message": "The feature DHCP is enabled.",         "MessageArgs": [            "DHCP"        ],         "MessageArgs@odata.count": 1,         "MessageId": "IDRAC.2.1.ISM0013",         "RelatedProperties": [            "IPv4Addresses"        ],         "RelatedProperties@odata.count": 1,         "Resolution": "No response action is required.",         "Severity": "Informational"    }

I can't find any property under

 Managers/iDRAC.Embedded.1/EthernetInterfaces/NIC.1

 to disable dhcp.

So how do I set the static ipv4 address?

@DELL-Shine K

4 Operator

 • 

3K Posts

May 19th, 2020 20:00

Thanks for the details

As per redfish schema "AddressOrigin" attribute is read only and you can not patch that attribute. To change iDRAC IP from DHCP to static, you can try PATCH operation on below URI and body

URI : redfish/v1/Managers/iDRAC.Embedded.1/Attributes

Body

{"Attributes":{
"IPv4.1.DHCPEnable": "Disabled",
"IPv4.1.Address": "10.XXX.X.XX",
"IPv4.1.Gateway": "10.XXX.X.X",
"IPv4.1.Netmask": "255.255.252.0"
}}

4 Operator

 • 

3K Posts

May 19th, 2020 06:00

Can you share the server model and iDRAC FW version installed on the server

1 Rookie

 • 

14 Posts

May 19th, 2020 13:00

Sure it's a Dell PowerEdge R640 with iDrac 9, FW version 4.10.10.10.

1 Rookie

 • 

14 Posts

May 20th, 2020 05:00

That seems to work for me. I disabled the dhcp via redfish/v1/Managers/iDRAC.Embedded.1/Attributes and configured the static ip as I was previously doing. Thanks!

4 Posts

December 12th, 2022 12:00

I am doing this and I get a 415. When I set "Content-Type" to "application/json", I get a 406!

4 Operator

 • 

3K Posts

December 12th, 2022 20:00

Can you share the server model and iDRAC FW version on the server? Can you also share the URI, headers and body used for the API?

4 Posts

December 13th, 2022 01:00

Thanks a lot for the quick reply.

Firmware: 6.00.02

Server model: M640 (2yjxkq2)

req. SetBasicAuth (i.username, i.password)
req.Header. Set ( "Accept" , "application/json, text/plain, */*" )
req.Header. Add ( "X-AUTH-TOKEN" , session.Token)
 
This is what gets me a 415. If I do
req.Header. Add ( "Content-Type" , "application/json")
I get 406.
 

RequestDump
PATCH /redfish/v1/Managers/iDRAC.Embedded.1/Attributes HTTP/1.1
Host: 1.2.3.4
User-Agent: Go-http-client/1.1
Content-Length: 170
Accept: application/json, text/plain, */*
Authorization: Basic cNHtOlA1Sb5hZG05c3Q9cg==
X-Auth-Token: ace4fd4fca998414dd3efb646b5c644f
Accept-Encoding: gzip

{"Attributes":{"SysLog.1.Port":514,"SysLog.1.Server1":"something.booking.com","SysLog.1.Server2":"","SysLog.1.Server3":"","SysLog.1.SysLogEnable":"Enabled"}}
url https://1.2.3.4/redfish/v1/Managers/iDRAC.Embedded.1/Attributes

 
ResponseDump:

HTTP/1.1 415 Unsupported Media Type
Connection: close
Content-Length: 395
Content-Type: text/html; charset=iso-8859-1
Date: Mon, 12 Dec 2022 21:15:41 GMT
Server: Apache
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Frame-Options: DENY



415 Unsupported Media Type

Unsupported Media Type


The supplied request data is not in a format
acceptable for processing by this resource.


Additionally, a 415 Unsupported Media Type
error was encountered while trying to use an ErrorDocument to handle the request.


4 Operator

 • 

3K Posts

December 13th, 2022 02:00

Can you try accept header only with "application/json"

req.Header.Set("Accept", "application/json")

4 Posts

December 16th, 2022 01:00

Sorry for the late reply. What actually worked was
 
req.Header. Set ( "Content-Type" , "application/json; charset=utf-8" )
 
just by googling for similar questions on StackOverflow.
 
Thanks a lot, man! I really appreciate you jumping for help right away. If you can pass this feedback to your colleagues, please do provide a better error message since this one was really misleading. Also, the documentation of the RedFish API is horrible, if you allow me to say it. Such things should be clearly mentioned in the docs.

1 Rookie

 • 

3 Posts

December 10th, 2024 02:05

Did this ever get resolved?  We are hitting the same problem

Moderator

 • 

4K Posts

December 10th, 2024 09:29

Hi,

 

I'll leave this post for the public to respond if there is any resolution that they encounter, whilst, I'll reply to your new post. 

No Events found!

Top