- No category
advertisement
Installation Guide
VMware Infrastructure Perl Toolkit 1.5
Installation Guide
Installation Guide
Revision: 20080110
You can find the most up-to-date technical documentation on our Web site at http://www.vmware.com/support/
The VMware Web site also provides the latest product updates.
If you have comments about this documentation, submit your feedback to: [email protected]
© 2007, 2008 VMware, Inc. All rights reserved. Protected by one or more of U.S. Patent Nos. 6,397,242, 6,496,847, 6,704,925,
6,711,672, 6,725,289, 6,735,601, 6,785,886, 6,789,156, 6,795,966, 6,880,022, 6,944,699, 6,961,806, 6,961,941, 7,069,413,
7,082,598, 7,089,377, 7,111,086, 7,111,145, 7,117,481, 7,149,843, 7,155,558, 7,222,221, 7,260,815, 7,260,820, 7,269,683,
7,275,136, 7,277,998, 7,277,999, 7,278,030, 7,281,102, and 7,290,253; patents pending.
VMware, the VMware “boxes” logo and design, Virtual SMP and VMotion are registered trademarks or trademarks of VMware,
Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies.
VMware, Inc.
3401 Hillview Ave.
Palo Alto, CA 94304 www.vmware.com
2 VMware, Inc.
Contents
About This Book 5
1
Before You Begin 7
Downloading the Perl Toolkit Binary 7
2
Installing a VI Perl Toolkit Package 11
Installing the VI Perl Toolkit Package on Linux 11
Operating System Prerequisites 11
Finding and Installing OpenSSL 12
Installing the VI Perl Toolkit 13
Uninstalling the VI Perl Toolkit 14
Installing the VI Perl Toolkit on Windows 14
Uninstalling the VI Perl Toolkit 15
Upgrading the VI Perl Toolkit Package 15
3
Installing and Using the VI Perl Toolkit Virtual Appliance 17
Installing and Using the Virtual Appliance on ESX Server Hosts 17
Importing the Virtual Appliance 17
Running the Virtual Appliance 18
Installing and Using the Virtual Appliance on Hosted Products 18
4
Installing the VI Perl Toolkit from Source Code 19
Installing the Toolkit on Linux 19
Installing the Toolkit on Windows 20
5
Validating the VI Perl Toolkit Installation 23
VMware, Inc.
3
Installation Guide
4 VMware, Inc.
About This Book
This book, the Installation Guide, discusses installing the VI Perl Toolkit and validating the installation. This guide is intended for administrators who intend to run VI Perl Toolkit scripts on VMware
®
Infrastructure hosts.
Revision History
This guide is revised with each release of the product or when necessary. A revised version can contain minor or major changes.
Table 1 summarizes the significant changes in each version of this guide.
Table 1. Revision History
Revision Description
20070105
20080110
First version of the VI Perl Toolkit 1.0 documentation.
Miscellaneous documentation changes.
VI Perl Toolkit no longer available on source forge.
Virtual appliance now in OFV format.
To view the most current version of this guide, see the VMware Web site: http://www.vmware.com/support/developer/
Intended Audience
This book is intended for anyone who needs to install the VI Perl Toolkit. All users need to understand how to modify and execute Perl scripts on the platform of their choice. If you want to install the toolkit from source code, you must also understand the source code installation process.
Document Feedback
VMware welcomes your suggestions for improving our documentation. If you have comments, send your feedback to: [email protected]
Technical Support and Education Resources
The following sections describe the technical support resources available to you. You can access the most current versions of other VMware manuals by going to: http://www.vmware.com/support/pubs
VMware, Inc.
5
Installation Guide
Online Support
You can submit questions or post comments to the Developer Community: SDKs and APIs forum, which is monitored by VMware technical support and product teams. You can access the forum at: http://communities.vmware.com/community/developer
Support Offerings
Find out how VMware support offerings can help meet your business needs. Go to: http://www.vmware.com/support/services .
VMware Education Services
VMware courses offer extensive hands‐on labs, case study examples, and course materials designed to be used as on‐the‐job reference tools. For more information about VMware Education Services, go to: http://mylearn1.vmware.com/mgrreg/index.cfm
.
6 VMware, Inc.
1
Before You Begin
1
This chapter presents important prerequisite information for installing the VI Perl Toolkit in the following sections:
“Supported Platforms” on page 7
“Downloading the Perl Toolkit Binary” on page 7
“Connectivity Check” on page 8
Supported Platforms
You can install the VI Perl Toolkit package on the following platforms:
Linux:
Red Hat Enterprise Linux (RHEL) 5
Ubuntu Desktop 7.1
SUSE Enterprise Server 10 (SP1)
Fedora Core 8
Windows:
Windows XP Service Pack 2
Windows 2003 Service Pack 2 Server
You can also import the VI Perl Toolkit appliance, which is in OVF format, on any ESX Server 3.5 host. If you want to use the appliance on one of the hosted VMware products, you can use the OVF Tool to convert the appliance to the appropriate format.
N
OTE
On the virtual appliance, the VI Perl Toolkit runs on top of a Debian Linux platform.
Downloading the Perl Toolkit Binary
The process of downloading the binary is the same for all three installers, and similar on Linux and Windows.
To download the VI Perl Toolkit
1 Go to the SDK and API download page at http://www.vmware.com/download/sdk/index.html
.
2 In the VMware Infrastructure (VI) Perl Toolkit section, click Download.
3 Read the Perl Toolkit Agreement and click Yes to accept and continue.
You cannot download the VI Perl Toolkit unless you accept the agreement.
4 Download the binary for the installation you want to perform.
VMware, Inc.
7
Installation Guide
Connectivity Check
Before you start to use the VI Perl Toolkit, make sure the connection from your development system to the target ESX Server host or VirtualCenter server is working. The connection is required for the validation task in
Chapter 5, “Validating the VI Perl Toolkit Installation,” on page 23.
This section discusses how to connect to the target system and launch the Managed Object Browser (MOB).
The MOB is a web‐based server application hosted on all VMware ESX Server hosts and VirtualCenter
Management Server systems. The MOB lets you explore the objects on the system and obtain information about available properties and methods. It is a useful tool for investigating server‐side objects and for learning about the VMware Infrastructure object model.
N
OTE
If the ESX Server or VirtualCenter Server system uses HTTPS (the default), you need a user name and password to log into the MOB.
To access the MOB on any ESX Server or VirtualCenter Server system
1 Launch a Web browser on your development system.
2 Connect to the MOB using the fully‐qualified domain name (or the IP address) of the ESX Server host or
VirtualCenter Server as follows:
https://<hostname.yourcompany.com>/mob
The browser prompts you for a user name and password for the host.
3 Enter the user name and password.
After you enter the user name and password, the host might display a warning messages regarding the
SSL certificate authority, such as Website Certified by an Unknown Authority. If VMware is the certificate authority, you can disregard such warnings and continue to log in to the MOB. The following page displays.
8
If the ESX Server or VirtualCenter Server system has been configured to support HTTP (not HTTPS) connections and you used http in the URL, the system does not prompt you for a user name and password, and does not display any SSL‐certificate‐related warnings.
VMware, Inc.
Chapter 1 Before You Begin
Documentation
The documentation for the VI Perl Toolkit includes a Programmer’s Guide and Utility Applications Reference available on the SDK download site.
Because your Perl script retrieves and works with server‐side objects, it is also essential that you understand the VMware Infrastructure SDK. The API Reference is included with the Perl Toolkit documentation. Some users might find the VMware Infrastructure SDK Programmer’s Guide helpful. It is available from the SDK download site at http://www.vmware.com/download/sdk/index.html.
VMware, Inc.
9
Installation Guide
10 VMware, Inc.
2
Installing a VI Perl Toolkit Package
2
This chapter explains how to install a VI Perl Toolkit package on Linux or Windows. After you have installed the package on your administration server, you can invoke toolkit scripts to connect to on your ESX Server host or VirtualCenter Server system by specifying the appropriate connection parameters. See the VI Perl Toolkit
Programmer’s Guide for a list of connection parameters you can use.
This chapter discusses these topics:
“Installing the VI Perl Toolkit Package on Linux” on page 11”
“Installing the VI Perl Toolkit on Windows” on page 14
“Upgrading the VI Perl Toolkit Package” on page 15
C
AUTION
If the Remote CLI package is installed on your system, read
“Upgrading the VI Perl Toolkit
Package” on page 15 before you proceed.
Installing the VI Perl Toolkit Package on Linux
You can install the VI Perl Toolkit on a number of Linux platforms.
Red Hat Enterprise Linux (RHEL) 5
Ubuntu Desktop 7.1
SUSE Enterprise Server 10 (SP1)
Fedora Core 8
Installation Prerequisites
This section lists installation prerequisites. In addition to the listed prerequisites, you need a development environment including a C compiler.
Operating System Prerequisites
The Perl installation script for the VI Perl Toolkit is supported on default installations of the supported Linux distributions, which are listed above.
To install the VI Perl Toolkit on a different Linux distribution, you must install all prerequisite libraries using the mechanism appropriate for the distribution (apt, rpm, and so on). See the documentation for the Linux distribution for details.
VMware, Inc.
11
Installation Guide
Prerequisite Libraries
The VI Perl Toolkit installer for Linux distributions requires the following libraries:
Perl 5.8 or later
The following libraries, which might be included in your Linux distribution:
Linker utility (binutils package)
GNU C libraries (glibc or libc6 package)
XML DOM/SAX libraries (libxml2 package)
Perl documentation (perl-doc) package.
Perl URI library (liburi-perl package).
The OpenSSL library (libssl-dev package), which is not included in the base Linux distribution. See
Finding and Installing OpenSSL
.
The VI Perl Toolkit uses Open SSL for the communication between the VirtualCenter Server or ESX Server host and the system from which you call toolkit scripts to administer that server.
Finding and Installing OpenSSL
This section explains how to install the OpenSSL library on each supported Linux distribution.
N
OTE
These instructions are included for your convenience only. File names or the installation process might be different on your system.
Red Hat Enterprise Linux 5
The Red Hat Enterprise Linux (RHEL 5)installation DVD includes the OpenSSL package.
To Install OpenSSL on RHEL 5
1 Insert the installation DVD.
The system displays the DVD on the desktop.
2 From the terminal console, use rpm to install OpenSSL.
The precise filenames depend on your particular installation DVD. Here’s an example: cd "/<the mount point>/Server" rpm -i e2fsprogs-devel.1.39-8.el5.i386.rpm rpm -i krb5-devel-1.5-17.i386.rpm rpm -i zlib-devel-1.2.3-3.i386.rpm rpm -i openssl-devel-1.2.9-8.1.i386.rpm
For 64‐Linux you need to use the corresponding 64‐bit packages, for example, rpm -i e2fsprogs-devel.1.39-8.el5.x86_64.rpm
.
12 VMware, Inc.
Chapter 2 Installing a VI Perl Toolkit Package
Fedora Core 8
The Fedora Core 8 installation DVD includes the OpenSSL package.
To install OpenSSL on Fedora Core 8
1 Insert the Fedora installation DVD.
The system displays the DVD on the desktop.
2 From the terminal console, look for OpenSSL.
The actual file names displayed might differ. Here’s an example: cd "/media/Fedora 8 i386 DVD/Fedora" rpm -i e2fsprogs-devel-1.39-11.i386.rpm
rpm -i krb5-devel-1.6-6.i386.rpm
rpm -i zlib-devel-1.2.3-10.fc7.i386.rpm
rpm -i openssl-devel-0.9.8b-12.fc7.i386.rpm
SUSE Enterprise 10 (SP1)
The SUSE Enterprise 10 installation DVD includes the OpenSSL package.
To install OpenSSL on SUSE Enterprise 10
1 Insert the SUSE installation DVD.
The system displays the DVD on the desktop.
2 From the terminal console, enter: cd /media/SLES10SP_001/suse/i586 rpm -i openssl-devel-0.9.8a-18.15.i586.rpm
Ubuntu Desktop 7.1
Ubuntu uses apt (advanced packaging tool) to keep a local repository of libraries up‐to‐date.
N
OTE
Ubuntu requires that perl-doc and liburi-perl are included on your system. Install them when installing OpenSSL if they are not already installed. The process is the same as for OpenSSL, discussed next.
To install OpenSSL on Ubuntu Desktop 7.1
1 Make sure that your system is properly configured and connected to the Internet.
2 Update the local repository of libraries by entering into the terminal console: sudo apt-get update
3 Install the OpenSSL library by entering into the terminal console: sudo apt-get install libssl-dev
Installing the VI Perl Toolkit
This section explains how to unpack and install the VI Perl Toolkit using the Linux installer. Before you start the installation, you must download the package. See
“Downloading the Perl Toolkit Binary” on page 7.
For some important upgrade information, see “Upgrading the VI Perl Toolkit Package” on page 15.
To install the VI Perl Toolkit
1 Untar the VI Perl Toolkit binary you downloaded.
2 Launch the installer.
/<location>/vmware-install.pl
The installer prompts you to accept the terms of the license agreement.
VMware, Inc.
13
Installation Guide
3 Enter yes at the prompt to accept the license terms and continue.
If you do not type yes in full and press Enter, the installer cannot continue.
The installer prompts you to provide an installation location or to accept the default, which is /usr/bin.
4 Specify an installation directory or press Enter to accept the default.
The installer searches for required Perl libraries, noting any differences between the required version level and that of the installed version. If the installer finds an older version than the required version, the installer displays the following message:
The following Perl modules were found on the system but may be too old to work with VIPerl:
In that case, installing the current version of the library is recommended.
When the installation process completes:
A success message appears.
The installer lists different version numbers for required modules (if any).
The prompt returns to the shell prompt.
You can now run sample scripts or utility applications to test your installation. See
VI Perl Toolkit Installation,” on page 23.
If you accepted the defaults during installation, the utility applications and samples subdirectories are in the following locations:
Utility applications – /usr/lib/vmware-viperl/apps
Sample scripts – /usr/share/doc/vmware-viperl/samples
Uninstalling the VI Perl Toolkit
You can uninstall the VI Perl Toolkit at any time by running the vmware-uninstall-viperl.pl script, as follows:
/<location>/bin/vmware-uninstall-viperl.pl
The default location is usr. If you specified a non‐default installation location, use that location.
Installing the VI Perl Toolkit on Windows
You can install the VI Perl Toolkit package on the following Windows platforms:
Windows XP (SP 2)
Windows 2003 Server (SP 2)
The Windows installer includes the ActivePerl runtime from ActiveState and all required Perl modules and libraries. If Perl installed is already installed on the target Windows system, you may be prompted to remove it.
If you don’t want to remove an existing Perl engine, consider using the virtual appliance instead. See
14 VMware, Inc.
Chapter 2 Installing a VI Perl Toolkit Package
To install the VI Perl Toolkit using the Windows installer
1
Launch the installer by executing the executable you downloaded (see “Downloading the Perl Toolkit
If an earlier version of Perl, the VI Perl Toolkit, or the Remote CLI package exists on the target Windows system, the installer informs you that it will overwrite that version. For important compatibility information, see
“Upgrading the VI Perl Toolkit Package” on page 15.
C
AUTION
The installation wizard overwrites any existing Perl installation with ActivePerl. If you want to keep your existing Perl installation, cancel the installation process and install the VI Perl Toolkit on a different system.
If the Remote CLI package is installed on your system, the Installation wizard removes the Remote CLI scripts. If you want to keep the scripts, cancel the installation process and install the VI Perl Toolkit on a different system.
2 Click Next in the Welcome page to continue.
The Destination Folder dialog displays.
3 If you don’t want to install the toolkit in the default directory, click Change and choose a different directory. The default location is \Program Files\VMware\VMware VI Perl Toolkit\Perl.
4 Click Next to continue.
The Ready to Install the VMware VI Perl Toolkit components dialog box displays.
5 Click Install to proceed with the installation.
The process might take a few minutes to complete.
After the Installation wizard completes, you can test the installation by running one of the sample scripts or one of the utility applications. See
“Validating the VI Perl Toolkit Installation” on page 23.
Uninstalling the VI Perl Toolkit
You can uninstall the VI Perl Toolkit from a Windows system at any time using the Add or Remove Programs control panel.
Upgrading the VI Perl Toolkit Package
Different versions of the VI Perl Toolkit support connectivity to different versions of VMware Infrastructure,
.
Table 2-1. VI Perl Toolkit and VMware Infrastructure
VI Perl Toolkit
Version 1.0
Version 1.0_RCLI
(This version is included with the Remote CLIs but not shipped separately).
Version 1.5
VMware Infrastructure Hosts
ESX Server 3.0.x
VirtualCenter Server 2.0.x
ESX Server 3 version 3.5
ESX Server 3i version 3.5
VirtualCenter Server 2.5
ESX Server 3.0.x and ESX Server 3.5.x
VirtualCenter Server 2.0 and
VirtualCenter Server 2.5
VMware, Inc.
15
Installation Guide
Because of the differences in connectivity, an upgrade of different versions has different effects, as shown in
:
Table 2-2. Upgrading VI Perl Toolkit
Installed Product Upgrade Product
VI Perl Toolkit 1.0
VI Perl Toolkit
1.0_RCLI
VI Perl Toolkit 1.0
VI Perl Toolkit
1.0_RCLI
VI Perl Toolkit 1.5
VI Perl Toolkit 1.5
Remote CLI 1.5
Remarks
This upgrade replaces a product with connectivity to ESX Server 3.0 and VirtualCenter 2.0 hosts with a product with connectivity to ESX
Server 3.5 and VirtualCenter 2.5 hosts.
C
AUTION
: If you perform this upgrade, you can no longer connect to
ESX Server 3.0 and VirtualCenter 2.0 hosts. Install the Remote CLI package on a different system.
This upgrade replaces a product with connectivity to ESX Server 3.0 and VirtualCenter 2.0 hosts with a product with connectivity to ESX
Server 3.0 and VirtualCenter 2.0 hosts as well as ESX Server 3.5 and
VirtualCenter 2.5 hosts. No potential issues.
This upgrade removes the Remote CLI installation, including all
Remote CLI scripts. It installs a product with connectivity to ESX
Server 3.0 and VirtualCenter 2.0 hosts as well as ESX Server 3.5 and
VirtualCenter 2.5 hosts.
C
AUTION
: If you perform this upgrade, all RCLI scrips are removed.
Install the VI Perl Toolkit package on a different system, or wait for the
Remote CLI 1.5.
No potential issues VI Perl Toolkit
1.0_RCLI
VI Perl Toolkit 1.5
Remote CLI 1.5
No potential issues.
16 VMware, Inc.
3
Installing and Using the VI Perl
Toolkit Virtual Appliance
3
The VI Perl Toolkit virtual appliance is a virtual machine that has a pared‐down Linux (Debian 3.1) distribution with all VI Perl Toolkit software preinstalled. It includes the Perl engine and required libraries, as well as VI Perl Toolkit components, utility applications, and sample scripts. The virtual appliance is distributed in OVF format, which means that you can import it into ESX Server 3 version 3.5 or ESX Server 3i version 3.5. If you wish to run the virtual appliance on a hosted product, you can use the OVF Tool to convert the OVF format virtual machine to the format you require.
N
OTE
This chapter gives precise instructions only for ESX Server hosts. If you want to install the virtual appliance on a different VMware product, this chapter lists only the tasks involved but does not give detailed information.
This chapter discusses installing and using the VI Perl Toolkit virtual appliance in the following sections:
“
Installing and Using the Virtual Appliance on ESX Server Hosts ”
“Installing and Using the Virtual Appliance on Hosted Products” on page 18
Installing and Using the Virtual Appliance on ESX Server Hosts
This section discusses preparing for import, importing the virtual appliance, and running the virtual appliance.
Preparing for Import
Before you import the virtual appliance, you must download it from http://www.vmware.com/download/sdk/index.html
. You are prompted to accept a license agreement.
Importing the Virtual Appliance
After you have downloaded the virtual appliance or found it on the Virtual Appliance Marketplace, you can start importing the virtual appliance.
To import the virtual appliance
1 Using a VI Client, connect to a VirtualCenter Server or an ESX Server host.
2 In the Inventory pane, select the import host for the appliance.
3 Choose File > Virtual Appliance > Import.
The Import Virtual Appliance wizard is launched and offers these options on the first page:
Click Import from File, browse to an OVF file you already downloaded, and click Next.
Click Import from URL, browse to the virtual appliance’s location in the Virtual Appliance marketplace, and click Next.
VMware, Inc.
17
Installation Guide
4 Specify a name (optional), and choose a location for the virtual machine.
The wizard offers all data stores that are available and appropriate.
5 Choose the data store to store the virtual machine on and click Next.
6 Review the information and click Finish.
The wizard creates an appliance virtual machine on the server you selected in Step 2. This might take a few minutes.
Running the Virtual Appliance
After the Import Virtual Machine wizard completes successfully, an appliance virtual machine appears in the
VI Client inventory pane.
To run the virtual appliance
1 Select and power on the virtual machine.
If you are unfamiliar with virtual machines, consider using the Getting Started guide available from the
Getting Started tab.
2 Select the Console tab and click inside the console. You can now start typing.
N
OTE
To return the mouse cursor focus to your main system, press Ctrl+Alt.
3 Accept the End User License Agreement and provide a password for the root account to log in to the machine.
4 When prompted, log in as the network administrator with the root account password.
5 Accept the defaults to let the system assign a DHCP address to the virtual appliance unless you want to use a static IP address for the virtual machine.
Contact your administrator if you want to use a static IP address.
6 After the network has been configured, log in as root with the password you established in Step 3.
You can now run VI Perl Toolkit commands from the console screen prompt, or use terminal software such as Putty to log in to the virtual machine and run commands from there. The samples and utility applications are installed in the same location as on other Linux systems:
Utility applications –
/usr/lib/vmware-viperl/apps
Sample scripts –
/usr/share/doc/vmware-viperl/samples
You must supply connection information each time you run a command. See the VI Perl Toolkit
Programming Guide for more information.
Installing and Using the Virtual Appliance on Hosted Products
Most users want to install the virtual appliance on an ESX Server host. However, if you wish to use one of the hosted products such as VMware Player or VMware Workstation, you can do so using OVF Tool.
To install and run the virtual appliance on hosted products
1 Download the virtual appliance OVF to your local machine.
2 Download OVF Tool to your local machine.
3 Use OVF Tool to convert the virtual appliance to the format your platform requires.
4 Follow the steps listed in
“To run the virtual appliance” on page 18.
18 VMware, Inc.
4
Installing the VI Perl Toolkit from
Source Code
4
Some developers prefer to install the VI Perl Toolkit from source code instead of installing a complete package.
You can install the VI Perl Toolkit from source code on any platform that supports Perl.
N
OTE
This chapter does not provide detailed installation instruction. You are expected to know how to install the prerequisite software using CPAN or another mechanism.
Consider using the VI Perl Toolkit appliance or one of the VI Perl Toolkit packages if have no experience installing from source code.
This chapter discusses source code installation in the following sections:
“Installing the Toolkit on Linux” on page 19
“Installing the Toolkit on Windows” on page 20
Installing the Toolkit on Linux
This section discusses the installation requirements and the installation process on Linux.
Requirements
Before you install the VI Perl Toolkit, make sure that the following software is installed on your system.
Perl 5.8 or later
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]
N
OTE
You can obtain and install any missing modules using CPAN. See http://www.cpan.org/ . You can also use the CPAN module included with your Perl installation.
VMware, Inc.
19
Installation Guide
Installation
The VI Perl Toolkit source code package contains a single platform‐independent compressed file, available from the SDK download page at http://www.vmware.com/download/sdk/index.html
. For download
instructions, see “Downloading the Perl Toolkit Binary” on page 7.
To build the VI Perl Toolkit
1 Open a Linux shell session and change to the directory in which you downloaded the package, for example: cd /tmp
2 Unzip the package if necessary and extract the files from the package, for example: gunzip filename.tar.gz tar xf filename.tar
3 Change to the directory containing the extracted files and review the README file for information about licensing, additional requirements, and late‐breaking information: cd viperltoolkit less README
4 Execute the Makefile.PL for the toolkit. cd /tmp/viperltoolkit perl Makefile.PL
If any of the Perl prerequisites are missing, warning messages, such as the following display:
Warning: prerequisite Data::Dumper 2.121 not found. We have 2.12.
In that case, you must finish installing all prerequisites before you proceed. See
5 Build the toolkit files: make
6 Test that the build succeeded: make test
Installing the Toolkit on Windows
This section discusses the installation requirements and the installation process on Windows.
Requirements
Before you install the VI Perl Toolkit, make sure that the following software is installed on your system:
Perl 5.8 or later. You can obtain and install the most recent version of ActivePerl from ActiveState from http://www.activestate.com/ .
Several supporting Perl modules:
XML‐LibXML‐Common
XML‐LibXML
Crypt‐SSLeay
Data‐Dumper
Class‐MethodMaker
You can install the required modules and packages using the Perl Package Manager.
Microsoft nmake, which you can obtain from http://support.microsoft.com/kb/132084 .
20 VMware, Inc.
Chapter 4 Installing the VI Perl Toolkit from Source Code
To build the VI Perl Toolkit
1 Launch a Windows console session (cmd.exe).
2 Navigate to the location of the VI Perl Toolkit download and run this command:
perl Makefile.PL
The console displays progress:
Writing Makefile for VIPerlToolkit
3 Enter nmake at the command prompt:
4 Enter nmake install at the command prompt:
The console displays status information while the VI Perl Toolkit components are installed. After a few seconds, the process completes. You can now validate the installation by executing a command. See
“Validating the VI Perl Toolkit Installation” on page 23.
N
OTE
For detailed step‐by‐step instructions for installation on Windows, see Richard Gersthagen’s excellent
Web site http://www.run‐virtual.com
.
VMware, Inc.
21
Installation Guide
22 VMware, Inc.
5
Validating the VI Perl Toolkit
Installation
5
You can confirm successful VI Perl Toolkit installation by running any one of the utility applications or by running one of the sample scripts.
If you accepted the defaults during installation, you can find these scripts in the following locations:
Utility Applications
Sample Scripts
C:\Program Files\VMware\VMware VI Perl Toolkit\Perl\apps
/usr/lib/vmware-viperl/apps
C:\Program Files\VMware\VMware VI Perl Toolkit\Perl\samples
/usr/share/doc/vmware-viperl/samples
Running a Sample Script
The installer places the samples subdirectory in the following location by default:
/usr/share/doc/vmware-viperl/samples
N
OTE
None of the scripts in the samples directory are supported. You can, however, modify and test the scripts and use them in your applications.
The /samples/discovery/datacenterlisting.pl script is a choice for validating your installation. The script obtains a list of ESX Server hosts and associated virtual machines running in a VirtualCenter Server’s datacenter. You must pass to the script (as a parameter) the name of the VirtualCenter Server and the name of the data center.
To run the script
1 Navigate to the samples subdirectory, which is in the following location by default:
Linux
Windows
/usr/share/doc/vmware-viperl/samples
C:\Program Files\VMware\VMware VI Perl Toolkit\Perl\samples
2 To execute the script, follow these steps: a Enter perl. b Enter the precise name of the script, including the path within the samples directory, using precisely matching capitalization.
c Enter any required parameters (and optional parameters as appropriate).
For example, for the datacenterlisting script, enter this command:
perl discovery/datacenterlisting.pl --server '<servername_or_ip_address>' --datacenter
'<datacenter_name>'
Specify a VirtualCenter Server not an ESX Server host with the --server parameter.
VMware, Inc.
23
Installation Guide
You are prompted for a user name and password. You can also supply the user name and password on the command line. Place quotes around host names and data center names that include special characters
(single quotes on Linux and double quotes on Windows).
For example:
Linux
Windows perl discovery/datacenterlisting.pl --server Server42 --datacenter
‘Primary_Datacenter’ --username Frog --password ‘princ#’ perl discovery/datacenterlisting.pl --server Server42 --datacenter
“Primary_Datacenter” --username Frog --password “princ#”
24 VMware, Inc.
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project