Friday, 8 April 2016

(Painfully) installing the vSphere SDK for Perl on CentOS 7

We should firstly install cpan (if not already installed) so that the installer can download the relevent Perl modules:

yum install cpan

cd /tmp
wget https://download2.vmware.com/software/sdk/VMware-vSphere-Perl-SDK-6.0.0-2503617.x86_64.tar.gz
tar zxvf VMware-vSphere-Perl-SDK-6.0.0-2503617.x86_64.tar.gz
cd VMware-vSphere-Perl*
./vmware-install.pl

Ensure you select 'NO' when the following prompt appears:

'Do you want to install precompiled Perl modules for RHEL?'

This is because the perl version differs from that of the one that compiled the 'precompiled' modules.

So instead the installer will attempt to retrieve the precompiled modules using cpanm.

Although unfortautnely I then got a complaint complaining that the following modules were available but the installer was unable to get the following versions of the modules:

Module: ExtUtils::MakeMaker, Version: 6.96
Module: Module::Build, Version: 0.4205
Module: LWP, Version: 5.837

So we will have to install these older versions manually with cpan:

cpan BINGOS/ExtUtils-MakeMaker-6.96.tar.gz
cpan LEONT/Module-Build-0.4205.tar.gz
cpan GAAS/libwww-perl-5.837.tar.gz

and then attempt the installation again:

./vmware-install.pl

I then received yet another error complaining that it couldn't find any of the following modules:

Class::MethodMaker 2.10 or newer
UUID 0.03 or newer
XML::LibXML::Common 0.13 or newer
XML::LibXML 1.63 or newer

So we do:

cpan install YAML
cpan install -f GnuPG::Interface
cpan install Fatal
cpan install Env
yum install uuid-devel libuuid-devel libxml2-devel
cpan install UUID
cpan install XML::LibXML
cpan Class::MethodMaker

and finally ran the install again:

./vmware-install.pl

I then got a message complaining about some missing / outdated modules:

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

MIME::Base64 3.14 or newer
LWP::Protocol::https 5.805 or newer
Socket6  0.23 or newer
IO::Socket::INET6 2.71 or newer

So we do an install:

cpan install MIME::Base64
cpan install LWP::Protocol::https
cpan install Socket6
cpan install IO::Socket::INET6

and we are ready to go!

2 comments:

  1. Hi Peter,

    Thanks for this great tutorial, you saved me!

    ReplyDelete
  2. i have this error:

    Undefined subroutine &Util::disconnect called at ./check_esx.pl line 556.

    How to solve it?

    ReplyDelete