Solved

VMware perl script

Posted on 2010-09-20
2
736 Views
Last Modified: 2013-12-25
Hello,

I need some ideas on how to write a VI perl script for Linux which returns various information about the VM. Say for example:

$ ./vmsearch foo
> VI server it is running on
> Esx cluster it is running on
> Esx host it is running on
> Data store

In the above example, foo is the name of the VM I want to search. Invoking from command line ./vmsearch foo, should return those values. Any good ideas, good approach, good practice would be good, since I'm new to perl and VMware. I'm probably a little early to post this question here, because I havent given this much thoughts yet, but again the idea is to get some thoughts, technical/not so technical, code/not so code related etc..
0
Comment
Question by:smary
2 Comments
 
LVL 22

Accepted Solution

by:
65td earned 250 total points
ID: 33721535
Here is some information on a script with more that what you wanted.
http://communities.vmware.com/docs/DOC-9420

Too bad one wasn't asking for Powershell scripts, such as healthcheck.
http://sourceforge.net/projects/esxhealthscript/
0
 
LVL 22

Assisted Solution

by:Luciano Patrão
Luciano Patrão earned 250 total points
ID: 33721600
Hi

With vSphere SDK for Perl 4.1 you have all this information and all the perl scripts

http://www.vmware.com/support/developer/viperltoolkit/

Just install the SKD for perl, and then in the folder VMware\VMware vSphere CLI\Perl\apps you will find many folders with perl scripts inside that extract that information(for host, datastore, VMs info, etc)

Hope this can help you

Jail
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When converting a physical machine to a virtual machine using VMware vCenter Converter Standalone or vCenter Converter Enterprise, if an adapter type is not selected during the initial customization the resulting virtual machine may contain an IDE d…
Last article we focus in how to VMware: How to create and use VMs TAGs – Part 1 so before follow this article and perform the next tasks, you should read the first article how to create the TAG before using them in Veeam Backup Jobs.
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question