简体   繁体   English

将数据存储中的 vSphere OVA 转换为 vSphere 模板 Terraform

[英]Convert vSphere OVA in datastore to vSphere template Terraform

Given a starting point of OVAs in a vSphere datastore, I want to be able to create VMs with Terraform.鉴于 vSphere 数据存储中 OVA 的起点,我希望能够使用 Terraform 创建 VM。

It seems that this specific use case is not supported.似乎不支持此特定用例。 I can have an OVA local, or at a URL, but not in a datastore.我可以在本地或 URL 有一个 OVA,但不能在数据存储中。 I am happy to be wrong about this.我很高兴在这件事上是错的。

Ideally, what I want to do is use Terraform to go from the OVA in the vSphere datastore to a vSphere template.理想情况下,我想要做的是使用 Terraform 到 go 从 vSphere 数据存储中的 OVA 到 vSphere 模板。

I know that I can create an vSphere template using, say, Packer from an ISO.我知道我可以使用来自 ISO 的 Packer 创建 vSphere 模板。 Probably I could do the same from an OVA.也许我可以从 OVA 做同样的事情。 I don't want to introduce more tools unless I have to though.除非迫不得已,否则我不想介绍更多工具。

I could also create the template manually, of course, in the vSphere GUI, but doing this manually is wrong from an IaC perspective.当然,我也可以在 vSphere GUI 中手动创建模板,但从 IaC 的角度来看,手动执行此操作是错误的。

Any ideas, please, on how to use Terraform to go from an OVA in a vSphere datastore to a vSphere template?关于如何使用 Terraform 到 go 从 vSphere 数据存储中的 OVA 到 vSphere 模板,有什么想法吗?

Many thanks非常感谢

Nathan弥敦道

This question is similar to, but not the same as: Deploy virtual machine cloning OVF/OVA from datastore vsphere这个问题类似于但不相同: Deploy virtual machine cloning OVF/OVA from datastore vsphere

Unfortunately, this is a vSphere limitation.不幸的是,这是 vSphere 的限制。 There's never really been support for OVAs being provisioned from a datastore, regardless of toolset.无论使用何种工具集,都从未真正支持从数据存储中配置 OVA。

You could probably look at the way the OVA is being generated and take a step back from having it uploaded to the datastore.您可能会查看 OVA 的生成方式,然后退一步将其上传到数据存储区。 At that point you could use Terraform to upload it to a Content Library, then deploy VMs from the content library item.此时,您可以使用 Terraform 将其上传到内容库,然后从内容库项目部署 VM。

Using Packer to build the template would also be a great use case, but that assumes you're building the OVA instead of it being a downloaded appliance or otherwise supplied.使用 Packer 构建模板也是一个很好的用例,但这假设您正在构建 OVA 而不是下载的设备或以其他方式提供。

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

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