VMware ESXiのWebインターフェイスです.
将来,vSphere Client のようなものになる予定ですが,作りかけです.
API経由ではなく,sshでESXiにログインして操作するため,無償版でも大丈夫です. (事前に,SSH接続を許可する必要があります)
ESXi上のVMの一覧表示や,再起動などをブラウザ上からできます.
VMの作成・削除・複製もとりあえずできますが,まだ実装中です.
- 事前にESXiへSSHでログインできることを確認
- conf/app.jsonを編集,または環境変数ESXI_HOSTで,ESXiのホストを指定してください
- bundle install
- ruby esxi-web.rb
- sinatraのデフォルトポート(4567)で待ち受けているのでブラウザで開く
64bit Windowsで実行時している場合,ログイン時に Creation of file mapping failed with error: 998 が発生することがありますが, pagent等を終了すると大丈夫かもしれません.
情報はjsonで取得できます.APIの仕様はコロコロ変わります.
現在の仕様は public/js下のlogin.jsやmonitor.jsを読むのが手っ取り早いです.
状態を取得.CSRFのトークンもとりあえずここに入っています.
ログインして接続します.
※ログインしたSSHのコネクションはAPIにアクセスできる誰もが使える状態になります.(現状,セッション単位で管理したりはしません)
切断します.
ESXiの情報を取得します.hostsummary相当.
VM一覧を取得.
VM情報.get.summary相当
VMを削除.
イベントリから削除し,ファイルも削除します.削除すると元には戻せません.
get.runtimeのpowerState相当.
電源をコントロールします.
on, off, shutdown, reboot のいずれかをリクエストのボディとして送信してください.
VMの複製をします.
この昨日は実装中で特定の構成の環境しかサポートしません.コピー先の名前とMACアドレスを指定してください.
VMのゲストの情報.get.guest相当