Pages

Wednesday, November 21, 2012

Best Practices for Faster vSphere SDK Scripts

The VMware vSphere API is one of the more powerful vendor SDKs available in the Virtualization Ecosystem.  As adoption of VMware vSphere has grown over the years, so has the size of Virtual Infrastructure environments.  In many larger enterprises, the increasing number of VirtualMachines and HostSystems is driving the architectural requirement to deploy multiple vCenter Servers.

In response, the necessity for automation tooling has grown just as quickly.  Automation to create daily reports, perform bulk operations, and aggregate data from large, distributed Virtual Infrastructure environments is a common requirement for managing the increasing virtual sprawl.

In a Virtual Infrastructure comprised of thousands of objects, even a simple script to list all VirtualMachines and their associated HostSystem and Datastores can result in very slow runtime execution.  Developing automation with the following, simple best practices can take orders of magnitude off your vSphere API tool's runtime.

Thursday, November 8, 2012

Automate Adding ESXi Hosts to vCenter With SSL Thumbprint

Recently, I was asked how to automate adding ESXi hosts to vCenter with a custom Perl script.  For security purposes, vSphere vCenter requires SSL verification of the ESXi SSL certificate thumbprint.  The automation challenge is generating the SHA1 digest for the ESXi host certificate, so it can then be passed as a parameter to AddHost_Task() method.

There are two solutions for getting the SSL thumbprint before adding an ESXi host to vCenter's inventory.

Monday, November 5, 2012

Installing the vSphere SDK for Perl on OS X

Since the first Intel based Macbook Pro was introduced, Apple OS X has been my preferred platform for work and play.  While VMware Fusion makes it particularly easy to run VMware toolkits and utilities, I still prefer native versions.  I started working with the VMware vSphere SDK for Perl years ago, developing against and natively running the SDK tools on my various Mac systems ever since.

Installing the VMware vSphere SDK for Perl is actually a straightforward process.  The installation steps outlined here were tested using the vSphere SDK for Perl 5.1 and OS X Mountain Lion, but the process should work just as well on older versions of both the SDK and OS X.