VMware

Jonathan Marrott's VM Scripting Blog

A swell blog containing some of the scripts I have written for VM management.

3 Posts tagged with the vi3 tag
0

Session Keeper

Posted by froboy Mar 27, 2008

Here's a script that will create a session, save it to a session file and keep it alive. If at any time the session is terminated, the script will create a new session and new session file.

Usage: SessionKeeper.pl --server <servername> --file <session_filename_to_be_saved>

0 Comments Permalink
0

List DCs and Clusters

Posted by froboy Jan 22, 2008

These two scripts are both designed for enumeration of objects. The cluster specific script will also enumerate HA properties about that cluster.

Usage:
listdcs.pl --server lewvc --username <username> --password <password>
listdcclusters.pl --server lewvc --username <username> --password <password> --datacenter <DC Name>

0 Comments Permalink
0

VI Custom Fields

Posted by froboy Jan 7, 2008

I decided to dabble into custom fields. I have scripts to add, remove, rename and set custom fields. I also have a cool script to export your custom fields to a CSV file and vice versa.

Prerequisites:
VI 3.5 (VI API 2.5.0)
Latest VI Perl Toolkit (VMware VI Remote CLI will install this)
Text::CSV_XS (Perl module for CSVs)
Text::CSV::Simple (Perl module for CSVs)

Scripts:
addvifield.pl - Adds Custom Field to VI
cf2csv.pl - Exports Custom Fields to CSV File
csv2cf.pl - Imports CSV File to Custom Fields (Note: Custom Fields must already be created)
readdcfields.pl - Reads all Custom Fields from every VM in a datacenter
readvmfield.pl - Reads a single Custom Fields from a VM
readvmfields.pl - Reads all Custom Fields from a VM
removevifield.pl - Removes a Custom Fields from VI
renamevifield.pl - Renames a Custom Field in VI
setvmfield.pl - Assigns a value to a Custom Field in a VM
setdctools.pl - Reads VMWare Tools Version From Each VM In A Datacenter And Applies It To The Custom Field "Tools Version"

0 Comments Permalink
Click to view froboy's profile Member since: Jun 26, 2006

A swell blog containing some of the scripts I have written for VM management.

View froboy's profile

Communities