Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9117479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:54:18+00:00 2026-06-17T04:54:18+00:00

Does any one know of the specifics for running Perl scripts against an VMware

  • 0

Does any one know of the specifics for running Perl scripts against an VMware ESXi 5.1 server that I have at home? I have downloaded the following and installed the packages on a Ubuntu 12.04 LTS machine but I don’t know how to get started.

VMware-vSphere-CLI-5.1.0-780721.x86_64.gz
VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.gz
VMware-vSphere-SDK-5.1.0-774886.zip

When packages were installed, I ensured that all the Perl module dependencies were met. What do I do next? E.g. How would I just query for a list of VMs running on the ESXi server in Perl?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:54:19+00:00Added an answer on June 17, 2026 at 4:54 am

    Check the code below to get the VM names:

    #!/usr/bin/perl -w
    use strict;
    use VMware::VIRuntime;
    
    my %opts = (
                   datacenter => {
                            type        => "=s",
                            help        => "Enter the Dacenter Name",
                            required    => 1,
                        },
                );
    
    Opts::add_options(%opts);
    Opts::parse();
    Opts::validate();
    Util::connect();
    
    my $dc = Opts::get_option("datacenter");
    my $datacenter = Vim::find_entity_view ( view_type      => "Datacenter",
                                             properties     => [ "name" ],
                                             filter         => { name => $dc },
                                        );
    
    my $vms = Vim::find_entity_views ( view_type       => "VirtualMachine",
                                       properties      => [ "name" ],
                                       begin_entity    => $datacenter,
                                    );
    
    foreach my $vm ( @$vms )
    {
        print $vm->name."\n";
    }
    Util::disconnect();
    

    Run above script as below:

    perl vm_list.pl  --server <vCenter_server_name> --datacenter <Datacenter_name>
    

    Of course above code wont make any sense to you unless you read vSphere perl SDK documentation. refer below links to get you started:

    sample code with explantion of vpshere objects: http://www.vmware.com/support/developer/viperltoolkit/doc/perl_toolkit_guide_idx.html

    API reference Guide: http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fright-pane.html

    client Object: http://pubs.vmware.com/vi301/admin/wwhelp/wwhimpl/common/html/wwhelp.htm?context=admin&file=BSA_Inventory.9.2.html

    General API docs: http://www.vmware.com/support/developer/viperltoolkit/

    and http://www.google.com

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does any one know how I would have to change the following to work
Does any one know why the location indicator stay on for certain bundle identifer
does any one know how to make the slide to left effect like in
Does any one know in which programming language were Google Talk application developed. yes
Does any one know what is the exact usage of xmlns in HTML, XML
Does any one know if there is kinda implementation/addon for VS 2008 SP1 for
Does any one know when Microsoft intends to stop supporting Visual Studio 2002?
Does any one know how to connect my c# console application to .net remoting
Does anyone know if it is possible to have a Python script running in
I'm running a Perl script that someone else wrote for me, and I've noticed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.