Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 179681

HOWTO: The nightmare of installing vCLI on CentOS 5 x86_64

$
0
0

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/

Viewing all articles
Browse latest Browse all 179681

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>