dell / iDRAC-Redfish-Scripting

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

SetIdracLcSystemAttributesREDFISH.py get stuck when changing the ip of the idrac #188

Closed OmarReygaert closed 2 years ago

OmarReygaert commented 2 years ago

Suggestion, when changing the idrac ip with SetIdracLcSystemAttributesREDFISH.py, it excute this very fine. after the change it wants to check the idrac for the value, but this is not valid anymore as the ip has changed. so maybe a check that looks for the paramater IPv4.1.Address. And if this one is triggered, using the ip address provided for that value so that it can check with the correct ip what the new value is.

texroemer commented 2 years ago

Hi @OmarReygaert

Thanks for bringing this up, script was missing check for validating static iDRAC IP change workflow. I've updated the script with this check, example below of executing it.

C:\Python39>SetIdracLcSystemAttributesREDFISH.py -ip 192.168.0.120 -u root -p calvin -s idrac -an IPv4.1.Address -av "192.168.0.130"

- INFO, configuring "IDRAC" attributes

 Attribute Name: IPv4.1.Address, setting new value to: 192.168.0.130

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

- INFO, getting new attribute current values
- INFO, static IP address change detected, script will validate changes using new IP address

- Attribute Name: IPv4.1.Address, Attribute Value: 192.168.0.130

Thanks Tex

OmarReygaert commented 2 years ago

Hi @texroemer ,

thanks for your fast change and reply.

So does that mean if you give a list of attributes to change (which include a static ip) that it will use the new IP also for the other changed attributes? Or does it has to be done separated?

texroemer commented 2 years ago

If static iDRAC IP change is detected when setting multiple attributes using PATCH, script will now use the new static IP to run GET request, validate all attribute changes using this new static IP.

Thanks Tex

OmarReygaert commented 2 years ago

Super, thanks for the changes