Server Management - Remote Server Management
1835068 Members
2877 Online
110073 Solutions
New Discussion

Re: Change iLO hostname using RedFish API

 
SOLVED
Go to solution
bradawk1
Trusted Contributor

Change iLO hostname using RedFish API

I'm searching through iLO RedFish API , but have not found the answer yet.  We have about 600 new servers with iLO interface names as set at the factory.  We want to change them to our naming convention.  I know how to change it with hponcfg, but don't want to have to log in to every server to run that.  Does anyone know the correct RedFish API call to change the ilO hostname?

3 REPLIES 3
bradawk1
Trusted Contributor
Solution

Re: Change iLO hostname using RedFish API

OK, I found :

curl --insecure --silent --header "X-auth-Token: ${iLOAuth}" --request GET ${iLOSSO}/redfish/v1?$expand=* | jq -r '.'

gives in part:

"Oem": {
        "Hpe": {
            "@odata.type": "#HpeiLOServiceExt.v2_0_0.HpeiLOServiceExt",
            "Links": {
                "ResourceDirectory": {
                    "@odata.id": "/redfish/v1/ResourceDirectory/"
                }
            },
            "Manager": [
                {
                    "DefaultLanguage": "en",
                    "FQDN": "edited",
                    "HostName": "ILO",

I'm just not sure how to get down to the Manager array under Oem/Hpe.  Does anyone have an idea?

bradawk1
Trusted Contributor

Re: Change iLO hostname using RedFish API

I figured it out.  Can see the current iLO hostname with:

curl --insecure --silent --location --header "X-Auth-Token: ${iLOAuth}" --request GET ${iLOSSO}/redfish/v1/Managers/1/NetworkProtocol | jq -r '.'

Then to change, I ran:

SERVER=new-ilo-hostname
echo '{"HostName": "'${SERVER}'"}' > set-ilo
curl --insecure --silent --location --include --header "Content-Type: appliation/json" --header "X-Auth-Token: ${iLOAuth}" --data "@set-ilo" --request PATCH ${iLOSSO}/redfish/v1/Managers/1/NetworkProtocol

I got back:

HTTP/1.1 200 OK

When I ran the GET call again, the hostname has been changed!

Sunitha_Mod
Honored Contributor

Re: Change iLO hostname using RedFish API

Hello @bradawk1

That's excellent! 

We are glad to know you were able to find the solution and we appreciate you for keeping us updated.