dcsimg

OVF to VM and Back Again

Do you need to deliver your appliances in smaller packages or do you have an OVF and don't know how to use it? This how-to unravels the OVF mystery.

The Open Virtualization Format (OVF) is a virtual machine standard that provides a flexible, secure, portable and efficient way to package and distribute virtual machines. While often referring to virtual appliances, you can package any virtual machine in OVF and distribute it. The OVF file is an XML file that describes a virtual machine and its configuration.

So, what’s so great about OVF? Since there are so many disparate points of view in the virtualization world, a proposal was made that there should be a way to standardize virtual machine delivery in a hypervisor agnostic fashion. In 2008, the Distributed Management Task Force (DMTF) drafted the OVF Specification V1.0.0. The DMTF is a collective effort by Dell, HP, IBM, Microsoft, VMware and XenSource. Currently, VirtualBox, XenServer and VMware support OVF. This week’s entry describes the use of VMware’s OVFTool.

Download and Install

Point your browser to OVF Tool Download and download the tool for your operating system (Windows or Linux). Unzip the tool into any folder or directory. The binary or its supplied libraries needn’t be in your path to work correctly. On Linux, depending on your install, you might have some dependent packages to install before you can use ovfTool. The potential list is too long to provide here for every distribution and possible configuration.

Using ovfTool

Once you have ovfTool downloaded, unzipped and installed into your path and library locations or just used as is, where is, it’s time to put this thing to work. The ovfTool is a command line application, which means there’s no cute little graphical application for it—you’ll have to use your Unix ninja skills on this one.

Let’s say that you’ve found and downloaded as an OVF and you need to convert it to a standard VMware ESX-style virtual machine. At the command line (Xterm, Konsole) cd to the directory where ovfTool is (If it isn’t in your path) and execute the ovfTool command with the –h (help) switch.

# ./ovftool –h

All the syntax information you’ll need for the ovfTool displays for you on the screen. The simplest invocations are to convert an OVF and its corresponding disk file(s) to VMware-usable VMX and VMDK files.

# ./ovftool /downloads/Ubuntu9.04.ovf /VM/Ubuntu9.04/Ubuntu9.04.vmx

Where /downloads is a common download location and /VM is where you store your virtual machines. You’ll receive the following messages if everything goes according to plan.

Deploying /downloads/Ubuntu9.04.ovf to /VM/Ubuntu9.04/Ubuntu9.04.vmx
Converting disk /downloads/Ubuntu9.04-disk1.vmdk: XX% done.
Deployment completed successfully!

Now open the .vmx file to automatically insert the new virtual machine into inventory. If the virtual machine doesn’t start, set the execute bit on the newly created .vmx file.

Deploying OVF

If you’re in the habit of creating your own virtual appliances (Specialized virtual machines) for public consumption, you might want to consider converting them to OVF before sharing them. VMDK to OVF conversion is a compression as well as a redefinition of your virtual machine. I downloaded a virtual appliance with a 20GB configured disk that weighed in just shy of 500MB—your mileage may vary for compression that takes place during conversion.

To convert your appliances to OVF, issue the following commands.

# ./ovftool /VM/VAppliance1.01.vmx /OVF/VAppliance.ovf
Exporting /VM/VAppliance1.01.vmx to /OVF/VAppliance.ovf
Converting disk /VM/VAppliance1.01.vmdk: XX% done.
Export completed successfully!

Take a look at the amount of compression you received during the conversion. Are you impressed? Now tar and gzip your ovf and related disk files vs what you get if you simply tar and gzip your virtual machine.

Love it or hate it, OVF is meant to make everyone’s life easier—as are all standards. For those who create and deploy portable virtual machines and appliances, OVF makes sense but from a user’s perspective, often you just want to unzip a virtual machine, open it in VI Client and get to work. This extra step might seem painful, at first, but you’ll enjoy the shortened download times due to the compression ratios. Give VMware’s ovfTool a spin for yourself and let me know how you like it.

Fatal error: Call to undefined function aa_author_bios() in /opt/apache/dms/b2b/linux-mag.com/site/www/htdocs/wp-content/themes/linuxmag/single.php on line 62