no about note

エンジニアのメモ書き

HPサーバのiLO設定をオンラインでCLIから行う「hponcfg」

hponcfgとは

HPのサーバで、ESXiホスト上に既に仮想マシンが動いていて、止めたくない時に便利なコマンド「hponcfg」というのが あると知ったのでメモ。 HPのバンドルのESXiからインストールしている場合は、デフォルトで既に入っている。 バンドル版じゃないときは、ここから指定のバージョンのモノをダウンロードできる。

iLOIPアドレスやrootのパスワードの変更などが可能。

前提

  • rootでESXiホストにSSHログインができること

使い方

HELP

# /opt/hp/tools/hponcfg -h

HP Lights-Out Online Configuration utility

Version 4.0-13 (c) Hewlett-Packard Company, 2011
Firmware Revision = 2.27 Device type = iLO 2 Driver name = hpilo
iLO IP Address: xxxxxxx

USAGE:
 hponcfg  -?
 hponcfg  -h
 hponcfg  -m minFw
 hponcfg  -r [-m minFw ]
 hponcfg  [-a] -w filename [-m minFw]
 hponcfg  -g [-m minFw]
 hponcfg  -f filename [-l filename] [-s namevaluepair] [-v] [-m minFw]
 hponcfg  -i [-l filename] [-s namevaluepair] [-v] [-m minFw]

 -h,  --help           Display this message
 -?                    Display this message
 -r,  --reset          Reset the Management Processor to factory defaults
 -f,  --file           Get/Set Management Processor configuration from "filename"
 -i,  --input          Get/Set Management Processor configuration from the XML input
                       received through the standard input stream.
 -w,  --writeconfig    Write the Management Processor configuration to "filename"
 -a,  --all            Capture complete Management Processor configuration to the file.
                       This should be used along with '-w' option
 -l,  --log            Log replies to "filename"
 -v,  --xmlverbose     Display all the responses from Management Processor
 -s,  --substitute     Substitute variables present in input config file
                       with values specified in "namevaluepairs"
 -g,  --get_hostinfo   Get the Host information
 -m,  --minfwlevel     Minimum firmware level

現在の設定をファイルに出力する hponcfg -w

# /opt/hp/tools/hponcfg -w /tmp/ilo-conf.txt

# cat /tmp/ilo-conf.txt

<!-- HPONCFG VERSION = "4.0-13.0" -->
<!-- Generated 1/6/2016 3:48:5 -->
<RIBCL VERSION="2.1">
 <LOGIN USER_LOGIN="Administrator" PASSWORD="YOUR-NEW-PASSWORD">
  <DIR_INFO MODE="write">
  <MOD_DIR_CONFIG>
    <DIR_AUTHENTICATION_ENABLED VALUE = "N"/>
    <DIR_LOCAL_USER_ACCT VALUE = "Y"/>
    <DIR_SERVER_ADDRESS VALUE = ""/>
    <DIR_SERVER_PORT VALUE = "636"/>
    <DIR_OBJECT_DN VALUE = ""/>
    <DIR_OBJECT_PASSWORD VALUE = ""/>
    <DIR_USER_CONTEXT_1 VALUE = ""/>
    <DIR_USER_CONTEXT_2 VALUE = ""/>
    <DIR_USER_CONTEXT_3 VALUE = ""/>
  </MOD_DIR_CONFIG>
  </DIR_INFO>
  <RIB_INFO MODE="write">
  <MOD_NETWORK_SETTINGS>
    <SPEED_AUTOSELECT VALUE = "Y"/>
    <NIC_SPEED VALUE = "10"/>
    <FULL_DUPLEX VALUE = "N"/>
    <IP_ADDRESS VALUE = "xxx.xxx.xxx.xxx"/>
    <SUBNET_MASK VALUE = "255.255.0.0"/>
    <GATEWAY_IP_ADDRESS VALUE = "xxx.xxx.xxx.xxx"/>
    <DNS_NAME VALUE = "xxxxxxxxxxxx"/>
    <PRIM_DNS_SERVER value = "xxx.xxx.xxx.xxx"/>
    <DHCP_ENABLE VALUE = "N"/>
    <DOMAIN_NAME VALUE = "N"/>
    <DHCP_GATEWAY VALUE = "N"/>
    <DHCP_DNS_SERVER VALUE = "N"/>
    <DHCP_STATIC_ROUTE VALUE = "N"/>
    <DHCP_WINS_SERVER VALUE = "N"/>
    <REG_WINS_SERVER VALUE = "N"/>
    <PRIM_WINS_SERVER value = "0.0.0.0"/>
    <STATIC_ROUTE_1 DEST = "0.0.0.0" GATEWAY = "0.0.0.0"/>
    <STATIC_ROUTE_2 DEST = "0.0.0.0" GATEWAY = "0.0.0.0"/>
    <STATIC_ROUTE_3 DEST = "0.0.0.0" GATEWAY = "0.0.0.0"/>
  </MOD_NETWORK_SETTINGS>
  </RIB_INFO>
  <USER_INFO MODE="write">
  </USER_INFO>
 </LOGIN>
