在没有vCenter的情况下通过REST API创建VM

问题描述 投票:0回答:3

是否可以通过REST API在没有vCenter的情况下运行ESX的服务器创建VM(或任何其他任务)?

或者必须在服务器上安装vCenter?

我检查了这些链接,但他们使用vCenter:

https://www.youtube.com/watch?v=14WeRVv3NDo https://blogs.vmware.com/code/2017/02/02/getting-started-vsphere-automation-sdk-rest/

vmware vsphere esx
3个回答
1
投票

创建VM应该可以直接使用ESXi服务器,但是无法克隆现有VM或模板。 vSphere API可以通过直接连接到ESXi来实现。

如果你真的想要REST API,你可以试试第三方:https://github.com/DoubleCloudInc/vim-rest-api/(免责声明:我是作者)。


0
投票

可以通过vSphere Client或vSphere Management API创建VM。无需安装vCenter Server。

通过vSphere Client创建VM的示例:https://www.youtube.com/watch?v=ddUs5FsczzY

通过开源pyvmomi SDK创建VM的示例:https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/create_random_marvel_vms.py

通过开源的rbvmomi SDK创建VM的示例:https://code.vmware.com/samples/781/create-vm?h=vm%20create

这可以通过其他几个SDK以及CreateVM_Task方法的使用来完成。

有关此方法的更多信息,请访问:http://pubs.vmware.com/vsphere-6-5/index.jsp?topic=/com.vmware.wssdk.apiref.doc/index.html&single=true

然后选择“所有方法”并搜索“CreateVM_Task”


0
投票

vSphere没有休息api,但您可以下载vSphere Web Services SDK并执行相同的操作。

这是它的文档:

http://pubs.vmware.com/vsphere-5-5/index.jsp#com.vmware.wssdk.dsg.doc/sdk_sg_introduction.3.2.html

© www.soinside.com 2019 - 2024. All rights reserved.