2012/10/10

Ubuntu 12.04 LTS (precious)にVMWare CLIを導入してみる

空いているPCにIntel NICを追加して、VMWare vSphere Hypervisor (ESXi)を導入したので、手元のクライアントから操作できるようにコマンドラインクライアント(vCLI)を導入しました。

ちょっとした問題があったので、まとめておく事にします。

インストール手順

CLIのインストール手順はマニュアルのにあります。 必要な前提パッケージを導入すれば、$ sudo vmware-vsphere-cli-distrib/vmware-install.plを実行するだけなのですが、次のようなエラーメッセージが表示されました。

導入時のエラーメッセージ
...
Thank you.

http_proxy not set. please set environment variable 'http_proxy' e.g. export
http_proxy=http://myproxy.mydomain.com:0000 .

ftp_proxy not set. please set environment variable 'ftp_proxy' e.g. export
ftp_proxy=http://myproxy.mydomain.com:0000 .

$ 

正常終了したのかと思いましたが、マニュアルにはコマンドを配置するパス(デフォルト/usr/bin)を指定する段取りがあるはずで、案の定esxcliコマンドは導入されていませんでした。

スクリプトが途中で終了する理由

どういうわけか、プロキシー設定("export http_proxy=..." or "export ftp_proxy=...")を行なわないとスクリプトが終了する作りになっています。

vmware-vsphere-cli-distrib/vmware-install.plの該当個所の抜粋

...
      my $httpproxy =0;
      my $ftpproxy =0;

      if ( direct_command("env | grep -i http_proxy") ) {
         $httpproxy = 1;
      } else {
         print wrap("http_proxy not set. please set environment variable 'http_proxy' e.g. export ht
tp_proxy=http://myproxy.mydomain.com:0000 . \n\n", 0);
      }
      if ( direct_command("env | grep -i ftp_proxy") ) {
         $ftpproxy = 1;
      } else {
         print wrap("ftp_proxy not set. please set environment variable 'ftp_proxy' e.g. export ftp_
proxy=http://myproxy.mydomain.com:0000 . \n\n", 0);
      }

      if ( !( $ftpproxy && $httpproxy)) {
         uninstall_file($gInstallerMainDB);
         exit 1;
      }
...

プロキシーがなくとも外部ネットワークにアクセスできる環境であれば、この評価式全体をコメントアウトしてしまうのがお勧めです。最後のif文の評価式全体をコメントアウトしてあげると、プロキシーを設定することなしに導入する事ができます。

正常終了した時のメッセージ

最終的にインストールに成功した時のメッセージの最後の方は、次のようになっていました。

...

Please wait while configuring perl modules using CPAN ...

CPAN is downloading and installing pre-requisite Perl module "Archive::Zip" .

CPAN is downloading and installing pre-requisite Perl module
"Class::MethodMaker" .

CPAN is downloading and installing pre-requisite Perl module "SOAP::Lite" .

In which directory do you want to install the executable files?
[/usr/bin]

Please wait while copying vSphere CLI files...

The installation of vSphere CLI 5.1.0 build-780721 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command:
"/usr/bin/vmware-uninstall-vSphere-CLI.pl".

This installer has successfully installed both vSphere CLI and the vSphere SDK
for Perl.

The following Perl modules were found on the system but may be too old to work
with vSphere CLI:

UUID 0.03 or newer

Enjoy, 

--the VMware team

正式にサポートされているUbuntuは10.04なので、12.04 LTSでは少し前提となるパッケージが違うようですが、とりあえずは動いています。

何か不都合があるのかは、これから使ってみて確認していきたいと思います。

0 件のコメント: