Solved

VMware perl script

Posted on 2010-09-20
2
738 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 23

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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

749 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