Start a Conversation

Unsolved

J

1 Rookie

 • 

3 Posts

51

December 10th, 2024 02:08

Is it possible to set IP, Mask and Gateway with a single patch/Redfish/Ansible

Using the ansible community module we tried setting the IP address, mask and gateway and disabling DHCP all with the same play.

Something like this

- name: Configure IP attributesdellemc.openmanage.idrac_attributes:idrac_ip: "10.20.30.40"idrac_user: "username"idrac_password: "password"validate_certs: falseidrac_attributes:IPv4.1.DHCPEnable: "Disabled"IPv4.1.Address: "20.30.40.50"IPv4.1.Gateway: "255.255.254.0"IPv4.1.Netmask: "20.30.40.1"IPv4.1.DNS1: "8.8.8.8"

The DHCP does get disabled and the IP address does get set, but the Mask, Gateway, DNS do not get set.

However if I run it a 2nd time.  They do set properly.  So it appears that you cant set it at a single time.

Thats a problem because when the IP gets assigned, we lose ability to manage it, so the 2nd run obviously wont work.

I found this post which has the same problem 

https://www.dell.com/community/en/conversations/systems-management-general/idrac-redfish-set-static-ip-address-for-mgmt-interface/647f8879f4ccf8a8de7e5a99?msockid=30d230a6be0d63081435248ebf8962d3

Its over 4 years old and I a concerned it was never really resolved.
 

1 Rookie

 • 

3 Posts

December 10th, 2024 02:18

And using curl with a patch basically tells you cant disable DHCP and set the IP address at the same time

curl -k -X PATCH \
  'https://10.20.30.1/redfish/v1/Managers/iDRAC.Embedded.1/EthernetInterfaces/NIC.1' \
  -u 'root:password' \
  -H 'Content-Type: application/json' \
  -d '{
    "DHCPv4": {
        "DHCPEnabled": false
    },
    "IPv4Addresses": [
        {
            "Address": "20.30.40.50",
            "SubnetMask": "255.255.254.0",
            "Gateway": "20.30.40.1"
        }
    ]
}'
{"error":{"@Message.ExtendedInfo":[{"Message":"The feature DHCP is enabled.","MessageArgs":["DHCP"],"MessageArgs@odata.count":1,"MessageId":"IDRAC.2.8.ISM0013","RelatedProperties":["#/IPv4Addresses"],"RelatedProperties@odata.count":1,"Resolution":"No response action is required.","Severity":"Informational"},{"Message":"The property DHCPv4 is not in the list of valid properties for the resource.","MessageArgs":["DHCPv4"],"MessageArgs@odata.count":1,"MessageId":"Base.1.12.PropertyUnknown","RelatedProperties":["#/DHCPv4"],"RelatedProperties@odata.count":1,"Resolution":"Remove the unknown property from the request body 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"}}%

Moderator

 • 

3.9K Posts

December 10th, 2024 09:37

Hi,

 

I don't have a test unit to check on the issue, I would say it might be the limitation of doing both disabling and setting on the same command. As you encountered, if you execute the command twice, the settings are set. As the configuration already changed on one of the option, whilst the other did not. Hence, when you execute the second time, the configuration is effective on the other settings. 

 

There isn't a documentation if it is a limitation, but if it is, I would suggest contacting the support to raise a case, as the support engineer need to remote into the server and investigate. 

No Events found!

Top