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

server2 hostconnect() fails with invalid parameters

$
0
0

Hi all,

 

I have installed vmware-server-e.x.p.-63231.i386.tar.gz onto SLES 10 Sp1.

From the directory /vmware-vix I untarred the vmware-vix.tar.gz and installed using the installer script.

I untarred the vix-perl.tar.gz and installed the package.

 

 

 

Set LD_LIBRARY_PATH to /usr/lib/vmware-vix/lib/ws_server_esx-4/32bit and also tried  /usr/lib/vmware-vix/lib/server-1/32bit.

 

 

 

As suggested elsewhere in this forum I edited vmwarerun.pl to use VIX_SERVICEPROVIDER_VMWARE_VI_SERVER.

 

 

 

Still when I try the script, I get an Connect Failed: One of the parameters was invalid(3)

 

 

 

I made an test script  which generates the same error:

 

 

 

#!/usr/bin/perl

 

#

 

#

 

#

 

use VMware::Vix::Simple;

 

#use diagnostics;

 

 

 

sub mydie($$) {

 

my ($errstring, $err) = @_;

 

die "$errstring: ", GetErrorText($err), "($err)\n";

 

}

 

 

 

sub listhosts() {

 

}

 

 

 

sub listvms($) {

 

my ($hh) = @_;

 

my @vmlist = FindRunningVMs($hh, 300);

 

my $err = shift @vmlist;

 

foreach (@vmlist) {

 

print "VM: $_\n";

 

}

 

}

 

 

 

sub host_connect($$$$) {

 

my $hostname="https://192.168.1.10:8333/sdk";

 

my $port=8333;

 

my $username=vmware;

 

my $password=vmware;

 

my $err=undef;

 

my $handle=undef;

 

my $command="list";

 

my $hosthandle=undef;

 

 

 

 

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

 

VIX_SERVICEPROVIDER_VMWARE_VI_SERVER,

 

$hostname, $port, $username, $password,

 

0, VIX_INVALID_HANDLE);

 

 

 

print "\n\n\t\thosthandle=$hosthandle,$hostname,$port,$username,$password\n\n";

 

 

 

mydie("Connect Failed", $err) if $err != VIX_OK;

 

 

 

 

listvms($hosthandle);

 

 

 

return $handle;

 

}

 

 

 

$hosthandle = host_connect($hostname,$port,$username,$password);

 

 

 

 

 

 

 

 

 

 

Any help would be appreciated.


Viewing all articles
Browse latest Browse all 34639

Trending Articles



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