Download the vSphere SDK for Perl 6.0 64-bit Linux installer (e.g. VMware-vSphere-Perl-SDK-6.0.0-2503617.x86_64.tar.gz) here (free registration required) and extract it:
cd ~/Downloads
tar zxvf VMware-vSphere-Perl-SDK-6.0.0-2503617.x86_64.tar.gz
cd vmware-vsphere-cli-distrib/
- Alternative 1 - UUID 0.02 + force SDK to use this version (RECOMMENDED)
sudo cpan Class::MethodMaker Crypt::SSLeay SOAP::Lite UUID LWP XML::LibXML Data::Dumper
Patch the Makefile to allow UUID version 0.02
sudo sed -i '.bak' -e "s/'UUID' => '0.03'/'UUID' => '0.02'/" Makefile.PL
- Alternative 2 - Use CPAN unauthorized version 0.03 BUT comply with VMware SDK requirements
curl -s http://www.cpan.org/authors/id/C/CF/CFABER/UUID-0.03.tar.gz -o UUID-0.03.tar.gz && \
tar -xzvf UUID-0.03.tar.gz && \
cd UUID-0.03 && \
perl Makefile.PL && \
make -Wpointer-sign && \
sudo make install \
cd ~/Downloads/vmware-vsphere-cli-distrib
sudo cpan Class::MethodMaker Crypt::SSLeay SOAP::Lite UUID LWP XML::LibXML Data::Dumper
sudo perl Makefile.PL
sudo make install
# Copy esxcfg- and vicfg- commands to /usr/local/bin
sudo cp -rv ./bin/ /usr/local/bin/
sudo apt-get -y install libexpat1-dev libxml2-dev libuuid-perl
Download the vSphere SDK for Perl 6.0 64-bit Linux installer (e.g. VMware-vSphere-Perl-SDK-6.0.0-2503617.x86_64.tar.gz) here (free registration required) and extract it:
cd ~/
tar zxvf VMware-vSphere-Perl-SDK-6.0.0-2503617.x86_64.tar.gz
cd vmware-vsphere-cli-distrib/
sudo perl vmware-install.pl
Go grab a coffee while CPAN does its thing.
When running from the command line, set the enviroment variable to ignore trusted cert. Make sure you know what this means!
$ export PERL_LWP_SSL_VERIFY_HOSTNAME=0
Or pass the root CA file path via PERL_LWP_SSL_CA_PATH:
$ export PERL_LWP_SSL_CA_PATH=/path/to/ca/certs
vicfg-vmknic --server=$VCENTER__IP --username=$USER@vsphere.local --vihost=$VHOST --list