I just wasted another 30min of my life finding out what I had found out before like 100 times. I executed the installer for the vSphere SDK for Perl and wondered why I couldn’t actually use the modules. Well, the one thing I always forget about is to set the http_proxy and ftp_proxy environment variable. So this post is just to save me some time the next time.
The following line is taken from this website, but relates to Ubuntu 10.04. It works in 12.10 but might not work in future versions or Debian.
apt-get install libarchive-zip-perl libcrypt-ssleay-perl libclass-methodmaker-perl libdata-dump-perl libsoap-lite-perl perl-doc libssl-dev libuuid-perl liburi-perl libxml-libxml-perl ia32-libs
tar xvf VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.tar.gz
export http_proxy=
export ftp_proxy=
sudo ./vmware-install.pl
The output should finish like this:
Do you accept? (yes/no) yes
Thank you.
In which directory do you want to install the executable files?
[/usr/bin]
Please wait while copying vSphere CLI files...
The installation of vSphere CLI 5.1.0 build-780721 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command:
"/usr/bin/vmware-uninstall-vSphere-CLI.pl".
This installer has successfully installed both vSphere CLI and the vSphere SDK
for Perl.
The following Perl modules were found on the system but may be too old to work
with vSphere CLI:
Compress::Zlib 2.037 or newer
Compress::Raw::Zlib 2.037 or newer
IO::Compress::Base 2.037 or newer
IO::Compress::Zlib::Constants 2.037 or newer
UUID 0.03 or newer
Enjoy,
By default, you will get an error like this connecting to the API:
Error: Server version unavailable at 'https://...'
This is a problem with the HTTPS certificate checking performed by LWP. To disable this, you have two options:
Disable checking globally by editing https.pm of the LWP module:
sudo vim /usr/share/perl5/LWP/Protocol/https.pm
Look for the following line
$ssl_opts{SSL_verify_mode} ||= 1;
and change it to
$ssl_opts{SSL_verify_mode} ||= 0;
Disable in your own perl script:
To disable certificate checking for your own perl script add the following line to the top:
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
Now all I have to do is actually remember I blogged this info the next time I need it.