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 Networks: Name: VM Network Description: The VM Network network
Virtual Hardware: Family: vmx-07 Disk Types: SCSI-buslogic
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://10.100.0.100/HomeLab/Host?ip=10.100.0.3 Opening OVF source: winxp-sp3.ovf Please enter login information for target vi://10.100.0.100/ Username: geoff Password: ******** Opening VI target: vi://firstname.lastname@example.org/HomeLab/Host Deploying to VI: vi://email@example.com/HomeLab/Host 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.