A. Mikkelsen VMware ESX scripts, commands, tools and other nice to know things that will make your virtualization days easier!!!!

Thursday, December 6, 2007

The power of VIPerlToolkit

Filed under: Scripting,Virtual Center — A. Mikkelsen @ 21:23 pm

Over the past 2 weeks i have been playing around with the VIperlToolkit and discovered hwo easy and powerfull it is. Some of the scripts i have created is avaiable for download in the Download section of this site.

I first came accross the VIPerlToolkit about 8 months ago when looking through www.run-virtual.com.
I got inspired by Richards script that created and updated custom fields in Virtual Center, and i decided to add some more information to my Virtual Center.

Below is a screenshot of my Virtual Center witch is running version 1.1 of vcinfo.pl

The script automatically updates the following information in Virtual Center:

  • All virtual networks attached
  • List if VM has snapshots
  • The path and name of the VMX file
  • The size of each attached VMDK file
  • The path and name of each VMDK file
  • The freespace in each VMDK file
    (Requires VMwareTools to be running)

To run the script you need to install ViPerlToolkit and Perl on your VirtualCenter server (Howto from www.run-virtual.com).
Or run tit in the VMware ViPerlToolkit Appliance (Download it from www.vmware.com).

This will not be my last script 😉

A. Mikkelsen


  1. […] I have updated the vcinfo.pl script so it also lists if a VM has snapshots. http://www.amikkelsen.com/?p=44 […]

    Pingback by A. Mikkelsen » Blog Archive » New and updated scripts — Monday, December 17, 2007 @ 22:00 pm

  2. Hi,

    I tried your script and got the following error:
    [vmtool@VIPERL test]$ ./vcinfo.pl
    Can’t use an undefined value as an ARRAY reference at ./vcinfo.pl line 235.
    [vmtool@GF0VSXMG56 test]$

    Do you have an idea?

    Thank you very much for your help and sharing your script

    Comment by Chris — Tuesday, January 29, 2008 @ 10:01 am

  3. The error is in the part of the script that add info for VM’s with Tools installed.
    Have you installed VMware tools in any of your VM’s ?
    If not try and see if the script fails.

    Comment by amikkelsen — Friday, February 1, 2008 @ 15:31 pm

  4. Hi,

    I’m new to this and more from the administration side then development. You’re script is great and very helpful, but I was wondering how you revert things back to normal again? Basically changing things back to the default view and removing the columns.


    Comment by Tyler — Thursday, March 27, 2008 @ 1:35 am

  5. Hi Tyler,

    Thanks for your feedback.
    You can delete all colums from within VC.
    1. Under the Administration menu choose Custom attributes.
    2. Select the attributes that you want to delete and press remove.

    A. Mikkelsen

    Comment by amikkelsen — Thursday, March 27, 2008 @ 21:15 pm

  6. Very nice script. A great addition would be whether the VM has an image attached or not. Thanks!

    Comment by RRock — Friday, June 20, 2008 @ 21:59 pm

  7. Hi RRock

    Great idear, i’ll see if i can add it within next month – really bussy at work.

    A. Mikkelsen

    Comment by A. Mikkelsen — Wednesday, June 25, 2008 @ 22:02 pm

  8. Great stuff, Just a quick somewhat related question, I do not want to clog too much the “Virtual Machines” tab, do you know if we can add a tab to VC ?

    Comment by Jax — Sunday, July 6, 2008 @ 5:43 am

  9. HI Jax,
    I haven’t been able to find any information on howto add a tab from Perl Toolkit.
    And as far as i know the only way you can add a tab to VC is to use MS .NET.
    Take a look at this PDF from Schley Andrew Kutz.

    A. Mikkelsen

    Comment by A. Mikkelsen — Monday, July 7, 2008 @ 7:54 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress