Here is my first API post on this blog. I used to post some API scripts on OVH forums and I want to use this media to share more of them and show you how easy it is to run scripts on top on VMware infrastructure. I had a chance to present VMware Perl SDK and how it helps sysadmin on VMworld a couple of years ago.
First of all, I’m going to show you how to connect to a vSphere infrastructure and then how to list all your virtual machines. This is a quick introduction but I think it is required to understand how it works.
Thanks for reading and I hope it will be useful for your internal needs.
I run my scripts on top on a OVH Dedicated Cloud, which is basically a vSphere infrastructure. If you need anything about VMware APIs and SDKs, you can find everything here. One of the best argument on this Perl SDK is that it can run on Linux box. You can also find a python SDK, but it is less powerful than the perl one, there are a lot of call missing.
All my scripts will require one connection to a vCenter, so you need to have a login and a password with the rights you need to perform all the operations you want. For this particular use case, “read only” rights are sufficient.