</RIBCL>

設定を変更 hponcfg -f

# hponcfg -f ファイル名
<IP_ADDRESS VALUE = “172.16.1.19”/>
<SUBNET_MASK VALUE = “255.255.0.0”/>
<GATEWAY_IP_ADDRESS VALUE = “172.16.0.1”/>
<DNS_NAME VALUE = “xxxxxxxx”/>xxx
<PRIM_DNS_SERVER value = “172.16.0.1”/>
<DHCP_ENABLE VALUE = “N”/>

<ribcl VERSION=”2.0″>
<login USER_LOGIN=”Administrator” PASSWORD=”YOUR-NEW-PASSWORD“>
<user_INFO MODE=”write”>
<mod_USER USER_LOGIN=”Administrator”>
<password value=”newpass”/>
</mod_USER>
</user_INFO>
</login>
</ribcl>


<RIBCL VERSION="2.1">
 <LOGIN USER_LOGIN="Administrator" PASSWORD="YOUR-NEW-PASSWORD">
 <user_INFO MODE=”write”>
  <mod_USER USER_LOGIN="Administrator">
  <password value=”caNsnFlz”/>
  </mod_USER>
  </user_INFO>
  </LOGIN>
 </RIBCL>

管理者のパスワードを変更する hponcfg -f reset_admin_pw.xml

# hponcfg -f reset_admin_pw.xml
<!-- HPONCFG VERSION = "4.0-13.0" -->
<!-- Generated 1/6/2016 3:48:5 -->
<RIBCL VERSION="2.1">
 <LOGIN USER_LOGIN="Administrator" PASSWORD="YOUR-NEW-PASSWORD">
  <DIR_INFO MODE="write">
  <MOD_DIR_CONFIG>
    <DIR_AUTHENTICATION_ENABLED VALUE = "N"/>
    <DIR_LOCAL_USER_ACCT VALUE = "Y"/>
    <DIR_SERVER_ADDRESS VALUE = ""/>
    <DIR_SERVER_PORT VALUE = "636"/>
    <DIR_OBJECT_DN VALUE = ""/>
    <DIR_OBJECT_PASSWORD VALUE = ""/>
    <DIR_USER_CONTEXT_1 VALUE = ""/>
    <DIR_USER_CONTEXT_2 VALUE = ""/>
    <DIR_USER_CONTEXT_3 VALUE = ""/>
  </MOD_DIR_CONFIG>
  </DIR_INFO>
  <RIB_INFO MODE="write">
  <MOD_NETWORK_SETTINGS>
    <SPEED_AUTOSELECT VALUE = "Y"/>
    <NIC_SPEED VALUE = "10"/>
    <FULL_DUPLEX VALUE = "N"/>
    <IP_ADDRESS VALUE = "172.16.1.19"/>
    <SUBNET_MASK VALUE = "255.255.0.0"/>
    <GATEWAY_IP_ADDRESS VALUE = "172.16.0.1"/>
    <DNS_NAME VALUE = "xxxxxxxxx"/>
    <PRIM_DNS_SERVER value = "172.16.0.1"/>
    <DHCP_ENABLE VALUE = "N"/>
    <DOMAIN_NAME VALUE = "N"/>
    <DHCP_GATEWAY VALUE = "N"/>
    <DHCP_DNS_SERVER VALUE = "N"/>
    <DHCP_STATIC_ROUTE VALUE = "N"/>
    <DHCP_WINS_SERVER VALUE = "N"/>
    <REG_WINS_SERVER VALUE = "N"/>
    <PRIM_WINS_SERVER value = "0.0.0.0"/>
    <STATIC_ROUTE_1 DEST = "0.0.0.0" GATEWAY = "0.0.0.0"/>
    <STATIC_ROUTE_2 DEST = "0.0.0.0" GATEWAY = "0.0.0.0"/>
    <STATIC_ROUTE_3 DEST = "0.0.0.0" GATEWAY = "0.0.0.0"/>
  </MOD_NETWORK_SETTINGS>
  </RIB_INFO>
  <USER_INFO MODE="write">
  </USER_INFO>
 </LOGIN>
</RIBCL>

参考

How to Configure HP ILO from ESXi host

図解でわかる Linuxサーバ構築・設定のすべて

図解でわかる Linuxサーバ構築・設定のすべて