Quantcast
Channel: VMware Communities : Popular Discussions - VIX API
Viewing all articles
Browse latest Browse all 34639

Problem running the vix-perl sample scripts

$
0
0

Hi All,

 

I am new to Vix API and trying to run this sample script provided by vix-perl package in Linux(CentOS)

 

\   #!/usr/bin/perl

               #

  1. Copyright 2006.  VMware, Inc.  The use of this code is subject to

  2. your agreement to the terms of an applicable VMware license.

               #

 

               #

 

                 

 

  1. This test opens the host and lists all running VMs.

               #

  1. XXX be sure to modify the connection and VMpath values

               #

  1. for testing w/o installation

               use lib qw{ blib/lib blib/auto blib/arch blib/arch/auto/VMware blib/arch/auto };

 

               use strict;

               use VMware::Vix::Simple;

 

  1. all constants are exported

               use VMware::Vix::API::Constants;

 

                 

 

  1. adjust these as needed

               my $useWorkstation = 1;

 

               my $hostname = "";

               my $hostport = 0;

               my $username = "";

               my $password = "";

               my $connType;

 

               if ($useWorkstation) {

 

                 

 

  1. for VMware workstation, set the connection

               $connType = VIX_SERVICEPROVIDER_VMWARE_WORKSTATION;

 

               } else {

  1. for VMware server, set the connection type

               $connType = VIX_SERVICEPROVIDER_VMWARE_SERVER;

               }

 

               my $err;

               my $hostHandle;

               my @vms;

 

               ($err, $hostHandle) = HostConnect(VIX_API_VERSION,

               $connType,

               $hostname, $hostport, $username, $password,

               0, VIX_INVALID_HANDLE);

 

               die "Connect failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

 

               @vms = FindRunningVMs($hostHandle, 100);

               $err = shift @vms;

               die "Error $err finding running VMs ", GetErrorText($err),"\n" if $err != VIX_OK;

 

               print "VMs: @vms\n";

 

               HostDisconnect($hostHandle);

 

               \

 

Everytime i try to run this script it gives the following error

 

 

 

 

 

 

 

 

 

\ Can't locate VMware/Vix/Simple.pm in @INC (@INC contains: blib/lib blib/auto blib/arch blib/arch/auto/VMware blib/arch/auto /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at findhosttest.pl line 17. \

 

 

 

 

Can someone help me in solving this error. Ugently needed. Thanks in advance

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 34639

Trending Articles



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