vSphere OVF tool

Firstly, for those wondering what the OVF tool is then you can go here.

If you’re wondering what OVF is, well here is a good introduction. The short summary is the Open Virtualization Format (OVF) describes an open, secure, portable, efficient, and flexible format for the packaging and distribution of one or more virtual machines.

So how do you create an OVF file from a VM. It’s simple.

Select the VM you want to export in your vSphere client. Then using the File menu, select Export

Then it’s just a case of following your nose and saving the OVF export to somewhere with sufficient disk space.

At the end of the process you get this :

and the OVF export is complete. The exported contents look like this :

~/ovf$ ls
winxp-sp3-disk1.vmdk winxp-sp3.mf winxp-sp3.ovf

The mf file is a set of SHA1 hashes for the OVF and any of the VMDK files.
The ovf file is an xml file that attempts to describe the virtual machine in an independent/open format which is in theory importable into virtualisation products that fully support OVF files – I must try that 🙂

To display the OVF file you can run the ovftool in probe mode.

~/ovf$ ovftool winxp-sp3.ovf
Opening OVF source: winxp-sp3.ovf
OVF version: 1.0
Name: winxp-sp3

Download Size: 20.35 GB

Deployment Sizes:
Flat disks: 37.27 GB
Sparse disks: Unknown
Name: VM Network
Description: The VM Network network

Virtual Hardware:
Family: vmx-07
Disk Types: SCSI-buslogic

Completed successfully

To import the OVF you use a command like (the syntax for the vSphere locator is a bit odd – I highly suggest you read the OVF Tool Guide)

$ ovftool --powerOn --datastore=NFS1 winxp-sp3.ovf vi://
Opening OVF source: winxp-sp3.ovf
Please enter login information for target vi://
Username: geoff
Password: ********
Opening VI target: vi://geoff@
Deploying to VI: vi://geoff@
Disk progress: 1%

and on the VC you’ll see

Eventually you’ll get

Powering on VM: winxp-sp3
Completed successfully

Sure you can deploy from templates, but what if you have multiple environments in a variety of network locations and you’d like to have a common set of templates – enter the OVF. With a repository full of OVF’s accessible via http you can centrally store and distribute standard images out into all of your virtual environments.

Of course this is quite a simplistic example of creating/deploying from an OVF file. In the future maybe all application servers will be deployed from vApp appliances built with VMware Studio – do you really need systems administrators poking around on individually customized vm’s when in most cases they can be stateless appliances (well stateless apart from the configuration information used at deployment time). Something to ponder.


One thought on “vSphere OVF tool

  1. Would be interesting to see if you can import the OVF into KVM.

    I see that VirtualBox supports OVF (was reading up over the weekend on OVF).

    Makes sense as I suspect migrating to *any* virt. tech will be a common task in years to come.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s