最近项目需要在Centos7上安装VCLI.
根据官方说明,适用预变异的perl模块,运行的时候报错.
根据下面这个文章, 使用cpan,但是在安装过程中报错,说明下面文章应该有缺陷.
经过N多天尝试,终于成功
环境:
OS:
CentOS-7-x86_64-DVD_1511.iso
server install
delveopment tool
legacy library
VCLI安装包
VMware-vSphere-CLI-6.0.0-2503617.x86_64.tar.gz
过程
把VMware-vSphere-CLI-6.0.0-2503617.x86_64.tar 上传到 /root
yum install -y openssl-devel libuuid-devel
yum install -y cpan
yum install -y openssl-devel libuuid-devel perl-YAML perl-Devel-CheckLib gcc perl-CPAN
cpan Devel::StackTrace Class::Data::Inheritable Convert::ASN1 Crypt::OpenSSL::RSA Crypt::X509 Exception::Class UUID::Random Archive::Zip Path::Class Try::Tiny Class::MethodMaker UUID Data::Dump SOAP::Lite LWP::Protocol::https Socket6 IO::Socket::INET6 Net::INET6Glue JSON::PP MIME::Base64
yum install perl-Module-Build
cpan install -f GnuPG::Interface
cpan install Fatal
cpan -i GAAS/libwww-perl-5.837.tar.gz
tar -xvf VMware-vSphere-CLI-6.0.0-2503617.x86_64.tar.gz
cd vmware-vsphere-cli-distrib/
./vmware-install.pl EULA_AGREED=yes
#一定要选no,不要安装自带的perl模块
no
然后若干次回车加上漫长等待.等安装完了
可以运行类似下面的命令看看能否列出虚拟机
vmware-cmd -U [email protected] -P [email protected] -H 192.168.40.20 -h $192.168.40.11 -l