Install vSphere CLI in CentOS 6

0
by on May 7, 2013 at 4:04 pm

I recently installed VMware’s vSphere CLI 5.1 tools on a CentOS 6 x86_64 VM.  Despite the rather reassuring documentation released by VMware, installing these tools was no simple task.  I will outline the steps that I took for a successful installation of the vSphere CLI software, as some of it is not very obvious, especially for beginners.

After registering and downloading the appropriate file from VMWare, you’re left with a file that ends in .gz.  No, this is not an executable, this is a gzipped tar file, named outside of the regular conventions.  This should have been my first indication I was headed for a mild amount of hair pulling.

Step 1

Untar the archive:  tar zxvf <filename>

Now, cd into the directory that was just created.

Step 2 (optional)

I was installing this software in a test environment, and while I had internet connection, ping was disabled on my network.  This is the case for many production networks, so it baffles my mind why VMware would include a provision to test network connectivity with ping inside their install script.  If you environment does not have ICMP ping enabled, but your CentOS machine does indeed have internet access, you should modify the vmware-install.pl as follows:

# Determine if internet connection is available.
  if ( ( ! $install_rhel55_local ) && ( scalar(@install) > 0 ) ) {
      my $internetConnect = `ping -c 10 -W 4 www.vmware.com | grep -c "64 bytes"`;
      if ( $internetConnect ne '') {
        $internet_available = 1;
      }
  }

Step 3

Here’s where I’m going to deviate from what I actually do in hopes to save you some time.  The install script attempts to download a bunch of packages from cpan, which is some sort of perl repository.  The install script will most likely download the needed sources from cpan to meet it’s own dependencies, but cpan has no ability to resolve it’s own dependencies.  Trying to make and install these sources in cpan itself also won’t tell you why they won’t compile and install.  Also, even though VMware released an x86_64 file for vSphere CLI, it actually requires quite a few .i686 packages to run the applications.

I submit to you my list of dependencies to both build the cpan source files, and actually run the compiled vSphere CLI binaries:

yum install openssl-devel gcc libxml2-dev libxml2-devel perl-UUID e2fsprogs make uuid-dev uuid libuuid e2fsprogs-devel libuuid-devel glibc.i686 zlib.i686 zlib-devel.i686 ncurses-libs.i686 libstdc++.i686 libxml2.i686

Please note, not all of these may be required, as I more or less haphazardly picked a couple of them.  In-fact, I’m not sure they’re all actually packages, just some stuff I typed in ;)

Step 4

Run the install script.  This may or may not actually complete for you, as I described above, this is a little out of order from what I did.  Since all of the dependencies have been met at this point, it should proceed without issue.

Step 5 (optional)

Okay, let’s say that the install still didn’t complete because cpan still decided it couldn’t build those sources into libraries / binaries.  If that is the case, go into each directory in /root/.cpan/build/ and run the following command

perl Makefile.PL && make && make install

Please note, if you have used cpan before, there may be other libraries that you don’t need to do this for.  Just like at the date stamp for each, and it should tell you which ones you need.  I only had to do this for like 6 or 7 libraries, so it shouldn’t take that long.  Also, if you run the install script multiple times, you’ll have multiple instances of each library source with a bunch of random characters at the end of the directory name.  You only need to run the command for each library once.

Also, make sure each library actually installs.  If you hit one that gives you an error, skip along to the next and come back to it.  I believe some of the libraries are dependent upon some others that you will have also downloaded.

Step 6 (optional)

If you had to perform step 5, then you just need to re-run VMware’s install script.

Okay, that should be it.  Let me know if there are any issues or questions, and I’ll try to help you out.  Thanks for reading.

, , , ,

You can skip to the end and leave a response. Pinging is currently not allowed.

Categories