vCenter Server(仮想マシン) & vSphere HA & システム上に別にWindows Server有り構成のIPM設定手順を解説致します。
はじめに
vCenter Serverが仮想マシンで物理マシンWindowsが存在する場合、物理マシンにIPMとJAVA JREをインストールします。
シャットダウンフローは、仮想マシン(vCenter除く)をシャットダウンした後に、vCenter Serverをシャットダウンします。次に、仮想ホストをシャットダウンします。最後に、物理マシンをシャットダウンします。
システム構成
VMware vSphere HA構成
vCenter Serverは仮想マシンとして存在
Windowsの物理マシンが存在(別システム上であれば、仮想マシンも可)

必要条件
Eaton IPM 1.55
Eaton IPM Silver License
JAVA JRE
シャットダウンフロー
- 仮想マシン(vCenter除く)
- 仮想マシン(vCenter)
- 仮想ホスト(ESXi)
- 物理マシン(Windows)
- UPS
シャットダウン設定
IPMとJAVA JREのインストール、シルバーライセンス適用、インフラストラクチャーコネクターのvCenterコネクター追加が完了している前提で解説を始めさせて頂きます。
また、全ての手順を掲載すると非常に長くなるため、重要なポイントに絞って解説しています。
仮想マシン(vCenter除く)の設定
構成ポリシーの作成
構成ポリシーネーム:任意(半角英数)
ターゲットノード:vCenter以外の全ての仮想マシンを選択します。
クラスリスト:Runtime threshold settingsとパワーソースを選択します。
タイマー:シャットダウンタイマー値を入力します。
パワーソース:電源供給元のUPSを選択します。

アクションの作成
アクション名:任意(半角英数)
イベントリスト:シャットダウン基準に到達
イベントソース:上記で作成したポリシー
アクションタイプ:仮想マシンの電源操作
パワーコマンド:ゲストのシャットダウン
仮想マシンターゲット:上記で作成したポリシー

以上で、仮想マシン(vCenter除く)の設定は完了です。
仮想マシン(vCenter)の設定
構成ポリシーの作成
構成ポリシーネーム:任意(半角英数)
ターゲットノード:vCenterの仮想マシンを選択します。
クラスリスト:Runtime threshold settingsとパワーソースを選択します。
タイマー:シャットダウンタイマー値を入力します。
パワーソース:電源供給元のUPSを選択します。

アクションの作成
アクション名:任意(半角英数)
イベントリスト:シャットダウン基準に到達
イベントソース:上記で作成したポリシー
アクションタイプ:仮想マシンの電源操作
パワーコマンド:ゲストのシャットダウン
仮想マシンターゲット:上記で作成したポリシー

以上で、仮想マシン(vCenter)の設定は完了です。
仮想ホスト(ESXi)の設定
IPMはvCenterがシャットダウンすると、vCenter配下のノードと通信できなくなるため、仮想ホスト(ESXi)のシャットダウンはスクリプトによって制御します。ここでは、Tera Termで仮想ホスト(ESXi)にSSH接続してPoweroffコマンドを実行する手順を紹介しています。vCenterのシャットダウン完了を待つために、60秒のtimeoutを入れています。
バッチファイルとスクリプトの作成
host_shutdown.bat をc:\scriptに作成します。
timeout 60
c:\script\host1_shutdown.ttl
c:\script\host2_shutdown.ttl

host1_shutdown.ttl をc:\scriptに作成します。
connect '192.168.10.210:22 /ssh /auth=challenge /user=root /passwd=EatonUPS114
pause 5
sendln 'poweroff'
sendln 'exit'

host2_shutdown.ttl をc:\scriptに作成します。
connect '192.168.10.220:22 /ssh /auth=challenge /user=root /passwd=EatonUPS114
pause 5
sendln 'poweroff'
sendln 'exit'

以上で、host_shutdown.batを実行すると60秒待機した後、仮想ホスト1と2を順番にシャットダウンします。

タスクの作成
タスク スケジューラで[タスク]を作成します。
[全般]タブ
名前:任意(半角英数)
ユーザーがログオンしているかどうかにかかわらず実行する を選択
構成:Windows Server 2003、XP、2000を選択【重要】

[操作]タブ
操作:プログラムの開始
詳細:C:\script\host_shutdown.bat

[条件]タブ
コンピュータをAC電源で使用している場合のみタスクを開始する のチェックを外す

他のタブは変更しません。
以上で、作成したタスクを実行するとhost_shutdown.batを実行します。

構成ポリシーの作成
構成ポリシーネーム:任意(半角英数)
ターゲットノード:全ての仮想ホストを選択します。
クラスリスト:Runtime threshold settingsとパワーソースを選択します。
タイマー:シャットダウンタイマー値を入力します。
パワーソース:電源供給元のUPSを選択します。

アクションの作成
作成したwindowsタスクを実行するように設定します。
アクション名:任意(半角英数)
イベントリスト:シャットダウン基準に到達
イベントソース:上記で作成したポリシー
アクションタイプ:コマンド
コマンド:schtasks.exe /run /tn “作成したwindowsタスクの名前”

以上で、アクション → タスク → バッチ → スクリプト の一連の処理が完成しました。
物理マシン(Windows)の設定
設定 > シャットダウン をクリックします。

パワーソースの構成
電源供給元のUPS(パワーソース)を設定します。

シャットダウンの構成
シャットダウンタイマー:シャットダウンタイマー値を入力します。
シャットダウンのタイプ:シャットダウンを選択します。

UPS(パワーソース)の設定
シャットダウンパラメーター
[になった後]にチェックを入れます。その右の項目に[シャットダウンタイマー値]を入力します。
シャットダウン待機時間:上で入力した値が経過した時に、何秒後にUPSをシャットダウンさせるかの値を入力します。
..後UPSをオフする は[有効]にします。

以上で、全ての設定が完了しました。
シャットダウンテスト
UPSの電源ケーブルを抜いてバッテリー運転にします。

おわりに
仮想ホストをシャットダウンするコマンドを変更すれば、VMware vSANの環境もシャットダウンさせる事ができます。
以上、村田@ダイトロンがお届けしました。