OVF Tool
The tool is used to create standard Open Virtualisation Format (OVF) format files from source virtual machine VMX or OVF files. The source can be stored on file storage or can be accessed via an ESX or vCentre.
Download and install the tool (link to download at the bottom of http://www.vmware.com/go/ovf/)
Syntax
This is just some summary info, for the full plethora of options use ovftool --help
ovftool <source> <target> <options>
Where <source>
can be...
- Path to a .ovf or .vmx file (or folder containing one)
- Path to a VM via an ESX or vCentre
Where <target>
can be...
- Path to a .ovf or .vmx file (or folder that will contain a .ovf - the folder path must exist, the tool won't create it)
- Path to destination on either an ESX or vCentre
Where <options>
could be...
--compress=n
- Compress target disk files (1 - lowest, 9 - highest)--diskMode=mode
- Target disk format (monolithicSpare, monolithicFlat; or if dest is via vCentre can also use thin, thick)--name=name
- Target machine name (by the source machine name is used)- and much much more
Defaults File
A default config file can be created to ensure that options you always to use are, well, always used.
The file needs to be created in %AppData%\VMware\ovftool.cfg
, so for a Windows 7 machine that would something like C:\Users\me\AppData\Roaming\VMware\ovftool.cfg
, and could loom something like...
# Defaults config file for OVF Tool # Max compression compress=9 # Thin provisioned disks diskMode=monolithicSparse
Examples
Create From Copied VM Files
Assumes you've got all the files for a virtual machine in a folder (ie you've downloaded from a VMFS)
ovftool C:\Users\me\Downloads\MyVM\MyVM.vmx C:\Users\me\Downloads\NewOVF
Troubleshooting
Wrong (OS becomes Other) <Section xsi:type="ovf:OperatingSystemSection_Type" ovf:id="1">
<Info>Guest Operating System</Info> <Description>Microsoft Windows Server 2008 (64-bit)</Description> </Section>
Correct (for OS)
<Section xsi:type="ovf:OperatingSystemSection_Type" ovf:id="82">
<Info>Guest Operating System</Info> <Description>Microsoft Windows Server 2003, Enterprise Edition (64-bit)</Description> </Section>