What is OVF?
OVF stands for Open Virtualization Format. It is an open standard for packaging and distributed virtual appliances across host platform and virtual platforms.
In October 2007, a group of virtualization vendors, including Dell, HP, IBM, Microsoft, VMware and XenSource, proposed a standard format for the sharing of virtual machines as virtual appliances. They created a single, interoperable format for virtual appliances and submitted this specification to the Distributed Management Task Force (DMTF), which develops this standard and promotes it worldwide.
How it looks like?
The OVF package combines three files: *.mf, *.ovf and *.vmdk/*.vhd (There are some optional files, say *.cert)
*.mf file is the manifest file that keeps the SHA1 digest, which is used for checking the integrity.
*.ovf file is an XML descriptor file that contains the virtual machine(s) metadata.
*.vmdk/*.vhd file contains the virtual machine(s).
10 Core Meta-Data Sections in the *.ovf file:
- DiskSection: Describes meta-information about all virtual disks in the package.
- NetworkSection: Description of logical network(s) used in the package.
- ResourceAllocationSection: Specifies reserved, limit, shares on a given resource such as memory or cpu for a VirtualSystemCollection.
- AnnotationSection: Specifies a free-form annotation on a virtual machine.
- ProductSection: Specifies product-information for an appliance, such as product name and version.
- PropertySection: Specifies a set of properties that can be configured for a service or virtual machine.
- EulaSection: Specifies a license agreement to be shown during import.
- StartupSection: Specifies how a VirtualSystemCollection is powered on.
- CpuCompatibilitySection: Specifies any specific CPU compatibility requirements for a virtual machine.
- OperatingSystemSection: Specifies the installed guest operating system of a virtual machine.
- InstallSection: Specifies that the virtual machine needs to be initially booted to install and configure the software.
Here is a CentOS5.3 OVF package that I exported from an ESXi 4.0 host.
CentOS53_ESX4.mf contents:
SHA1(CentOS53_ESX4-disk1.vmdk)= AE118A3149FD23A6C2DF3A5EB77D6DE12EDBF07B
SHA1(CentOS53_ESX4.ovf)= E7BE51DDCE5A0DCC08821196E8E38AE28772C0AF
CentOS53_ESX4-disk1.ovf contents:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by VMware ESX Server, User: root, UTC time: 2009-07-09T07:26:41.965695Z -->
<Envelope vmw:buildId="build-164009" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<References>
<File ovf:href="CentOS53_ESX4-disk1.vmdk" ovf:id="file1" ovf:size="909544960" />
</References>
<DiskSection>
<Info>Virtual disk information</Info>
<Disk ovf:capacity="50" ovf:capacityAllocationUnits="byte * 2^30" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" />
</DiskSection>
<NetworkSection>
<Info>The list of logical networks</Info>
<Network ovf:name="Developer vlan">
<Description>The Developer vlan network</Description>
</Network>
</NetworkSection>
<VirtualSystem ovf:id="CentOS53_ESX4">
<Info>A virtual machine</Info>
<Name>CentOS53_ESX4</Name>
<OperatingSystemSection ovf:id="79" ovf:version="5" vmw:osType="rhel5Guest">
<Info>The kind of installed guest operating system</Info>
<Description>Red Hat Enterprise Linux 5 (32-bit)</Description>
</OperatingSystemSection>
<VirtualHardwareSection>
<Info>Virtual hardware requirements</Info>
<System>
<vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
<vssd:InstanceID>0</vssd:InstanceID>
<vssd:VirtualSystemIdentifier>CentOS53_ESX4</vssd:VirtualSystemIdentifier>
<vssd:VirtualSystemType>vmx-07</vssd:VirtualSystemType>
</System>
<Item>
<rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
<rasd:Description>Number of Virtual CPUs</rasd:Description>
<rasd:ElementName>1 virtual CPU(s)</rasd:ElementName>
<rasd:InstanceID>1</rasd:InstanceID>
<rasd:ResourceType>3</rasd:ResourceType>
<rasd:VirtualQuantity>1</rasd:VirtualQuantity>
</Item>
<Item>
<rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
<rasd:Description>Memory Size</rasd:Description>
<rasd:ElementName>1024MB of memory</rasd:ElementName>
<rasd:InstanceID>2</rasd:InstanceID>
<rasd:ResourceType>4</rasd:ResourceType>
<rasd:VirtualQuantity>1024</rasd:VirtualQuantity>
</Item>
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>SCSI Controller</rasd:Description>
<rasd:ElementName>scsi0</rasd:ElementName>
<rasd:InstanceID>3</rasd:InstanceID>
<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
<rasd:ResourceType>6</rasd:ResourceType>
</Item>
<Item>
<rasd:Address>1</rasd:Address>
<rasd:Description>IDE Controller</rasd:Description>
<rasd:ElementName>VirtualIDEController 1</rasd:ElementName>
<rasd:InstanceID>4</rasd:InstanceID>
<rasd:ResourceType>5</rasd:ResourceType>
</Item>
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>IDE Controller</rasd:Description>
<rasd:ElementName>VirtualIDEController 0</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceType>5</rasd:ResourceType>
</Item>
<Item ovf:required="false">
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:ElementName>ide1:0</rasd:ElementName>
<rasd:InstanceID>6</rasd:InstanceID>
<rasd:Parent>4</rasd:Parent>
<rasd:ResourceType>15</rasd:ResourceType>
</Item>
<Item>
<rasd:AddressOnParent>7</rasd:AddressOnParent>
<rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
<rasd:Connection>Developer vlan</rasd:Connection>
<rasd:Description>PCNet32 ethernet adapter on "Developer vlan"</rasd:Description>
<rasd:ElementName>ethernet0</rasd:ElementName>
<rasd:InstanceID>7</rasd:InstanceID>
<rasd:ResourceSubType>PCNet32</rasd:ResourceSubType>
<rasd:ResourceType>10</rasd:ResourceType>
</Item>
<Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:ElementName>scsi0:0</rasd:ElementName>
<rasd:HostResource>ovf:/disk/vmdisk1</rasd:HostResource>
<rasd:InstanceID>8</rasd:InstanceID>
<rasd:Parent>3</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
</Item>
</VirtualHardwareSection>
</VirtualSystem>
</Envelope>
Why OVF?
OVF version 1.0 is used in the’ Package, Distribute, Deploy’ scope. One example is that we install and configure then deploy the virtual machine images.
Comparing to the current deploy method we use, OVF has the advantages on:
1) Higher compression – it compresses every 64KB grain, and supports delta compression
Windows 7 virtual machine, the first is exported to OVF, the second is using thin provisioning. You can find the size gap below.
2) Supports both single VM and multi-tier VM – it supports to export multiple virtual machines into one OVF package.
3) Virtual hardware validation – it supports to validate the virtual hardware before installing the virtual machine.
4) Vendor and platform independent – it is or will be supported by multiple virtualization platforms. (only VMware, XenSource and VirtualBox supports OVF for now)
Current Status
The latest OVF version is 1.0.0, and it is only supported by some versions of VMware (workstation 6.5, ESX 3.5 and later), XenSource and VirtualBox(version 2.2). I did not get a chance to test the migration of OVF file between the 3 Virtual Platforms. But I read that someone did it successfully. Currently, Microsoft Hyper-V does not support OVF.
Let’s do some OVF
As OVF currently is not widely supported, I only use it on VMware platform (mainly ESXi 4.0), and it works well so far.
VMware has released a free tool named OVFTool. You can use it to convert the VMware virtual machine format (OVF, OVA and VMX) or deploy the OVF file to ESX host directly.
OVA (Open Virtual Appliance) is one file that contains the whole OVF package by using TAR.
For more information, you can retrieve the OVF Tool User Guide: http://www.vmware.com/go/ovf_guide
本文出自 “面朝大海,春暖花开” 博客,谢绝转载!