vSphere SDK for Perl 6.0
|
Released 12 Mar 2015 Build 2503617 is the 6.0 release of the vSphere SDK for Perl. |
Welcome to the vSphere SDK for Perl 6.0 release.
The vSphere SDK for Perl provides an easy-to-use Perl scripting interface to the vSphere Web Services API.
This document contains the following information:
See the vSphere Command-Line Interface Release Notes for information about vSphere CLI issues.
The vSphere SDK for Perl is a client-side Perl framework that provides an easy-to-use scripting interface to the vSphere Web Services SDK . Administrators and developers who are familiar with Perl can use the vSphere SDK for Perl to automate a wide variety of administrative, provisioning, and monitoring tasks in the vSphere environment. The vSphere SDK for Perl includes ready-to-use utility applications, which you can immediately put to use in your virtual data center.
The vSphere SDK for Perl installation includes the WS-Management Perl Library, which allows you to write scripts that retrieve CIM data from the ESX host using CIMOM, a service that provides standard CIM management functions over a WBEM (Web-Based Enterprise Management). The installation also includes the vSphere CLI command set.
You can use the vSphere SDK for Perl to manage ESXi 5.x, ESXi 6.0, vCenter Server 5.x, and vCenter Server 6.0.
To connect to an ESXi host in an environment that has an embedded Platform Services Controller instance, run commands like this:
#perl connect.pl --psc <platform_services_controller_hostname_or_ip> --username administrator@vsphere.local --password <pwd> --vihost <esxi_hostname_or_ip>
To connect to an ESXi host in an environment that has an external Platform Services Controller instance and multiple vCenter Server instances, run commands like this:
#perl connect.pl --server <vcenter_hostname_or_ip> --psc <platform_services_controller_hostname_or_ip> --username administrator@vsphere.local --password <pwd> --vihost <esxi_hostname_or_ip>
For this release, vCLI is supported on the following Linux platforms:
For this release, vCLI is supported on the following Windows platforms:
The vSphere Management Assistant (vMA) is included in this release. You cannot upgrade vMA to include vCLI 6.0 by running the vCLI installer inside vMA. Deploy the new vMA appliance.
You can install the vSphere SDK for Perl on supported Windows and Linux platforms. The Linux installer behaves differently for RHEL and for other Linux distributions.
On RHEL, the installer prompts you whether you want to install required Perl modules from the installation package or from CPAN. You can install from the package if you do not have Internet access.
<install_dir>/vmware-uninstall-vSphere-CLI.pl
. The default installation directory is /usr/bin
. rm -rf <install_dir>/vmware-vsphere-cli-distrib
The vSphere SDK for Perl Linux installer stops installation if required modules cannot be found on your Linux system. The installer installs other missing Perl modules, but does not overwrite existing versions of those modules. See the vSphere SDK for Perl Installation Guide.
For other supported Linux distributions, the SDK for Perl installer works the way it did for earlier versions of the vSphere SDK for Perl. If you have Internet access, you can direct the RHEL installer to follow this procedure.
export http_proxy=http://<proxy_server>:port
export ftp_proxy=http://<proxy_server>:port
Note: Downloading modules from CPAN can take a long time.
See the vSphere SDK for Perl Installation Guide.
The vSphere SDK for Perl Windows installer works as before and installs the vSphere SDK for Perl, the vSphere CLI, and all prerequisite software including Active Perl 5.14.4. If you do not want to overwrite an existing Active Perl installation, exit the installer and use a different system for installing the software.
Important: Reboot your Windows system after installation. If you don't, ActivePerl might report that it cannot find some of the Perl modules.
vSphere SDK for Perl 6.0 has the following known issues:
Missing DLL error during first command execution after installation (Windows).
A vSphere SDK for Perl installation on Windows completes successfully. However, when you later run a script, errors about missing DLLs might result. For example:
libxml2.dll wasn't found
Workaround: Reboot your Windows system.
Obtaining objects of different types requires multiple calls to the Vim::get_views() subroutine. The Vim::get_views()
subroutine takes a reference to an array of managed object references and returns a reference to an array of view objects. Although the array can contain multiple managed object types, objects of only one type can be obtained at the same time.
Workaround: You can call get_views()
multiple times to obtain multiple object types. Or you can specify the appropriate base class (rather than a specific subclass) as the view type to access values of properties that are common across all objects based on the superclass. For example, view_type = 'ManagedEntity'
allows you to retrieve all objects that extend from this base class (VirtualMachine
, HostSystem
, Folder
, ResourcePool
, and so on).
Must use encoded representation when constructing filters that recognize names containing certain special characters. Based on what the vSphere Web Services API returns, a few property values, such as ManagedEntity.name
, VirtualMachineConfigInfo.name
, and VirtualMachineConfigSpec.name
, are returned with the characters /, \, and % encoded as %2f, %5c, and %25.
For example, if you have a Folder named My%Folder
, its name is returned as My%25Folder
. If you want to construct a filter that recognizes names containing slashes or percent signs, you must use the encoded representation.
Workaround: To match a name that contains a percent sign, write:
filter => { name => qr/%25/ }
You cannot perform a match on percent sign alone, because a percent sign alone also matches other characters that are preceded by a percent escape character.
filter => { name => qr/%/ } # wrong;
You must use case-insensitive matching for escape character sequences that contain alpha characters:
filter => { name => qr/%2f/i } # matches %2f and %2F