WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Automation / Quick Tip - Import OVF/OVA as VM Template using OVFTool 4.3 Update 1

Quick Tip - Import OVF/OVA as VM Template using OVFTool 4.3 Update 1

01.29.2019 by William Lam // 5 Comments

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!

More from my site

  • Default hashing algorithm changed in OVFTool 4.2 preventing OVF/OVA import using vSphere C# Client
  • Heads Up: OVF/OVA always deployed as Thick on VSAN when using vSphere Web Client
  • Caveat when deploying Photon Controller Installer (v0.8) OVA to vCenter Server
  • How to deploy and run the VSAN 6.1 Witness Virtual Appliance on VMware Fusion & Workstation?
  • How to deploy vSphere 6.0 (VCSA & ESXi) on vCloud Director and vCloud Air?

Categories // Automation, OVFTool, VMware Cloud on AWS, vSphere Tags // ova, ovf, ovftool, VM Template

Comments

  1. Ethan Lowry says

    01/29/2019 at 10:46 am

    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?

    Reply
    • William Lam says

      01/29/2019 at 2:24 pm

      What version of vSphere (VC/ESXi) and OVFTool are you using? For importing the OVA, are you using the vSphere UI or OVFTool?

      Reply
      • Ethan Lowry says

        01/31/2019 at 2:03 pm

        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.

        Reply
  2. Andreas Cederlund says

    01/30/2019 at 12:03 am

    I have noticed that OVFTool does not work when the tennant or provider is using SAML authentication, at least for vCloud Director.

    Reply
  3. dmorse2112 says

    01/31/2019 at 9:17 am

    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

    Reply

Thanks for the comment! Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023
  • Is my vSphere Cluster managed by vSphere Lifecycle Manager (vLCM) as a Desired Image or Baseline? 03/10/2023
  • Interesting VMware Homelab Kits for 2023 03/08/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...