Solved

VMware perl script

Posted on 2010-09-20
2
734 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This is an issue that we can get adding / removing permissions in the vCSA 6.0. We can also have issues searching for users / groups in the AD (using your identify sources). This is how one of the ways to handle this issues and fix it.
HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now