OVFTool is an extremely versatile command-line utility for importing and exporting Virtual Machines to and from the OVF/OVA format and it supports a number of VMware platforms including VMware Cloud on AWS (VMC), vSphere (vCenter Server and ESXi), Fusion, Workstation, Player and even vCloud Director (vCD).
An infrequent asks that I have seen from customers is the ability to deploy an OVF/OVA as a VM Template rather than just a Virtual Machine in a vSphere-based environment. OVFTool has had the ability to deploy to vAppTemplate for vCD-based environments, so it would make sense to also support vCenter Server VM Templates as well. Today, the workflow is a two-step process, deploy the OVF/OVA and then use the vSphere API to convert the VM to a VM Template.
With the latest OVFTool 4.3 Update 1 which was a minor release last year, we now have a new parameter called importAsTemplate which will allow customers to easily import an OVF/OVA directly into as a VM Template. Below is a quick sample using this new option and I am deploying to a VMC-based environment (see this article for requirements when using OVFTool with VMC)
ovftool.exe ` --acceptAllEulas ` --allowAllExtraConfig ` --name=PhotonOS-Template ` --datastore=WorkloadDatastore ` --net:None=sddc-cgw-network-1 ` --vmFolder=Templates ` --importAsTemplate ` C:\Users\william\Desktop\photon-hw13_uefi-3.0-49fd219.ova ` 'vi://*protected email*@vcenter.sddc-a-b-c-d.vmwarevmc.com/SDDC-Datacenter/host/Cluster-1/Resources/Compute-ResourcePool/'
Once the upload has completed, we can take a look at our vSphere UI and see that our imported OVA been automatically been converted to a VM Template!
Ethan Lowry says
I'm running into an issue now that vSphere exports the nvram file when you export a VM and the OVFTool does not pull this into the OVA when you use it. This causes the VM to fail to power on when imported into vSphere. The workaround I found was to remove the nvram entry in the VMX file. Any idea how I can get the OVFTool to include the NVRAM file when creating the OVA?
William Lam says
What version of vSphere (VC/ESXi) and OVFTool are you using? For importing the OVA, are you using the vSphere UI or OVFTool?
Ethan Lowry says
After a bit more testing it seems this is unrelated to the OVATool but is an issue with how vSphere is exporting the templates. The NVRAM file should be there if I'm utilizing UEFI, but I'm not, but the file is still being called out in the VMX file and preventing power on's. I've opened a case with VMware and they are a bit stumped and are escalating. I'll reply once I get more details. A quick google search seemed to find a few other threads on VMware Forums of others with similar issues.
Andreas Cederlund says
I have noticed that OVFTool does not work when the tennant or provider is using SAML authentication, at least for vCloud Director.
dmorse2112 says
For some reason, the OVFTool Documentation link only shows 4.3 and earlier (no 4.3 U1) in the "Select a release:" dropdown. Here is a link to download OVFTool 4.3 U1: https://my.vmware.com/group/vmware/details?downloadGroup=OVFTOOL430U1&productId=742