OVF Tool: Difference between revisions

From vwiki
Jump to navigation Jump to search
(Initial creation)
 
(Added "Defaults File" and "Troubleshooting")
Line 13: Line 13:


Where <code> <target> </code> can be...
Where <code> <target> </code> can be...
* Path to a .ovf or .vmx file (or folder that will contain a .ovf)
* 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
* Path to destination on either an ESX or vCentre


Where <code> <options> </code> could be...
Where <code> <options> </code> could be...
* <code> --compress n </code> - Compress target disk files (1 - lowest, 9 - highest)
* <code> --compress=n </code> - Compress target disk files (1 - lowest, 9 - highest)
* <code> --diskMode mode </code> - Target disk format (monolithicSpare, monolithicFlat; or if dest is via vCentre can also use thin, thick)
* <code> --diskMode=mode </code> - Target disk format (monolithicSpare, monolithicFlat; or if dest is via vCentre can also use thin, thick)
* <code> --name name </code> - Target machine name (by the source machine name is used)
* <code> --name=name </code> - Target machine name (by the source machine name is used)
* and much much more
* 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 <code>%AppData%\VMware\ovftool.cfg</code>, so for a Windows 7 machine that would something like <code> C:\Users\me\AppData\Roaming\VMware\ovftool.cfg</code>, and could loom something like...
<pre>
# Defaults config file for OVF Tool
# Max compression
compress=9
# Thin provisioned disks
diskMode=monolithicSparse
</pre>


== Examples ==
== Examples ==
Line 27: Line 40:
Assumes you've got all the files for a virtual machine in a folder (ie you've downloaded from a VMFS)
Assumes you've got all the files for a virtual machine in a folder (ie you've downloaded from a VMFS)
* <code> ovftool C:\Users\me\Downloads\MyVM\MyVM.vmx C:\Users\me\Downloads\NewOVF </code>
* <code> ovftool C:\Users\me\Downloads\MyVM\MyVM.vmx C:\Users\me\Downloads\NewOVF </code>
== 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>




[[Category:VMware]]
[[Category:VMware]]

Revision as of 15:09, 20 August 2010

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>