VMware Cloud Community
IT_Architect
Enthusiast
Enthusiast

FreeBSD: Install CLI and Perl SDK

Environment:  I have 2 VMware ESXi 4.0 hosts with 4 VMs on one, and 3 VMs on the other.  Two are Windows server, and the remainder are FreeBSD 7 64.  One of the VMs on each host is running Zabbix monitoring software which monitors the VMs on the opposite host.  We would like to also like to have them monitor the ESXi hosts.  That requires the RCLI and Perl SDK.  http://www.zabbix.com/forum/showthread.php?t=15691

What I've tried:  I installed the vmware-vsphere-cli from the ports tree.  After it finished, I do not find esxcli on the disk.  The only things I see about VMware is /usr/local/lib/perl5/site_perl/5.8.9/VMware, which contains the following files:

VICommon.pm
VICredStore.pm
VIExt.pm
VILib.pm
VIM25Runtime.pm
VIM25Stub.pm
VIM2Runtime.pm
VIM2Stub.pm
VIMRuntime.pm
VIRuntime.pm


Whenever I try one of the commands, such as:

vicfg-volume  --server 10.17.127.130 --username root --password MyPassword -l

or any other script, I always receive the same error:
"Server version unavailable at 'https://10.17.127.130:443/sdk/vimService.wsdl' at /usr/local/lib/perl5/site_perl/5.8.9/VMware/VICommon.pm line 545."


The code around line 545 reads:
#***************************************************************************************************
      my $xml_parser = XML::LibXML->new;
      my $result;

      eval { $result = $xml_parser->parse_string($response->content) };
      if ($@) {
Line 545      die "Server version unavailable at '$url'";

#***************************************************************************************************

If I put the URL it came back with in my browser, it comes back with:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
      <!--
   Copyright 2005-2009 VMware, Inc.  All rights reserved.
-->
      <definitions targetNamespace="urn:vim25Service">
        <import location="vim.wsdl" namespace="urn:vim25"/>
        <service name="VimService">
          <port binding="interface:VimBinding" name="VimPort">
            <soap:address location="https://localhost/sdk/vimService"/>
          </port>
        </service>
      </definitions>

I unzipped the VMware Perl SDK, and found lots of scripts and esxcli, but it is a binary for Linux.

How can I install the CLI and Perl SDK on FreeBSD?

0 Kudos
4 Replies
john23
Commander
Commander

check this link ..if you are missing something...

http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.vcli.ref.doc_50%2Fvcli-right.html

Thanks -A Read my blogs: www.openwriteup.com
john23
Commander
Commander

check this vmtn post..

http://communities.vmware.com/message/1679577

Thanks -A Read my blogs: www.openwriteup.com
0 Kudos
IT_Architect
Enthusiast
Enthusiast

I port installs version 4.1.  The hosts are 4.0.  The commands it shows here http://www.vmware.com/support/developer/vcli/vcli41/doc/reference/index.html are installed.  I'm only trying to query.  The reason I didn't find the esxcli I mentioned earlier is because that series of commands are not installed with version 4.1.

0 Kudos
IT_Architect
Enthusiast
Enthusiast

I've broken the ice.  This error is caused by newer perl LWP libs that do certificate  checking, and the VmWare self-signed certificates generate an error.  Before I ran the script this time, I ran this from the command line
setenv PERL_LWP_SSL_VERIFY_HOSTNAME 0

After that  when I called the example script
perl simpleclient.pl --server 10.17.127.130 --username root --password MyPassword --entity HostSystem

It worked and returned
Found HostSystem: server1.harpertown.usa

Adding this
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
for every user or to the tops of the scripts makes no sense because the SDK ships with hundreds of scripts.   I need to add this where it will be added globally.

0 Kudos