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

Vix and Perl - Simple example does not work

$
0
0

 

Hi!

 

 

I installed the VMWare Server 2.0 Beta today with hopes of using the Vix-perl api with VMWare Server.  This server is installed on RHEL ES4

 

 

The installation went fine and I can connect to the vmware server on its website using the root username/password (but not as the user I am logged in to as on the machine). I found the libs for Vix and added them to the LD_LIBRARY_PATH

 

 

So when I do something like:

 

 

bash-3.00$ perl -e "use VMware::Vix::Simple"

 

 

I get no errors.

 

 

When I run a program to connect to the host (local host in this case), I get errors like:

 

 

-bash-3.00$ perl test1.pl

Connecting to Host Machine...ERROR! 3: One of the parameters was invalid-bash-3.00$ 

 

 

My Program

 

 

-


 

 

#!/usr/bin/perl

 

 

use strict;

use warnings;

 

 

use VMware::Vix::Simple;

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

 

 

my $hostType= VIX_SERVICEPROVIDER_VMWARE_SERVER;

my $hostName= undef;

my $hostPort= undef;

my $userName= undef;

my $password= undef;

my $options = 0;

my $propertyListHandle = VIX_INVALID_HANDLE;

 

 

#Host Connect

 

 

print "Connecting to Host Machine...";

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

$hostType,

$hostName,

$hostPort,

$userName,

$password,

$options,

$propertyListHandle);

 

 

if(VIX_OK != $err){

print ("ERROR! $err: " . GetErrorText($err));

exit(1);

}

else {

print "Success!\n";

 

 

 

-


END PROGRAM

 

 

I'd really appreciate some help in getting this going! Please let me know if you need more information

 

 

Thanks

 

 

Rahul

 

 


Viewing all articles
Browse latest Browse all 34639

Trending Articles



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