For vSphere and vCenter automation, is PowerCLI cmdlets or VIX API the better approach?

1.9k views Asked by At

http://www.vmware.com/support/developer/vix-api/ has VIX docs and says it is useful for automation of interactions with ESXI and vCenter

vSphere PowerCLI is a command-line and scripting tool based on PowerShell that provides useful functionality for vSphere management.

Which one is better if they both do the same, especially if I want to use C# ?

2

There are 2 answers

0
Evan Powell On

As empo says, the PowerCLI is a great answer if you just need some automation.

If you're looking at doing more complicated management, you might look at the wrapper library that the PowerCLI itself uses. After you install the PowerCLI, you'll find a VICore Documentation folder installed with it that should have plenty of more information about using their .Net assembly directly.

For some basic info about it, you can take a look at the (PDF)Developer's Guide, also available in the VICore Documentation folder. In my experience, this assembly is much easier to learn and use than the standard vSphere Web Services SDK, which is just a .Net stub around their SOAP API.

3
Emiliano Poggi On

I started using vshpere powercli recently and I can tell you it can do everything. It relies on powershell so, if you want to use c# is not the best choice for you. But think whether you really need a multiparadigm programming language like c#.

What do you need to do? Just vmware automation? Forget c#, use powercli + task scheduler and you are done!