简体   繁体   English

对于vSphere和vCenter自动化,PowerCLI cmdlet或VIX API是更好的方法吗?

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

http://www.vmware.com/support/developer/vix-api/ has VIX docs and says it is useful for automation of interactions with ESXI and vCenter http://www.vmware.com/support/developer/vix-api/拥有VIX文档,并说它对于自动化与ESXI和vCenter的交互非常有用

vSphere PowerCLI is a command-line and scripting tool based on PowerShell that provides useful functionality for vSphere management. vSphere PowerCLI是基于PowerShell的命令行和脚本工具,可为vSphere管理提供有用的功能。

Which one is better if they both do the same, especially if I want to use C# ? 如果它们两者都相同,哪一个更好,特别是如果我想使用C#?

I started using vshpere powercli recently and I can tell you it can do everything. 我最近开始使用vshpere powercli,可以告诉您它可以执行所有操作。 It relies on powershell so, if you want to use c# is not the best choice for you. 它依赖于powershell,因此,如果您想使用c#,则不是您的最佳选择。 But think whether you really need a multiparadigm programming language like c#. 但是,请考虑是否真的需要像c#这样的多范式编程语言。

What do you need to do? 你需要做什么? Just vmware automation? 只是vmware自动化? Forget c#, use powercli + task scheduler and you are done! 忘记C#,使用powercli + Task Scheduler,您就完成了!

As empo says, the PowerCLI is a great answer if you just need some automation. 如empo所说,如果您只需要一些自动化,PowerCLI是一个很好的答案。

If you're looking at doing more complicated management, you might look at the wrapper library that the PowerCLI itself uses. 如果您要进行更复杂的管理,则可以查看PowerCLI本身使用的包装器库。 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. 安装PowerCLI之后,您会发现安装了一个VICore文档文件夹,该文件夹应该包含有关直接使用其.Net程序集的更多信息。

For some basic info about it, you can take a look at the (PDF) Developer's Guide , also available in the VICore Documentation folder. 有关此功能的一些基本信息,您可以查看(PDF) 开发人员指南 ,该指南也位于VICore Documentation文件夹中。 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. 以我的经验,该程序集比标准vSphere Web Services SDK(它只是其SOAP API的.Net存根)更易于学习和使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM