There are many organizations running multiple environments such as Test, Development, Stage, and production. Usually all the developments and deployments start with the Test or Development environment. Once the deployment or POC is completed in the lower environment, they want to move the deployment on a higher environment such as Stage or Production.
When the deployment is moving towards the higher environment, the product team wants the same thing configured with the test & dev environment to the higher environment. It will waste a lot of effort if you are re-doing the things from scratch in the upper environments such as stage or production. Most of the dev team requesting us to clone or copy the dev VM’s to stage or production environment.
What would the vSphere administrators do?
Environments have direct connectivity, we can clone the virtual machines directly between vCenter Server using Cross-vCenter VMotion.
Cross-vCenter vMotion feature requires enterprise plus license. You can use the tools like Cross vCenter Workload Migration Utility to clone or migrate the VM’s across the vCenter Servers between the environments.
Take a look at my article on how to vMotion VM’s between vCenter Servers using Cross vCenter Workload migration utility.
What if you don’t have the enterprise plus license and direct connectivity between the environment?
The easiest option is to export the virtual machine to OVF using the “Export OVF Template” option in the vCenter Server and import the OVF into virtual machines in the new environment.
Specify the Name for the OVF template and click Ok.
I noticed the timeout errors when export the VM as OVF from vCenter Server especially for larger VM’s. To avoid the timeout issue, I used to export VM to OVA or OVF using OVF Tool. In this article, I will explain with the detailed procedure to export VM to OVA or OVF using OVF Tool.
We have also discussed converting OVA to the OVF file using OVF Tool in one of the earlier blog posts. Check out: How to convert OVA to OVF using OVF Tool
How to Export VM to OVA or OVF using OVF Tool?
My goal today is to help you learn about:
- How to Download and Install VMware OVF Tool?
- How to Discover the VM Path using the OVF Tool?
- How to Display the VM OVF details OVF Tool?
- How to Export VM to OVA using OVF Tool?
- How to Export VM to OVF using OVF Tool?
Download and Install VMware OVF Tool
Before We understand how to Export VM to OVA or OVF using OVF Tool, Let’s understand where to download and how to install the VMware OVF Tool. OVF Tool installer is available for Windows, Linux and MAC OSX.
You can download the VMware OVF tool from VMware Website.
For this demo, I have downloaded and installed the VMware OVF tool for my windows based machine. Installation is quite simple as similar to all other windows installers. I am not going to explain each step of the OVF tool installation.
Once you finish the installation of the VMware OVF Tool, Browse towards the directory where you installed the OVF tool using the CD command. By default, below is the installation directory
cd “C:\Program Files\VMware\VMware OVF Tool”
Discover the VM Path using the OVF Tool
To export VM to OVA file using the VMware OVF tool, we have to call ovftool.exe along with the vCenter URL and credentials, and you will also need the path to your VM. To know the VM path, we can use the OVF Tool to discover the VM path.
If you don’t know the VM path, you can discover it. For example, enter the vCenter URL and credentials.
ovftool.exe vi://<vcenter-name>
example: ovftool.exe vi://vc-01.md.lab
If the full path is not as VM, so the tool will return an error message for the “wrong kind of object”, for example, a folder or a datacenter.
It will suggest possible completions, which are the objects under the path you have entered. Keep adding completions until you get to the “VM” folder and select a VM.
To list the virtual machines running on the vCenter Server, you can run the below command
ovftool.exe vi://<vcenter-name>/DC-NAME/vm/
example: ovftool.exe vi://vc-01.md.lab/MD-LAB/vm/
Display the VM OVF details
With the OVF tool, the default vi command displays a friendly version of the VM OVF details. You can run the below command to get the VM OVF Detail
ovftool.exe vi://<vcenter-name>/DC-NAME/vm/vm-name example: ovftool.exe vi://vc-01.md.lab/MD-LAB/vm/web-01
Export VM to OVA using OVF Tool
To export VM to OVA file, enter ” ovftool.exe vi://” with the VM path and with a local file with a “.ova” suffix at the end.
ovftool.exe vi://<vcenter-name>/<DC-NAME>/vm/vm-name <Folder path to save the OVA file\ova-name.ova>
example:
ovftool.exe vi://vc-01.md.lab/MD-LAB/vm/web-01 E:\vm-export\web-01.ova
It will show the progress of the export process.
Export VM to OVA is completed successfully. It will show the status as “Transfer Completed” and “Completed Successfully”.
After exporting the VM to OVA, you can see the “.OVA” file is saved in the directory which we have specified during the conversion.
Export VM to OVF using OVF Tool
Export VM to the OVF process is similar to exporting VM to OVA. enter ” ovftool.exe vi://” with the VM path and with a destination directory. By default, OVF Tool exports VM to.OVF file. So, we don’t need to specify the.OVF file extension here.
ovftool.exe vi://<vcenter-name>/<DC-NAME>/vm/vm-name <patch to save the OVF file> example: ovftool.exe vi://vc-01.md.lab/MD-LAB/vm/web-01 E:\vm-export
Exporting VM as OVF is completed successfully. Let’s take a look at the export directory and check the files.
An OVF package structure consists of a number of files: a descriptor file, optional manifest and certificate files, optional disk images, and optional resource files (such as ISO’s). The optional disk image files can be VMware vmdk’s, or any other supported disk image file.
Detailed Video on How to Export VM to OVA or OVF is here:
I hope this article is informative for you. Thanks for Reading !!!. Be social and share it in social media, if you feel worth sharing it.