Convert vSphere OVA in datastore to vSphere template Terraform

510 views Asked by At

Given a starting point of OVAs in a vSphere datastore, I want to be able to create VMs with Terraform.

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. 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.

I know that I can create an vSphere template using, say, Packer from an ISO. Probably I could do the same from an 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.

Any ideas, please, on how to use Terraform to go from an OVA in a vSphere datastore to a vSphere template?

Many thanks

Nathan

This question is similar to, but not the same as: Deploy virtual machine cloning OVF/OVA from datastore vsphere

1

There are 1 answers

1
Kyle Ruddy On

Unfortunately, this is a vSphere limitation. There's never really been support for OVAs being provisioned from a datastore, regardless of toolset.

You could probably look at the way the OVA is being generated and take a step back from having it uploaded to the datastore. At that point you could use Terraform to upload it to a Content Library, then deploy VMs from the content library item.

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.