Installing the VI Perl Toolkit from Source Code
The VI Perl Toolkit can be installed from souce code on any platform that supports Perl.
- Perl 5.8
- Several supporting Perl modules:
- Crypt-SSLeay (0.51) [Crypt::SSLeay]
- Data-Dumper (2.102) [Data::Dumper]
- MethodMaker (2.0.8) [Class::MethodMaker]
- XML-LibXML (1.60) [XML::LibXML]
- libwww-perl (5.805) [LWP]
- VI Perl Toolkit package
Obtaining the pre-requisites and installing them is part of the platform-specific installation instructions that follow.
Installing the VI Perl Toolkit on Linux
Many Linux distributions include Perl and some or all of the required modules, by default. If not, you will need to install all pre-requisites before installing the VI Perl Toolkit.
Obtaining and Installing Pre-requisites
The instructions below guide you through the process of obtaining the modules from CPAN and building them on the host system. However, you can also use the Perl Package Manager (PPM) to streamline the process.
- Launch your browser and navigate to the CPAN search page:
- Select Modules from the drop-down list.
- Enter the name of the module in the search text box. Spell and punctuate precisely, including colons when appropriate, as shown here:
- Click the CPAN Search button to initiate the search. Shortly, a results page displays listing one or more links to the module or library. Various versions and sub-packages may be included.
- Click the most appropriate link to display the download page for the module. The download page includes information about the module or library, links to source code, and a link to the downloadable archive file in the upper-right-hand corner of the page.
- Click the Download link to initiate the download. The browsers File Download dialog displays, enabling you to save the file to disk. Click the Save button and navigate to the sub-directory in which you want to save the download.
- Navigate to the /tmp directory and save the download.
After downloading any missing Perl libraries from the CPAN website, you can unpack and install them.
- Open a Linux shell session and navigate to the directory containing the downloaded packages.
- Unzip the package, if necessary. For example:
- Extract the files from the package. For example:
tar xf Class-MethodMaker-2.08.tar
- Navigate to the sub-directory containing the extracted files. For example:
- Review the README file. It contains (among other things) the name and description of the library, the minimum version of Perl required, and a list of required packages (if any).
- Read the INSTALL file for information about how to install the module.
- Follow the instructions in the modules INSTALL file. Note that you must typically perform the final step (make install) as the root user. Depending on your privileges (whether you can use sudo or not), follow one of these two approaches:
|Authorized to use sudo||Not authorized to use sudo|
sudo make install
Using CPAN Module to Install Linux
An alternative way to install any missing modules is to use the CPAN module thats part of the Perl distribution. To launch the CPAN shell:
perl -MCPAN -e shell
You will be prompted to provide some basic information, including the source from which to obtain the modules, where to build them, and so on. You can obtain the necessary Perl libraries from
CPAN (Comprehensive Perl Archive Network)
or another reliable source, and for most of the other prompts, simply accept the defaults. Shortly, the cpan> prompt displays:
To find the module:
cpan> i /pat/
where pat is a pattern, such as part of the name of the missing module.
Obtaining the VI Perl Toolkit Sourcecode
The VI Perl Toolkit source-code package comprises a single platform-independent compressed file, available from Sourceforge.
- Launch a browser and navigate to the VI Perl Toolkit download:
- Click the Download VMware Infrastructure (VI) Perl Toolkit button. The About VMware Infrastructure Toolkit page displays, listing packages available for download with information about release dates, file size, and dates. Find the VI Perl Toolkit Beta package from among those listed:
- Click the Download button to display a list of files available for download. Since the VI Perl Toolkit comprises a single platform-independent install, only one file is available:
- Click the file name to begin the download process. A dialog box displays, enabling you to save the file to disk.
- Navigate to the /tmp (or /temp, for Windows) sub-directory to save the file.
- Click Save to save the file.
- Open a Linux shell session.
- Change to the directory in which you downloaded the package.
- Unzip the package, if necessary (some systems may de-compress during download).
- Extract the files from the package.
tar xf filename.tar
- Change to the directory containing the extracted files.
- Review the README file for information about licensing, additional requirements, and late-breaking information.
Running the Installation Script
Assuming that the Linux host meets all requirements, you can run the Makefile.PL for the Toolkit.
If any of the Perl pre-requisites are missing, youll see warning messages, such as Warning: prerequisite Data::Dumper 2.121 not found. We have 2.12. Return to Obtaining and Installing Pre-requisites and finish installing all pre-requisites before proceeding.
- Build the Toolkit files.
- Verify that the build succeeded by running the test.
- Install the Toolkit files.
Installing the VI Perl Toolkit on Windows
To install the VI Perl Toolkit on Windows, you must obtain a Windows implementation of Perl and various libraries; install the VI Perl Toolkit ; and perform a few other basic setup tasks. From start to finish, the entire process takes about 15 minutes (or less, if you already have Perl installed).
These instructions (adapted from
Richard Garsthagens excellent HOW-TO, available on his Run-Virtual website) have been tested on a Windows XP system.
- Obtain and install ActivePerl 5.8, available from:
You will need to register at ActivePerls website to download the software.
Download ActivePerl Microsoft installer (.msi).
- Double-click on the filename to launch the wizard-driven installation process that also sets the required paths. During the installation process, just accept the defaults, including the default directory (C:\).
- Launch the Perl Package Manager (PPM) by running the batch file (ppm.bat) at the command prompt:
- From the PPM Edit menu, select Preferences... and add the path to the University of Winnipegs PPM (Perl library) as a repository from which to obtain modules and packages:
- Select these modules and packages:
As the required packages are installed, you may be prompted to install various other supporting packages. Accept any additional installations. The process may take a few minutes to complete, but its fairly simple.
- Obtain Microsofts nmake from:
The page that displays at the URL above is a support page that includes a link to nmake15.exe, which is a self-extracting compressed file that unpacks nmake.exe, nmake.err, and a readme.txt file.
- Scroll through the page that opens to find the link for nmake15.exe on the page.
- Click the nmake15.exe link. A save dialog displays.
- Select Save to Disk and click OK. A navigation dialog box displays.
- Navigate to the %SystemRoot% folder (typically, c:\WINDOWS) of your Windows host system) and click Save to download the nmake15.exe file to Windows system directory. When the download completes, open Windows Explorer and navigate to %SystemRoot% and find the nmake15.exe.
- Double-click the file to unpack its contents:
- Launch a Windows console session (cmd.exe).
- Navigate to the location of the VI Perl Toolkit download and run these commands:
The console displays progress:
Writing Makefile for VIPerlToolkit
- Enter nmake at the command prompt:
- Enter nmake install at the command prompt:
The console reports status as the VI Perl Toolkit components (VIRuntime.html, VIStub.html, VIRuntime.pm, and so on) are installed, and in a few seconds, the process completes.
Validating the VI Perl Toolkit Installation
After installing the VI Perl Toolkit Virtual Appliance (or installing manually on Linux or Windows), you can confirm successful installation by running any one of the Utility Applications, or by running one of the sample scripts.
Running a Sample Script
To navigate to the samples sub-directory
In the samples sub-directory, youll find several other sub-directories, including:
The datacenterlisting.pl (in the \samples\discovery folder), is a good place to start. Its a basic discovery utility that obtains a list of hosts and virtual machines running at the specified server. You must pass to the script (as a parameter) the name of the ESX Server host or VirtualCenter Management Server host system.
To run the script:
- Navigate to the /samples sub-directory:
- Enter perl and the precise name of the script (capitalization must match), including the path within the /samples directory, passing any required parameters. For example, for the datacenterlisting script, you would enter:
perl discovery/datacenterlisting.pl --host 'servername_or_ip_address' --datacenter 'datacenter_name'
Or simply navigate to the /discovery before running the script, saving yourself from typing the directory name:
perl datacenterlisting.pl --server 'servername' --datacenter 'datacenter_name'
For example, running datacenterlisting.pl against a VirtualCenter Management Server might be as follows:
perl discovery/datacenterlisting.pl --server 10.17.152.252 --datacenter Primary_Datacenter --username Administrator --password password
If you are testing your setup against an ESX Server host, you must pass an empty string to the datacenter parameter, as in:
perl discovery/datacenterlisting.pl --server 10.17.152.252 --datacenter ' ' --username root --password password
© 2007 VMware, Inc. All rights reserved.
VI Perl Toolkit 1.0 | Released 30-Aug-2007 | Last updated 28-August-2007 7:00 pm