VMware Cloud Community
hostasaurus
Enthusiast
Enthusiast

HOWTO: The nightmare of installing vCLI on CentOS 5 x86_64

I wasted a bunch of time today figuring my way around numerous issues so I figured I'd post about it in hopes Google picks it up and others find the thread so they don't waste as much time.

I have a CentOS 5.5 x86_64 (aka RedHat Enterprise 5) system that had been set up with vCLI to communicate with a vCenter 4.1 server and numerous ESXi 4.1 hosts, mostly just for command line resetting of vm's, etc.  We upgraded vCenter to 5.1 and will soon be upgrading the hosts so the old vCLI commands stopped functioning.

I downloaded the VMware-vSphere-CLI-5.1.0-780721.x86_64.tar.gz file from the vCLI 5.1 download page in my portal.  It extracts to vmware-vsphere-cli-distrib.  Vmware's documentation would have you believe installing everything is as simple as running vmware-vsphere-cli-distrib/vmware-isntall.pl and it takes care of the rest for you.  What it actually did is correctly recognize that I had a version 4.1 install of vCLI and told me it would need to be removed before the 5.1 install goes on and would I like it to do that for me?  Sure.  It spits out a license agreement and then acts as if everything went fine when all it apparently did was uninstall my 4.1 commands and did nothing else.

So, here's the process of getting things working again that I had to took; some steps may be unecessary and/or redundant, but no way for me to know which ones were after the fact, just that it works now:

  • You're probably going to be hand installing some CPAN perl libraries, so if you mount your system's /tmp directory with the 'noexec' flag, you'll want to temporarily remount it with noexec removed because the perl CPAN installer compiles things in /tmp
  • Use yum to install libxml2-devel, perl-Crypt-SSLeay, expat-devel and perl-Archive-Zip; i.e.:

yum install libxml2-devel perl-Crypt-SSLeay expat-devel perl-Archive-Zip

These are all standard RHEL packages.  The installer stupidly needs these for the perl library install portion to complete but doesn't bother to tell you this, doesn't attempt to install them and just fails silently.

  • For safe measure, I removed /etc/vmware-vcli/ to clear out any config related to the old install.  Normally this is done with the vmware-uninstall-vSphere-CLI.pl script before installing the new software, but I didn't know that until the new software had already removed most of my 4.1 install.
  • Things still weren't working so I tried to run the perl module installer part manually thinking maybe that's why nothing else (the binaries) was installing either.  That gave me a bunch of missing perl libraries (some of which I included in the above yum installer steps if there is a pre-packaged RHEL version).  The rest we'll need to install manually:
    • Run this:  perl -MCPAN -e shell
    • That will give you an interactive perl CPAN install shell.  From there, you can type:

install Class::Inspector
install ExtUtils-MakeMaker
install SOAP::Lite
install Task::Weaken
install Test::Simple
install UUID
install XML::LibXML
install XML::NamespaceSupport
install XML::Parser
install XML::SAX
install XML::SAX-Base

Some of these are pre-reqs for one or more of each other, so as you go through the list, you may find it asks you to install one or more of them to complete installing one of the others, so then when you go to install the one in question, it will tell you its already up to date; no harm.  Now, some of these will fail to install for whatever reason, and when that occurs, you'll need to exit the interactive shell (type ctrl-D) and go to /root/.cpan/build/ and then into the directory of the module file in question.  For example, UUID will fail, so you'll end up going to /root/.cpan/build/UUID-0.05/ and in there you'll want to type:  perl Makefile.PL followed by make followed by 'make install'  Several of the modules need to be installed manually in that manner.  Each time you encounter one that requires the manual install, just complete it and then go back into the CPAN shell and install the next module.

  • Once all those happy pre-reqs have been installed, go back to your vmware-vsphere-cli-distrib directory and run:  perl Makefile.PL followed by make if it was successful, followed by 'make install' if make was successful.  At that point, it should finally install all of the relevant vmware perl libraries in the appropriate places on the system.
  • Now you can finally run the original vmware-install.pl file from the same vmware-vsphere-cli-distrib directory and it will install the binaries correctly.
  • To finish, if you have written your own scripts that depend on the old 4.1 sample scripts, you'll want to:
    • mkdir /usr/local/lib/vmware-vcli/
    • mv -f vmware-vsphere-cli-distrib/apps /usr/local/lib/vmware-vcli/
Tags (4)
6 Replies
pradiptasahoont
Contributor
Contributor

Hi,

I followed your instruction to install VCLI in my CentOS machine. but still I am getting bellow miss CPAN shell. I have tried to install it but still it not install.

So Please help me to fix this issue.

Please wait while configuring CPAN ...
Please wait while configuring perl modules using CPAN ...
CPAN is downloading and installing pre-requisite Perl module "Archive::Zip" .
Archive::Zip Install Command failed .
CPAN is downloading and installing pre-requisite Perl module
"Class::MethodMaker" .
CPAN is downloading and installing pre-requisite Perl module "UUID" .
CPAN is downloading and installing pre-requisite Perl module
"XML::LibXML::Common" .
CPAN is downloading and installing pre-requisite Perl module "XML::LibXML" .
CPAN not able to install following Perl modules on the system. These must be
installed manually for use by vSphere CLI:
Archive::Zip 1.28 or newer
Class::MethodMaker 2.10 or newer
UUID 0.03 or newer
XML::LibXML::Common 0.13 or newer
XML::LibXML 1.63 or newer

Reply
0 Kudos
hostasaurus
Enthusiast
Enthusiast

The fact that it's trying to download some of the things in my list of pre-reqs makes it sound like you may have skipped that part?  UUID for example.  You need to start the cpan shell and install all the things in the list I gave or the vCLI will fail to install.

Reply
0 Kudos
DVSchwartz
Contributor
Contributor

Thanks for this post!

I was going crazy trying to figure out how to get this installed on CentOS 6.4.  UUID was the final piece that kept failing because I didn't realize that I didn't have enough of the develoment tools installed.  I did a "yum -y groupinstall "development tools" and it gave me enough to finally complete the make.

Then, I realized that I needed to yum install the devel UUID packages.  What a pain, but finally the installer finished.

Thanks!

-Derek

BobDingman
Contributor
Contributor

Thank you for your post.

Unfortunately, after much struggling, I was unable to install vCLI 5.1 on CentOS 5 x86_64.  Mercifully, the vCLI 5.5 has been released recently and it installs with the option of using precompiled Perl scripts.  With that option selected I was able to quickly install it. vCLI 5.5 is backward compatible with ESX 5.x, so seems to be a good solution.

Reply
0 Kudos
pradipta10
Contributor
Contributor

Try this first:

# yum -y install libuuid-devel

This was a bug that is fixed now: https://rt.cpan.org/Public/Bug/Display.html?id=76126



Reply
0 Kudos
BobDingman
Contributor
Contributor

#

Reply
0 Kudos