# iLOrestコマンド メモ
## 準備編
### 必要なもの
+ 操作対象サーバのiLO5のアドレス `192.168.1.7`
uer: Administrator password: password
+ RHEL7.7 (CentosでもOK)
`10.135.230.52 / 192.168.1.8`
+ RESTfulインタフェース `https://hewlettpackard.github.io/python-redfish-utility/#executing-commands-in-parallel`
+ ダウンロード先https://support.hpe.com/hpsc/swd/public/detail?swItemId=MTX_63b9a97c4e314c23ac1e3350be
### マニュアル
+コマンド解説
https://hewlettpackard.github.io/python-redfish-utility/#types-command
+パスワードなしログイン(当面不要)
https://tutorialmore.com/questions-321176.htm
+Windows版の導入
https://techexpert.tips/ja/hp-ilo-ja/windows%E3%81%A7%E3%81%AEhp-ilo-restful%E3%82%A4%E3%83%B3%E3%82%BF%E3%83%BC%E3%83%95%E3%82%A7%E3%82%A4%E3%82%B9%E3%83%84%E3%83%BC%E3%83%AB%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC/
+SmartArrayを設定
https://www.youtube.com/watch?v=tbTsV_ThInA
## CURLで叩いて疎通確認
curl https://192.168.1.7/redfish/v1/ --insecure -L
>{"@odata.context":"/redfish/v1/$metadata#ServiceRoot.ServiceRoot","@odata.etag":"W/\"07F2DE30\"","@odata.id":"/redfish/v1/","@odata.type":"#ServiceRoot.v1_1_0.ServiceRoot","Id":"v1","AccountService":{"@odata.id":"/redfish/v1/AccountService/"},"Chassis":{"@odata.id":"/redfish/v1/Chassis/"},"EventService":{"@odata.id":"/redfish/v1/EventService/"},"JsonSchemas":{"@odata.id":"/redfish/v1/Schemas/"},"Links":{"Sessions":{"@odata.id":"/redfish/v1/SessionService/Sessions/"}},"Managers":{"@odata.id":"/redfish/v1/Managers/"},"Name":"HPE RESTful Root Service","Oem":{"Hpe":{"@odata.context":"/redfish/v1/$metadata#HpeiLOServiceExt.HpeiLOServiceExt","@odata.type":"#HpeiLOServic
つながるね
## iloRest導入
rpm -ivh ilorest-3.0.1-7.x86_64.rpm
以上
## iloRestを使ってみる
ilorest
>iLOrest > login 192.168.1.7 -u Administrator -p password
Discovering data...Done
iLOrest >
お、行けたっぽい。
>iLOrest > types
Type options:
AccountService.v1_0_2
Bios.v1_0_0
Chassis.v1_6_0
ChassisCollection
ComputerSystem.v1_4_0
ComputerSystemCollection
EthernetInterface.v1_4_0
EthernetInterfaceCollection
EventDestinationCollection
EventService.v1_0_2
HpeBaseConfigs.v2_0_0
HpeBaseNetworkAdapter.v2_0_0
HpeBaseNetworkAdapterCollection
HpeBiosMapping.v2_0_0
HpeCertAuth.v1_1_0
HpeCertificateCollection
HpeComponent.v1_0_0
HpeComponentCollection
HpeComponentInstallSet.v1_0_2
HpeComponentInstallSetCollection
HpeComponentUpdateTaskQueueCollection
HpeESKM.v2_0_0
HpeHttpsCert.v2_0_0
HpeInvalidImageCollection
HpeMaintenanceWindowCollection
HpePowerMeter.v2_0_1
HpeRemoteSupport.v2_3_0
HpeSNMPAlertDestination.v2_0_0
HpeSNMPAlertDestinationCollection
HpeSNMPUsersCollection
HpeSecurityService.v2_2_0
HpeServerBootSettings.v2_0_0
HpeServerDevice.v2_0_0
HpeServerDeviceCollection
HpeServerPCISlot.v2_1_0
HpeServerPCISlotCollection
HpeServerPciDevice.v2_0_0
HpeServerPciDeviceCollection
HpeSmartStorage.v2_0_0
HpeSmartStorageArrayController.v2_1_0
HpeSmartStorageArrayControllerCollection
HpeSmartStorageDiskDrive.v2_0_0
HpeSmartStorageDiskDriveCollection
HpeSmartStorageHostBusAdapterCollection
HpeSmartStorageLogicalDrive.v2_1_0
HpeSmartStorageLogicalDriveCollection
HpeSmartStorageStorageEnclosure.v2_0_0
HpeSmartStorageStorageEnclosureCollection
HpeTlsConfig.v1_0_0
HpeUSBDevicesCollection
HpeUSBPort.v2_0_0
HpeUSBPortsCollection
HpeiLOAccountCertificateMap.v1_0_1
HpeiLOAccountCertificateMapCollection
HpeiLOActiveHealthSystem.v2_2_0
HpeiLOBackupRestoreService.v2_1_0
HpeiLODateTime.v2_0_0
HpeiLOEmbeddedMedia.v2_0_0
HpeiLOFederatedGroupCapping.v2_0_0
HpeiLOFederationGroup.v2_0_0
HpeiLOFederationGroupCollection
HpeiLOFederationPeers.v2_0_0
HpeiLOFederationPeersCollection
HpeiLOLicense.v2_1_0
HpeiLOLicenseCollection
HpeiLOSSO.v2_0_0
HpeiLOSnmpService.v2_1_0
HpeiSCSISoftwareInitiator.v2_0_0
LogEntryCollection
LogService.v1_0_0
LogServiceCollection
Manager.v1_1_0
ManagerAccount.v1_0_0
ManagerAccountCollection
ManagerCollection
ManagerNetworkProtocol.v1_0_0
Memory.v1_1_0
MemoryCollection
NetworkInterfaceCollection
Power.v1_2_1
Processor.v1_0_0
ProcessorCollection
SUT.v2_2_0
SUTSystemInventory.v2_2_0
SUTTaskSettings.v2_2_0
SecureBoot.v1_0_0
ServiceRoot.v1_1_0
SessionCollection
SessionService.v1_0_0
SmartStorageConfig.v2_0_1
SoftwareInventory.v1_0_0
SoftwareInventoryCollection
StorageCollection
Thermal.v1_1_0
UpdateService.v1_1_0
VirtualMedia.v1_2_0
VirtualMediaCollection
iLOrest >
使い方ビデオ見よう...
https://www.youtube.com/watch?v=xfEN95pNNfY&vl=ja
おぉ、楽しい
>iLOrest > select Bios.v1_0_0
>iLOrest > get Adminname Adminphone Adminemail
AdminEmail=""
AdminName=""
AdminPhone=""
iLOrest > set Adminname=tanahara
iLOrest > get Adminname Adminphone Adminemail
AdminEmail=""
AdminName=tanahara
AdminPhone=""
iLOrest > set Adminphone=0120-444-444 Adminemail=tanahara@dev.null
iLOrest > get Adminname Adminphone Adminemail
AdminEmail=tanahara@dev.null
AdminName=tanahara
AdminPhone=0120-444-444
ファイルに落とせるらしい
>iLOrest > save -f bios.json
Saving configuration...
Configuration saved to: bios.json
iLOrest > quit
Logging session out.
Bye for now
[root@localhost ~]# ls
anaconda-ks.cfg bios.json ilorest-3.0.1-7.x86_64.rpm
bios.jsonを修正してみる
>[root@localhost ~]# vi bios.json
[
{
"Comments": {
"BIOSDate": "02/14/2018",
"BIOSFamily": "U32",
"Manufacturer": "HPE",
"Model": "ProLiant DL360 Gen10",
"SerialNumber": "JPN813005Y",
"iLOVersion": "iLO 5 v1.30"
}
},
{
"#Bios.v1_0_0.Bios": {
"/redfish/v1/systems/1/bios/settings/": {
"@odata.context": "/redfish/v1/$metadata#Bios.Bios",
"@odata.etag": "W/\"BF310BCC64AACFCFCF36EFDE7CF27337\"",
"@odata.id": "/redfish/v1/systems/1/bios/settings/",
"AttributeRegistry": "BiosAttributeRegistryU32.v1_1_36",
"Attributes": {
"AdminEmail": "tanahara@***hpe.com***"
},
"Id": "settings",
"Name": "BIOS Pending Settings"
}
}
}
]
そしてロード
>[root@localhost ~]# ilorest
iLOrest : RESTful Interface Tool version 3.0.1
Copyright (c) 2014, 2019 Hewlett Packard Enterprise Development LP
------------------------------------------------------------------------------------
>iLOrest > login 192.168.1.7 -u Administrator -p password
Discovering data...Done
iLOrest > load -f bios.json
Loading configuration...
Committing changes...
One or more properties were changed and will not take effect until system is reset.
iLOrest > get Adminemail
AdminEmail=tanahara@hpe.com
iLOrest >
いけてる....
>[root@localhost ~]# ilorest login 192.168.1.7 -u Administrator -p password get Adminname
iLOrest : RESTful Interface Tool version 3.0.1
Copyright (c) 2014, 2019 Hewlett Packard Enterprise Development LP
Discovering data...Done
[root@localhost ~]# ilorest select Bios.v1_0_0
iLOrest : RESTful Interface Tool version 3.0.1
Copyright (c) 2014, 2019 Hewlett Packard Enterprise Development LP
[root@localhost ~]# ilorest get Adminname
iLOrest : RESTful Interface Tool version 3.0.1
Copyright (c) 2014, 2019 Hewlett Packard Enterprise Development LP
AdminName=tanahara
root@localhost ~]# ilorest exit
iLOrest : RESTful Interface Tool version 3.0.1
Copyright (c) 2014, 2019 Hewlett Packard Enterprise Development LP
Logging session out.
Bye for now
コマンドラインでもいけるのね
### 後で読む
+postman / redfish / iLO5
https://sourceforge.net/p/redfish-lab/wiki/Managing-iLO-Sessions-With-Redfish/
+ ilo5 gitgub
https://hewlettpackard.github.io/python-redfish-utility/
+ 古い
https://h50146.www5.hpe.com/lib/products/servers/proliant/manuals/795538-196_ja.pdf
+ iLO5
https://h50146.www5.hpe.com/lib/products/servers/proliant/manuals/880740-191_ja.pdf