Skip to content
Perl samples, language bindings, and API reference documentation for vSphere using the VMware REST API
Branch: master
Clone or download
Latest commit 2f795ec Feb 15, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
sample-template Adding sample template for automation perlsdk Oct 10, 2017
samples vSphere 6.7 Release Apr 18, 2018
.gitignore vSphere 6.7 Release Apr 18, 2018

VMware vSphere Automation SDK for Perl

Table of Contents


This document for the vSphere Automation SDK for perl describes -

  1. How to run the samples in this repository
  2. The procedure for contributing new samples

Supported OnPrem vCenter Releases:

vCenter 6.0, 6.5, 6.7 and 6.7U1

Please refer to the notes in each sample for detailed compatibility information.


The VMware vSphere Automation SDKs provide support for your client application infrastructure with services to perform management operations in your vSphere environment. The vSphere Automation SDK for Perl also contains samples that demonstrate how the libraries work with other vSphere APIs.

Quick Start Guide

This document will walk you through getting up and running with the Perl SDK Samples. Prior to running the samples you will need to setup a vCenter test environment and install local perl packages, the following steps will take you through this process.

Prerequisites in case of windows platform-

ppm install XML::LibXML UUID UUID::Random Crypt::OpenSSL::RSA Exception::Class Crypt::X509 Data::Compare Text::Template

Prerequisites in case of RHEL platform-

  • Need to install few required CPAN modules using below commands:
yum install e2fsprogs-devel libuuid-devel openssl-devel perl-devel
yum install glibc.i686 zlib.i686
yum install perl-XML-LibXML perl-Crypt-SSLeay
cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 Data::Compare List::MoreUtils

Prerequisites in case of SLES platform-

  • Need to install few required CPAN modules using below commands:
yast -i openssl-devel libuuid-devel libuuid-devel-32bit e2fsprogs-devel
  • Need to download modules (Data::Compare, Exception::Class, UUID::Random, Crypt::X509, Crypt::OpenSSL::RSA and List::MoreUtils) from CPAN site ( and follow below mentioned steps:
$tar -zxvf downloaded_module.tar.gz
$cd extracted_folder_name
$make install

Prerequisites in case of Ubuntu platform-

  • Need to install few required CPAN modules using below commands:
For Ubuntu-15.10 64 bits-
$sudo apt-get install lib32z1 lib32ncurses5 uuid uuid-dev perl libssl-dev perldoc libxml-libxml-perl libcrypt-ssleay-perl libdata-compare-perl libsoap-lite-perl

For Ubuntu-16.04 64 bits-
$sudo apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl
cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils

Note: The PERL SDK 6.5 has to be uninstalled, as the new Automation SDK for Perl 6.7U1 requires 6.7 PERL SDK as a pre-requisite.

For more info, please refer to

Supported Platforms

* Red Hat Enterprise Linux (RHEL) 7.1/7.2/7.3 (Server) 64 bit
* Red Hat Enterprise Linux (RHEL) 6.6 (Server) 64 bit
* SLES 12 64 bit
* SLES 11 SP3 64 bit
* Ubuntu 16.04 (LTS) 64bit
* Ubuntu 15.10 (LTS) 64bit
* Windows 10 64 bit

Supported Perl Versions

* Linux: Perl 5.10+
* Windows: ActivePerl 5.14+
           Strawberry Perl

Setting up a vSphere Test Environment

NOTE: The samples are intended to be run against a freshly installed non-Production vSphere setup as the scripts may make changes to the test environment and in some cases can destroy items when needed.

To run the samples a vSphere test environment is required with the following configuration

  • 1 vCenter Server
  • 2 ESX hosts
  • 1 NFS Datastore with at least 3GB of free capacity

Apart from the above, each individual sample may require additional setup. Please refer to the sample parameters for more information on that.

Download and Installation Instructions

  1. Please pick up one of the supported linux/windows platform from the Supported Platforms list.
  2. Install all required perl modules (prerequisites) as per your choosen platform.
  3. Download the vSphere SDK for Perl 6.7 (VMware-vSphere-Perl-SDK-6.X.X-XXXXX.XXXX.x86_64.tar.gz) from ( and follow below mentioned steps to install in case of linux platform.
Untar the vSphere SDK for Perl 6.7 binary that you downloaded.
$tar –zxvf VMware-vSphere-Perl-SDK-6.X.X-XXXXX.XXXX.x86_64.tar.gz
A vmware-vsphere-vcli-distrib directory is created.
Log in as superuser and run the installer.
$cd vmware-vsphere-cli-distrib
To accept the license terms, enter yes and press Enter.
To install Perl modules from CPAN, enter yes and press Enter.
Specify an installation directory, or press Enter to accept the default, which is /usr/bin.
  1. Download and extract the vSphere Automation SDK for Perl zip file to the location of your choosing
  2. Set PERL5LIB env variable or perl include path using these commands:
   * On windows platform:
     set PERL5LIB=%PERL5LIB%;SDK-root-directory-path\lib\runtime;SDK-root-directory-path\lib\sdk;SDK-root-directory-path\samples
   * On other plateforms:
     export PERL5LIB=$PERL5LIB:SDK-root-directory-path/lib/sdk:SDK-root-directory-path/lib/runtime:SDK-root-directory-path/samples

How to run the samples?

The samples directory in this distribution has sample scripts, showing how to call the VMware-vSphere-Automation-SDK-Perl API.

Use a command like the following to get list of VMs present in vCenter.

$ cd vsphere-automation-sdk-perl-master/samples/Vcenter/Vm

$ perl --server https://vCenter_server_ip --username 'user name' --password 'password'

API Documentation

vSphere API Documentation

Repository Administrator Resources

Board Members

Board members are volunteers from the SDK community and VMware staff members, board members are not held responsible for any issues which may occur from running of samples from this repository.


  • Kapil Yadav (VMware)
  • Steve Trefethen (VMware)

Approval of Additions

Items added to the repository, including items from the Board members, require 2 votes from the board members before being added to the repository. The approving members will have ideally downloaded and tested the item. When two “Approved for Merge” comments are added from board members, the pull can then be committed to the repository.

VMware Resources

You can’t perform that action at this time.