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?
Check the code below to get the VM names:
Run above script as below:
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