最近在做一个项目,主要是把Vmware Vsphere的数据通过RESTful API暴露给第三方,调用。
那么什么是Vmware Vsphere,或者说Vmware Vsphere是什么?
vCenter可以作为虚拟机安装在ESXi服务器上,也可以安装在独立的物理服务器上,vCenter Server主要用于大型环境中,该环境中有许多ESXi主机和虚拟机,并且需要vSphere的高级企业功能(vMotion[虚拟机迁移]、VMware High Availability[HA高可用性]、VMware Update Manager[vmware更新管理器]、VMware Distributed Resource Scheduler(DRS)[分布式资源调度])。
整体架构图
首先VMware vSphere是一个虚拟化平台,将数据中心转换为包含CPU、存储和网络资源的计算基础设施。vSphere作为一个统一的操作环境来管理这些基础设施,并提供管理这个环境的数据中心的工具。
VMware vSphere官方提供了两个主要的SDK供开发者使用。并以此获取VMware vSphere的相关数据
前者文档很清楚,且提供了.NET,Java,Python,REST,Ruby,Perl等不同语言平台的SDK,而且还都是开源的。由于本人是一个.NET从业者,有.NET的SDK,肯定优先使用.NET,但是有些数据vSphere Automation SDK无法找到相关数据。真的是脑壳大,连一整天找不到相关的数据,比如主机数量、CPU核数、内存分配等情况。无意间浏览到vSphere Automation Python SDK 的github仓库
This document describes the vSphere Automation Python SDK samples that use the vSphere Automation python client library. Additionally, some of the samples demonstrate the combined use of the vSphere Automation and vSphere APIs. To support this combined use, the vSphere Automation Python SDK samples require the vSphere Management SDK packages (pyVmomi) to be installed on the client. The samples have been developed to work with python 2.7.x and 3.3+ 翻译:文章主要描述使用vSphere Automation python 客户端库的vSphere Automation Python SDK的示例,另外,一些示例演示了vSphere Automation 和vSphere APIs组合使用,为了支持这种组合使用,这些vSphere Automation Python SDK示例就需要Sphere Management SDK 包(pyVmomi),这些示例依赖python 版本2.7.x和3.3+
其他SDK的文档中均未发现这句话,也没有相关示例,运用出色的搜商,找到了.NET版本的vSphere Management SDK,当我满心欢喜的下载下来,以为胜利就在远方,发现文档中有一句话,这不满足我们可能需要跨平台的需求,因为还需要依赖windows
Requirements
.NET framework 4.5+, Visual Studio 2012+ and Windows Driver Kit (WDK)
https://blog.csdn.net/ryu2003/article/details/82255319
https://blog.csdn.net/waterxcfg304/article/details/49863693?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase
https://blog.csdn.net/weixin_44837286/article/details/106221679?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase
https://docs.vmware.com/en/VMware-vSphere/index.html