Virtualization makes servers and applications completely portable, which in turn makes distributing virtual machines and their preinstalled applications simple. Taking advantage of this, VMware created the virtual appliance marketplace where thousands of VMs with applications (called virtual appliances) are available for download, most at no cost.
Making these virtual appliances compatible with all of VMware's virtualization platforms, allowing you to distribute the appliances in a single file, and allow creators of appliances to customize the VMs for the end-users at the time of deployment, however, was lacking. This lead to the creation of the Open Virtualization Format (OVF).
What is the OVF specification?
For those who aren't familiar with it, the Open Virtualization Formation (OVF) standard/specification is an open standard created by VMware and a number of other companies. The specification was proposed to the DMTF (distributed management task force), a standards organization, and was made available as a DMTF specification version 1.0.0 on February 22, 2009.
According to VMware, "with OVF, customers' experience with virtualization is greatly enhanced, with more portability, platform independence, verification, signing, versioning, and licensing terms."
According to VMware's OVF homepage, OVF offers:
- An improved experience for anyone downloading a virtual appliance.
- Virtualization platform independence and flexibility.
- Easier distribution of complex and preconfigured multi-tiered applications.
- Easy delivery of enterprise software.
- Platform-specific enhancements and easier adoption of advances in virtualization through extensibility.
Essentially, by packaging your appliances in the OVF format and by downloading OVF files, everyone will gain distribution and portability efficiency.
What is the OVFTOOL and where do you download it?
You can create OVF packages to distribute to others and deploy OVF packages into your vSphere infrastructure without the OVFTOOL. However, the OVFTOOL is what will allow you to do these things at the command line.
Essentially, the OVFTOOL is a conversion program. Not only does it put OVF packages (these virtual appliances) into your in vSphere infrastructure and export VMs to OVF packages but it also has a lot of conversion uses. For example, you can convert an OVF file to a .VMX file, an .OVA to a .VMX and others. Not only does OVFTOOL work with vSphere vCenter but it also work with standalone ESX servers, Workstation 5.x and later, VMware Server 2.x, and VMware Studio 1.0 and later.
You can download the OVFTOOL for both 32-bit Windows and 32-bit or 64-bit Linux at the VMware OVFTOOL Download page. Still, the single best place to access the download links, the OVFTOOL documentation and participate in a great forum dedicated to the OVFTOOL is the VMware's OVF Community.
In my case, I downloaded the OVFTOOL for Windows. It is a 12 MB file and installs quickly. Make sure that you take note of the directory that it is installed in because that is the directory that you will have to CD to in order to use OVFTOOL. Unlike other tools that you install, you won't find an icon or program group in the Windows Start Menu for OVFTOOL. To use it, you will have to open a Windows (or Linux) command prompt, CD into the installation folder, and run OVFTOOL.
Learning how to use OVFTOOL
As it is a command-line interface (CLI) tool, there may be a bit of a learning curve. In my case, once I finished the command string that I used with OVFTOOL, I saved it to a notepad file so that it would be quick and easy to use OVFTOOL again. Fortunately, OVFTOOL comes with more than the average amount of help. Not only can you run OVFTOOL --help, but you can also run OVFTOOL --help examples, OVFTOOL --help locators, and OVFTOOL --help config.
VMware has also published a nice user's guide to OVFTOOL. You can find it at: VMware OVFTOOL Documentation.
Importing a VM with the OVFTOOL
As I pointed out, you can use OVFTOOL with various platforms and perform various conversions. Still, I suspect that the most likely use of OVFTOOL will be to import (deploy) and export virtual machines/appliances into and out of vSphere where you have vCenter in use. For that reason, that is why I selected to demonstrate the import of a VM into vSphere vCenter. I will even demo some of the optional switches that you can enable in order to perform tasks such as creating a custom name for the VM in the vCenter inventory or powering on the VM after import.
The basic syntax of the OVFTOOL is:
OVFTOOL (source) (target)
Thus, if you were importing an OVF file (a virtual appliance) into vCenter it would be:
OVFTOOL (path to OVF FILE) (vCenter server and inventory path info)
If you were exporting a VM, the source and target would be reversed.
In our case, I have opted to download the VMware vSphere Management Assistant (vMA). This is a free VMware virtual appliance, distributed in the OVF format. Just like the OVFTOOL, all you need to download it is a free VMware username and password.
While you could run OVFTOOL and specify the URL to download vMA (or another OVF file), I opted to download the vMA OVF and import it myself.
About the "vCenter server and inventory path info," this is actually a locator. With OVFTOOL, a locator is a string that tells OVFTOOL exactly where in the vSphere infrastructure you want this appliance to be imported to. It is likely one of the more complex aspects of using the OVFTOOL, so make sure you read the special ovftool --help locatos help file.
Here is what a locator might look like:
As you can see, we are telling the OVFTOOL exactly where in the vSphere infrastructure to place the virtual appliance.
In my case, I used the following OVFTOOL command to import the vMA appliance:
ovftool --datastore=ESX3-datastore1 name="vMA4" --powerOn "C:\Users\david\Desktop\vMA-ovf-4.0.0-161993\vMA-ovf-4.0.0-161993.ovf" "vi://administrator@vCenter40/Bandon, OR/host/Prod/esx3.wiredbraincoffee.com"
You can see what this import and the results looked like in the following images.
In the first image, I used the string above to import the vMA OVF file that I downloaded to a vSphere server called "ESX3" managed by vCenter. I specified the data store, the name of the virtual machine once imported and that it should be powered on when the import is completed. I specified the username (administrator) in the locator. I could have specified the password but instead let the OVFTOOL prompt me for it.
Once imported, the VM was named with the correct name and powered on.
Again, this is just one of the many uses of the OVFTOOL. I could also use it to import an OVF file (or other format) into other VMware virtualization packages like VMware Server or Workstation.
David Davis is the director of infrastructure at TrainSignal.com . He has a number of certifications including vExpert, VCP, CCIE #9369 and CISSP. Davis has also authored hundreds of articles and six different video training courses at Train Signal with his most popular course being the VMware vSphere 4 video training course. His personal website is VMwareVideos.com . You can follow Davis on Twitter or connect with Davis on LinkedIn.