VMware {code} Community
pLdsen
Contributor
Contributor

VIX - Perl on Windows

Hey,

does anyone ever successfully installed VIX - Perl on Windows?

Im using Active State Perl on Windows Server 2003 RC2, but always having Problems with building VIX - Modules.

Does anyone have a Tutorial installing it?

Thanks for help.

Greetz

Reply
0 Kudos
4 Replies
sepso
Enthusiast
Enthusiast

The Vix 32-bit Perl binding needs to be compiled in order to run Vix Perl scripts.

For Windows clients, the requirements are:

ActivePerl-5.8.0

Compatible 32-bit C compiler such as Visual Studio 2003 or MinGW

And as needed depending on the completeness of your Windows build environment:

Appropriate Microsoft 32-bit Platform SDK

Microsoft .NET 1.1 SDK

Nmake or mingw32-make.exe

VMware Engineering uses Microsoft Visual C++ .NET Standard 2003 which is fully compatible with ActivePerl-5.8.0 and constitutes a complete VIX Perl build environment requiring no additional components.

The Perl build environment for VIX Lab client Windows virtual machine has the following free-of-charge software pre-installed:

ActivePerl ActivePerl-5.8.0.805

Microsoft Visual C++ Toolkit 2003 (no longer available from Microsoft’s site)

Microsoft .NET 1.1 SDK

XP SP2 32-bit Platform SDK (Core and MDAC modules) from:

Note: In lieu of the Visual C++ Toolkit 2003, the MinGW compiler may be substituted:

Quincy 2005 is a compatible and freely available C++ IDE that utilizes the MinGW compiler. The .NET SDK and Platform SDK will also be required.

Reply
0 Kudos
admin
Immortal
Immortal

I had a good bit of trouble with this myself, so I created a package that might make it easier.

I have a PPM package attached to this message that you can install against ActiveState ActivePerl. Instructions for installing it are:

  1. Save the attached package to a temporary directory.

  2. Unzip the package.

  3. In the directory where you unpacked the files, type "ppm install VMware-VIX.ppd"

  4. Add ActivePerl's site\bin directory to your path. Example: set PATH=%PATH%;c:\perl\site\bin or set PATH=%PATH%;"c:\program files\VMware\VMware VI Perl Toolkit\Perl\site\bin" if you use the VMware VI Perl Toolkit.

You should then be able to write Perl scripts that use VIX. Note that there seems to be a lot of compatibility problems between different versions of ActivePerl. I built this package against ActivePerl 5.8.8 build 820. I'm not positive this will work against their other builds. The reason I chose this particular build is that it happens to be the build that is used for the VI Perl Toolkit. If the package doesn't work against your ActivePerl, you can install the VI Perl Toolkit alongside another instance of ActivePerl and use VIX with it.

Please also note that I'm using the VIX 1.5 Beta, taken from VMware Server 2.0 Beta.

I would appreciate any feedback people have on this, whether it works for them, etc.

Reply
0 Kudos
pLdsen
Contributor
Contributor

Does the VIX-API 1.5 work with VMware Server 1.0.4 except of some new Methods? Are there any changes in Syntax or method calls?

Greetz

edit: Well, i just tried it, and i cant connect to Hosts.

VmhsHostInfoPopulateSystem: Could not get model of host

VmhsHostInfoPopulateSystem: Could not get vendor of host

VMHS: Failed to load vmnetMgr.dll

Does anyknow know about this problem?

Reply
0 Kudos
admin
Immortal
Immortal

Does the VIX-API 1.5 work with VMware Server 1.0.4 except of some new Methods? Are there any changes in Syntax or method calls?

My understanding is that it does work. I get the same message you're getting, but the script works in spite of it. I'm not connecting to Server 1.x though. Could you try this script:



#!/usr/bin/perl
use lib qw{ blib/lib blib/auto blib/arch blib/arch/auto/VMware blib/arch/auto };


use strict;
use VMware::Vix::Simple;
use VMware::Vix::API::Constants;


# Connect to VMware Server 1.x.
my $connType = VIX_SERVICEPROVIDER_VMWARE_SERVER;
my $hostname = "192.168.1.1";  # Replace with your IP.
my $hostport = 902;
my $username = "";             # Replace with your login.
my $password = "";             # Replace with your password.


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);


(also attached as a file) to see if it works for you?

Reply
0 Kudos