본문 바로가기
HW Knowledge/Hewlett-Packard Enterprise

iLO5/ilorest 이용하여 iLO SNTP 구성 변경

by 스쳐가는인연 2023. 6. 26.

iLO SNTP

iLO의 Web UI를 통해서 변경하는 것도 가능하지만, 수량이 많거나 하는 경우, 작업이 번거로울 수 있음에...

iLO의 SNTP의 Timezone을 변경 및 저장하지 않고, 아래 방법으로 진행해볼 수 있다.

 

1. RESTful Interface Tool 설치

RESTful Interface Tool 4.2.0.0 (31 May 2023)
Windows:
 https://support.hpe.com/connect/s/softwaredetails?language=en_US&softwareId=MTX_a90b066e36e645c9a2d3bf52b2&tab=revisionHistory 

Linux
 https://support.hpe.com/connect/s/softwaredetails?language=en_US&softwareId=MTX_11129264503941008c2b6bdf48&tab=revisionHistory 

 

2. 첨부 “ilotz.zip” 파일을 다운로드

ilotz.zip
0.00MB


/ilotz/

  • Change_iloTZ.bat
  • Change_iloTZ.sh

-------------------------------------------------------------

<snip>
ilorest login --nologo %1 --user %2 --password %3 --selector=HPeiLODateTime.v2_0_0
ilorest --nologo rawpatch .\ilodatetime.json
ilorest --nologo iloreset --url=%1 -u %2 -p %3
ilorest --nologo logout
echo %1
<snip>

-------------------------------------------------------------

  • ilodatetime.json

-------------------------------------------------------------

{
     "/redfish/v1/Managers/1/DateTime/":{
             "PropagateTimeToHost":true,
             "TimeZone":{
                    "Index": 31
             },
             "StaticNTPServers":[
                    "192.168.1.1",
                    "192.168.1.2"        
             ]
     }
}
-------------------------------------------------------------

Note. 15: GMT+0 / 31: GMT+9 / 그 외 Timezone은 첨부 파일 내 Timezone list 참조
Note. NTP Server의 주소는, IP Address로 지정되어야 함

Note. Timezone 만 변경/관리 필요한 경우, 그 외 항목을 제거/삭제 후 실행하면 됨.

 

Windows 기준:
3. RESTful Interface Tool console 실행 > 다운로드 받은 “ilotz” 디렉토리로 이동

ilorest console

4. 아래 문구의 명령 수행
C:> Change_iloTZ.bat <%iLO_IPAddress%> <%Administrative_Account%> <%Password%>

e.g.)

C:\Temp\ilotz> Change_iloTZ.bat 192.168.0.10 Admin password
Discovering data...Done
The operation completed successfully.
Discovering data...Done

Warning:
After iLO resets, the session will be terminated.
Please wait for iLO to initialize completely before logging in again.
This process may take up to 3 minutes to complete.

A management processor reset is in progress.
Logging session out.
192.168.0.10
# ./Change_iloTZ.sh 192.168.0.10 Admin issadmin
Discovering data...Done
The operation completed successfully.
Discovering data...Done

Warning:
After iLO resets, the session will be terminated.
Please wait for iLO to initialize completely before logging in again.
This process may take up to 3 minutes to complete.

A management processor reset is in progress.
Logging session out.
192.168.0.10

기본값:
-------------------------------------------------------------
{
    "/redfish/v1/Managers/1/DateTime/":{
        "PropagateTimeToHost": false,
        "TimeZone": {
            "Index": 15
     },
        "StaticNTPServers": [
            "0.0.0.0",
            "0.0.0.0"        
        ]
    }
}
-------------------------------------------------------------

 

Note. Script에서 수행되는 명령:
-------------------------------------------------------------
<snip>
iLO에 로그인:
ilorest login --nologo %1 --user %2 --password %3 --selector=HPeiLODateTime.v2_0_0

Timezone 변환:
ilorest --nologo rawpatch .\ilodatetime.json

Reset iLO:
ilorest --nologo iloreset --url=%1 -u %2 -p %3

접속 종료:
ilorest --nologo logout

대상 서버 IP Address 출력:
echo %1
<snip>
-------------------------------------------------------------
{
    "TimeZone": {
        "Index": 31,
        "Name": "Osaka, Sapporo, Tokyo, Seoul, Yakutsk",
        "UtcOffset": "+09:00",
        "Value": "JST-9:00"
    }
}
-------------------------------------------------------------

 

Note. NTP 설정 중, iLO port device 에 NTP관련 DHCP 설정이 활성화 되어 있으면, 스크립트를 통해 적용이 정상적으로 되지 않을 수 있음.
e.g) iLO.2.15.SNTPConfigurationManagedByDHCPAndIsReadOnly

https://hewlettpackard.github.io/ilo-rest-api-docs/ilo5/#date-time-service-resource
If the time zone is configured to be managed by DHCP, iLO 5 will respond with HTTP 400 and SNTPConfigurationManagedByDHCPAndIsReadOnly (see Using DHCP Supplied Time Settings).
해당 경우, iLO port device의 NTP 설정을 먼저 비활성화 해야함.
---------------------------------------
{
   "/redfish/v1/Managers/1/EthernetInterfaces/1/":{
           "DHCPv4": {
                  "DHCPEnabled": false,
                  "UseDNSServers": false,
                  "UseDomainName": false,
                  "UseGateway": false,
                  "UseNTPServers": false,
                  "UseStaticRoutes": false
           },
           "DHCPv6": {
                  "OperatingMode": "Stateful",
                  "UseDNSServers": true,
                  "UseDomainName": true,
                  "UseNTPServers": false,
                  "UseRapidCommit": false
           }
    }
}
---------------------------------------

 

연관문서:
Advisory: (Revision) HPE Integrated Lights-Out 4 (iLO 4) and iLO 5 - The BIOS Time Zone May be Incorrect on Servers Set with Propagate Network Time Protocol (NTP) to Host or Propagate NTP or Onboard Administrator (OA) Time to Host
https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-a00062543en_us

.

 

첨언:

Python이 익숙한 경우, 아래 라이브러리 및 샘플을 통해 검토할 수 있음
python-ilorest-library
https://github.com/HewlettPackard/python-ilorest-library
set_ilo_ntp_servers.py
https://github.com/HewlettPackard/python-ilorest-library/blob/master/examples/Redfish/set_ilo_ntp_servers.py
set_ilo_timezone.py 
https://github.com/HewlettPackard/python-ilorest-library/blob/master/examples/Redfish/set_ilo_timezone.py

추가적으로, 예전 Script 툴인 RIBCL 명령을 통해서도 관련 설정이 가능.
필요시, 아래 문서 및 외부 아티클을 참조.
HPE iLO 5 Scripting and Command Line Guide
 https://support.hpe.com/hpesc/public/docDisplay?docLocale=en_US&docId=a00018323en_us 
How to set date and time in iLO3 / iLO4 using SNTP and RIBCL scripts
https://www.golinuxhub.com/2018/06/set-date-time-ilo4-3-sntp-hp-blades-oa-ribcl/

 

 

 

 

 

반응형