Ovftool 420 Userguide PDF
Ovftool 420 Userguide PDF
EN-002360-01
OVF Tool User’s Guide
You can find the most up-to-date technical documentation on the VMware Web site at:
http://www.vmware.com/support/pubs
The VMware Web site also provides the latest product updates.
If you have comments about this documentation, submit your feedback to:
[email protected]
Copyright © 2009-2016 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and
intellectual property laws. VMware products are covered by one or more patents listed at
http://www.vmware.com/go/patents.
VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marks
and names mentioned herein may be trademarks of their respective companies.
VMware, Inc.
3401 Hillview Ave.
Palo Alto, CA 94304
www.vmware.com
2 VMware, Inc.
Contents
VMware, Inc. 3
OVF Tool User’s Guide
4 VMware, Inc.
Contents
Index 49
VMware, Inc. 5
OVF Tool User’s Guide
6 VMware, Inc.
About This Book
This OVF Tool User’s Guide provides information about how to use VMware® OVF Tool to package virtual
machines and vApps into Open Virtualization Format (OVF) standard packages.
Revision History
A revision occurs with each release of the product, or as needed. A revised version can contain minor or major
changes. Table 1 lists the versions of this manual.
08
03/2015 OVF Tool 4.1.0 User’s Guide. Added DVS port group, viUseProxy option for vSphere, and vCloud locators.
12/2014 Increased Open SSL compatibility version to 1.0.1j. See http://www.openssl.org/news/vulnerabilities.html.
10/2014 OVF Tool 4.0.0 User’s Guide. Added --allowAllExtraConfig and --decodeBase64 options.
06/2014 OVF Tool 3.5.2 User’s Guide. Increased security for Open SSL.
08/2013 OVF Tool 3.5.0 User’s Guide. Includes new command line options.
Intended Audience
This book is intended for anyone who needs to convert an OVF package to a virtual machine, or a virtual
machine to an OVF package. Users typically include: system administrators, software developers, QA
engineers, and anyone who need to package or unpackage virtual machines using open industry standards.
Document Feedback
VMware welcomes your suggestions for improving our documentation. If you have comments, send your
feedback to [email protected].
VMware, Inc. 7
OVF Tool User’s Guide
Support Offerings
To find out how VMware support offerings can help meet your business needs, go to
http://www.vmware.com/support/services.
8 VMware, Inc.
1
Version 1.1 was published in January 2010, which supersedes the 1.0 specification published April 2009, and
is available on the DMTF Web site, along with a white paper.
Specification: http://www.dmtf.org/standards/published_documents/DSP0243_1.1.0.pdf
Whitepaper: http://www.dmtf.org/standards/published_documents/DSP2017_1.0.0.pdf
Benefits of OVF
Using OVF to distribute virtual machines has the following benefits:
Ease of use. When users receive a package in OVF format, they do not have to unzip files, execute binaries,
or convert disk formats. Adding a vApp can be as simple as typing a URL and clicking Install.
Virtual hardware validation. OVF supports fast and robust hardware validation. You do not have to
install a complete virtual machine before determining whether it is compatible with an ESXi host (for
example, because it uses IDE virtual disks).
Metadata inclusion. Additional metadata, such as an end-user license agreement, can be packaged with
the OVF and displayed before installation.
Optimized download from the Internet. Large virtual disks are compressed for fast download and to
reduce disk space for large template libraries.
VMware, Inc. 9
OVF Tool User’s Guide
Use the OVF Tool 3.x for vSphere 4.0 and later, vCloud Director 1.5, 5.1, and 5.5, vCloud Director 1.0 (for
OVF and OVA types only), vCenter 2.5 and later, ESX 3.5 and later, VMware Server 2, VMware
Workstation 6.0 and later, and VMware Fusion 3.0 and later.
OVF 0.9 is supported for import and export by VirtualCenter 2.5 and later, and ESX 3.5 and later.
OVF support is built into the vSphere Client that installs from, and is compatible with vCenter 5.0 and ESXi
5.0, vCenter 4.0 and ESX 4.0. It is also built into the vSphere Client that installs from and is compatible with
VirtualCenter 2.5 and later, and ESX 3.5 and later. The vSphere 5.1 Web Client includes the 3.x version of the
VMware OVF Tool as part of the Client Integration Plug-in.
Supports import and generation of OVA packages (OVA is part of the OVF standard, and contains all the
files of a virtual machine or vApp in a single file.)
Directly converts between any vSphere, vCloud Director, VMX, or OVF source format to any vSphere,
vCloud Director, VMX, or OVF target format
Accesses OVF sources using HTTP, HTTPS, FTP, or from a local file
Deploys and exports vApp configurations on vSphere 4.0 (and all newer) targets and on vCloud Director
1.5 (and all newer) targets
Provides options to power on a VM or vApp after deployment, and to power off a virtual machine or
vApp before exporting (caution advised)
Provides an optional output format to support scripting when another program calls OVF Tool
Uses new optimized upload and download API (optimized for vSphere 4.0 and newer)
10 VMware, Inc.
Chapter 1 Overview of the OVF Tool
For VMware products without built-in OVF support, or when you need to accomplish specialized OVF
operations, you can download the OVF Tool over the Web.
For example, to export a vApp into an OVF package using vSphere Client 4:
Using the vSphere Client 2.5, you can import an OVF virtual machine into an ESXi host and export a virtual
machine to an OVF file (note that vSphere Client 2.5 is limited to OVF 0.9). For example, to import an OVF
vApp into an ESXi host using vSphere Client 2.5:
For example, to export a virtual machine to an OVF file using vSphere Client 2.5:
OVF packages imported or exported by OVF Tool are completely compatible with packages imported or
exported by the vSphere Client or the vSphere Client.
Delta disk compression identifies disk segments that are equal and combines these equal parts in a parent disk.
This process prevents storing the same segment twice.
As an example, consider a software solution that consists of an Apache Web server virtual machine and a
MySQL database virtual machine, both installed on top of a single-disk Ubuntu server. The two virtual
machines were created with the following process:
Using delta disk compression on the two virtual machine disks creates a parent disk containing all of the
information they share, which is essentially the entire operation system and two child disks containing the
MySQL and Apache parts.
A plain Ubuntu server can use 400–500MB of space, and two would use 800–1000MB of space. By contrast,
using delta disk compression, an OVF package with these two servers uses only 400–500MB (plus the size of
the MySQL and Apache installations), which saves 400–500MB by not duplicating the Ubuntu server.
Any number of disks can be combined creating various disk trees and saving more space.
VMware, Inc. 11
OVF Tool User’s Guide
vSphere 4 and later support the deployment of OVF packages that contain delta disk hierarchies.
Only disks with equal capacity can be combined. If you expect to use delta disk compression, you must
keep disk capacities equal.
Delta disk compression necessitates that segments that might be put in a parent disk are at the same offset
from the beginning of their respective files. In the Ubuntu example, if the setup varies between the two
installations, it can completely offset each segment on one of the disks from the segments on the other
disk. In this case, delta disk compression does not produce any significant disk space savings. This is why
the example specified cloning the Ubuntu server before installing the MySQL and Apache parts,
respectively.
Delta disk compression takes OVF packages and vSphere and VMX files as input, but not OVA packages.
The delta disk compression algorithm needs to read the contents of each disk up to two times. It might
make sense to invoke OVF Tool on a local copy of the OVF package.
The delta disk compression algorithm always generates an OVF package in the given output directory. To
convert this OVF package into an OVA package, reinvoke OVF Tool.
12 VMware, Inc.
2
The VMware OVF Tool is a command-line utility that supports importing and exporting of OVF packages,
VMX files, or virtual machines from ESXi hosts and other VMware products.
A target location or destination URL locator specifies either a file location, or a location within a VMware
product, such as VMware Workstation, vSphere ESXi Host, vSphere vCenter Server, vCloud Director or
vFabric Data Director.
<source locator> and <target locator> are paths to the source and target for the virtual machine,
OVF package, OVA package, or vSphere location. See “Command-Line Options” on page 15 for options.
Table 2-1 describes the source and target locators. For details, see “Specifying a Locator” on page 23.
If you are using an operating system where spaces are not allowed in paths on the command line, and
need the full path to run OVF Tool, enclose the path in quotes as shown below:
"/Applications/VMware OVF Tool/ovftool" --help
2 If you want to specify additional options, type them before the source and target locators.
ovftool <options> <source locator> <target locator>
Probe mode allows you to investigate the contents of a source. To invoke probe mode, use the ovftool
command with only a source and no target. OVF Tool prints information about the source such as
hardware, EULA, and OVF properties.
ovftool <options> <source locator>
Use probe mode to examine an OVF package before deploying it. For example, you can examine the download
and deployment sizes, determine the set of networks to be mapped, determine the OVF properties to be
configured, read the EULA, and determine the virtual hardware requirements.
VMware, Inc. 13
OVF Tool User’s Guide
The probe operation is fast, as it only needs to access the OVF descriptor. It does not need to download the
entire OVA or VMDK files. Probe mode also validates the certificate if the source is signed. For details about
Probe Mode and sample output, see “Using the VMware OVF Tool Probe Mode” on page 41.
If you are deploying with the ovftool command from an ESXi host, you must “inject” the parameters into the
resulting VM when it is powered on. This is because the ESXi host lacks a cache to store the OVF parameters,
as in vCenter Server. Therefore, you must use the --X:injectOvfEnv debug option with the --poweron flag
in the command line if you are deploying a virtual machine from ESXi. Example below. (You can also do this
using the Create a VM from an OVA/OVF option in the ESXi host client, then browse to the .ova file.)
>./ovftool/ovftool\
--name="Cloudvm_2074586_with_inject"\
--X:injectOvfEnv\
--X:logFile=ovftool.log\
--X:logLevel=trivia\
--acceptAllEulas\
-ds=cl-storage-1\
-dm=thin\
--net:'Network 1=VM Network'\
--X:enableHiddenProperties\
--noSSLVerify\
--allowExtraConfig\
--machineOutput\
--prop:vami.netmask0.VMware_vCenter_Server_Appliance=255.255.255.0\
--prop:guestinfo.cis.appliance.net.prefix=24\
--prop:guestinfo.cis.appliance.net.gateway=X.X.X.123\
--prop:guestinfo.cis.appliance.time.tools-sync=True\
--prop:vami.gateway.VMware_vCenter_Server_Appliance=X.X.X.123\
--prop:guestinfo.cis.appliance.net.dns.servers=X.X.X.1,X.X.X.2\
--prop:vami.ip0.VMware_vCenter_Server_Appliance=X.X.X.145\
--prop:guestinfo.cis.appliance.root.passwd=vmware\
--prop:guestinfo.cis.appliance.net.addr=X.X.X.145\
--prop:vami.DNS.VMware_vCenter_Server_Appliance=X.X.X.1,X.X.X.2\
--prop:vami.vmname=vmc-srm-vc10\
--prop:guestinfo.cis.appliance.root.shell=/bin/bash\
--prop:guestinfo.cis.vmdir.first-instance=True\
--prop:guestinfo.cis.appliance.ssh.enabled=True\
--prop:guestinfo.cis.appliance.net.mode=static\
--prop:guestinfo.cis.appliance.net.addr.family=ipv4\
--prop:guestinfo.cis.vmdir.domain-name=vsphere.local\
--prop:guestinfo.cis.vmdir.password=vmware\
--powerOn\
--X:waitForIp\
http://<directory_w/cloudvm>/VMware-vCenter-Server-Appliance-6.0.0.XXXX-XXXXXXX_OVF10.ovf\
vi://root:pwd@vm_name
You will need to replace the variables (IP addresses, build numbers, root password, and VM names) in the
above example with values from your own system.
14 VMware, Inc.
Chapter 2 Using the VMware OVF Tool
Command-Line Options
For every command, you specify the source and target locators. Table 2-1 defines each locator type.
<source locator> Path to the source, which must be either a virtual machine, vApp, vApprun workspace
entity, or an OVF package.
The source locator can be one of the following:
A path to an OVF or OVA file (a local file path, or an HTTP, HTTPS, or FTP URL).
A virtual machine (a local file path to a .vmx file).
A vSphere locator identifying a virtual machine or vApp on vCenter, ESXi, or VMware
Server.
A vCloud Director locator identifying a virtual machine or a vApp in vCloud Director.
A local file path to a vApprun workspace entity.
Options perform actions only between certain source and target types. Table 2-2 shows which source and
target types each option works with. If you specify an option using an irrelevant source or target type, the
command does nothing.
VMware, Inc. 15
OVF Tool User’s Guide
--chunkSize N/A OVF, Specifies the chunk size to use for files in a
OVA generated OVF or OVA package. The default
is not to chunk.
If you don’t specify a unit for the chunk size,
the chunk size is assumed to be in megabytes
(mb). Accepted units are b, kb, mb, gb.
Example: 2gb or 100kb.
When using this option, all output files
(except the OVF descriptor, manifest and
certificate files) are sliced into the specified
chunk size. This is useful if you need to
transport an OVF package on a series of
800MB CD-ROMs, or are only able to create
files up to 2GB on FAT32 file systems.
When you use chunking with the OVA
package option, the result is similar to OVF
because all the files are chunked, but the OVA
package is still be a single file.
--datastore -ds N/A vSphere Target datastore name for a vSphere locator.
16 VMware, Inc.
Chapter 2 Using the VMware OVF Tool
--diskMode -dm N/A VMX, Select target disk format. Supported formats
vApprun are: monolithicSparse, monolithicFlat,
,vSphere twoGbMaxExtentSparse,
twoGbMaxExtentFlat, seSparse (vSphere
target), eagerZeroedThick (vSphere target),
thin (vSphere target), thick (vSphere
target), sparse, and flat.
--help -h N/A N/A Prints the VMware OVF Tool help message
that lists the - help options.
--hideEula OVF, N/A Does not include the EULA in the OVF probe
OVA output. Binary option.
--I:morefArgs vSphere vSphere Integration option. Interpret arguments for
networks, datastores, and folders as VIM
Managed Object Reference identifiers
(type:id) for vSphere source and destination
locators.
VMware, Inc. 17
OVF Tool User’s Guide
18 VMware, Inc.
Chapter 2 Using the VMware OVF Tool
--privateKey N/A OVF, Signs the OVF package with the given private
OVA key (.pem file). The file must contain a private
key and a certificate.
VMware, Inc. 19
OVF Tool User’s Guide
--proxy OVF, OVF, Specifies the proxy used for HTTP, HTTPS,
OVA, OVA,
FTP, vSphere and vCloud access. The proxy is
vCloud, vCloud,
expressed as the URL to the proxy.
vSphere vSphere
For example, for proxy.example.com, the
option value is:
https://proxy.example.com:345
OVF Tool supports proxies that require
authentication. If you do not provide
credentials in the URL, the OVF Tool prompts
you for them.
You can also use the --X:viUseProxy option
for vsphere and the --X:vCloudUseProxy
option for vcloud but only if you use them
together.
--sourceType -st OVF, N/A Explicitly expresses that the source is OVF,
OVA, OVA, VMX, VMX, vSphere, vCloud, ISO,
VMX, FLP, or vApprun.
VMX, VI,
vCloud,
ISO, FLP,
vApprun
20 VMware, Inc.
Chapter 2 Using the VMware OVF Tool
--targetType -tt N/A OVF, Explicitly express that the target is OVF, OVA,
OVA, VMX, VMX, vSphere, vCloud, ISO, FLP, or
VMX, VI, vApprun.
vCloud,
ISO, FLP,
vApprun
--vCloudTemplate Create only a vAppTemplate.
--verifyOnly All N/A Do not upload the source; just verify it. This
only applies to vSphere 4.
--vmFolder -vf N/A vSphere The target virtual machine folder in vSphere
inventory (for a datacenter).
For example, the id of the VM specified in the descriptor fragment below is vm1.
<ovf:VirtualSystem ovf:id="vm1">
<ovf:Info>A virtual machine</ovf:Info>
<ovf:Name>WinServer2012</ovf:Name>
<ovf:OperatingSystemSection ovf:id="74" vmw:osType="windows8Server64Guest">
<ovf:Info>Specifies the operating system installed</ovf:Info>
<ovf:Description>Microsoft Windows Server 2012 (64-bit)</ovf:Description>
</ovf:OperatingSystemSection>
........
For example, you need to use the VM ID when specifying the size of the memory for a VM.
> --memorySize:vm1=1024
If you are customizing an existing VM, look at the descriptor file to get the VM ID.
You can also have the ovftool read an ovf file and extract the IDs before importing or deploying it.
VMware, Inc. 21
OVF Tool User’s Guide
<ovf:VirtualSystem ovf:id="vm1">
.......
<ovf:VirtualHardwareSection>
<ovf:Info>Virtual hardware requirements</ovf:Info>
<ovf:Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:Description>SCSI Hard disk</rasd:Description>
<rasd:ElementName>SCSI Hard disk 1</rasd:ElementName>
<rasd:HostResource>ovf:/disk/disk1</rasd:HostResource>
<rasd:InstanceID>2000</rasd:InstanceID>
<rasd:Parent>2</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
</ovf:Item>
.......
In the above example specifying instance ID “2000” (without quotes) would cause the disk with id “disk1”
(without quotes) to be resized: --diskSize:vm1,2000=256 (set the size to 256).
Note that if multiple disk devices are backed by the same disk (i.e. the OVF contains multiple disk RASD items
that refer to the same disk) you must specify the new size for all of these disk elements, not just one. Sharing
disks between VMs is not common, but allowed in the OVF spec.
integration : list of options primarily used when you execute the ovftool from another tool or shell script
Two of the most commonly used options are: --X:logFile and --X:logLevel.
Use the --X:logFile=<filename> option to log the complete ovftool session to a file
22 VMware, Inc.
Chapter 2 Using the VMware OVF Tool
For example, you can use a command similar to this to write the log in a file called ovftool-log.txt:
--X:logLevel=<level> Log level. Valid values are: none, quiet, panic, error, warning,
info, verbose, and trivia).
--X:logTransferHeaderData Add transfer header data to the log. Use with care. Default value
is false
The OVF Tool includes 22 other debug options, that you can set to retrieve specific data. You can see all of the
debug options and their definitions by running ovftool --help debug.
Specifying a Locator
A source or target locator points to a specific resource. Locators must specify a protocol, which defines how to
reach the resource. Supported protocols are file access, vSphere, HTTP, HTTPS, and FTP.
File locators can point to an OVF package (.ovf or .ova), a virtual machine (.vmx). HTTP, HTTPS, or a
vApprun workspace entity. FTP locators can point to OVF and OVA files. The resource type is determined
from the filename suffix, unless one or both of the options --sourceType and --targetType are used
explicitly.
vSphere locators can point to various resource types: virtual machines, vApps, hosts, clusters, or resource
pools. For a source locator, the resource type must be a virtual machine or vApp. For a target locator, the
resource type must be a host, cluster, or a resource pool. A vSphere locator is used for a vSphere server,
vCenter Server, VMware Server, or an ESXi host.
At the command line, type --help locators to display the online help for locators.
Table 2-3 and Table 2-4 list the default extensions of the different source and target types, as well as which
protocols are supported.
VMware, Inc. 23
OVF Tool User’s Guide
File Locators
File locators are the same for source and target. They are specified using ordinary path syntax.
24 VMware, Inc.
Chapter 2 Using the VMware OVF Tool
It is possible to omit the user name and password from the locator. If needed, OVF Tool prompts you for them.
If you use the standard port, it is not necessary to specify the port. Table 2-5 shows the standard ports.
HTTP 80
HTTPS 443
FTP 21
vSphere Locators
vSphere source locators point to a virtual machine or vApp within the virtual infrastructure. The vSphere
target locator provides all required information for importing an OVF package or virtual machine into a
cluster, host or resource pool. Both source and target locator use the same syntax:
vi://<username>:<password>@<host>:<port>/<search-term>
The server name and port can designate either a vCenter server, VirtualCenter server, VMware Server, or an
ESXi host. If you omit credentials, in which case OVF Tool prompts you for them. Default installations of
vCenter Server, VirtualCenter, and ESXi use port 443. If you are using the default port, you do not need to
specify it. When using OVF Tool against a VMware Server, you must explicitly specify port 8333, which is the
default port for VMware Server.
If a query is not given, a VC inventory path lookup is performed using the specified path. Otherwise, the object
matching the query is used. The meaning of the query depends on the object type. Table 2-6 shows the different
values that you can use in the query field.
Table 2-6. Source and Target Values for All Query Types
Name Query Source Target
BIOS bios BIOS ID of a virtual machine BIOS ID of a host
Mo-Ref moref Managed object reference (vSphere Managed object reference (vSphere specific
specific identifier) of a virtual machine identifier) of a host, cluster, or resource
or vApp pool
Datastore ds vi://localhost/TestDatacenter?ds=[foo]/myvm/myvm.vmx
IP Address ip vi://localhost?ip=123.231.232.232
VMware, Inc. 25
OVF Tool User’s Guide
Note: For the same VM, the Managed Object Reference (MoRef) will be different for vCenter Server than it is for the
ESXi host. For instance, the same VM can have a MoRef of ‘vm-92’ in vCenter Server and ‘118’ in the ESXi host. Also note
that the syntax contains ‘vm-’ for a vCenter Server MoRef. When the Motif is defined by vCenter Server, you can see it
in the browser address and use it directly. The OVF Tool script doesn't define and parse the format of a MoRef.
You can enter a partial source locator if you do not know the entire inventory path. In this case, the tool fails
but suggests possible inventory path completions.
or
<datacenter name>/host/<resource pool path>/<vm or vApp name>
The use of the vm tag after the datacenter name specifies that you are locating a virtual machine or vApp in the
VM and Template view. Use the host tag after the datacenter name if you are locating a virtual machine or
vApp in the Host and Clusters view.
The following example shows an inventory path with two nested folders:
MyDatacenter/vm/Folder 1/Sub Folder/MyVM
<resource pool>. Can take the value of one or more nested resource pools. If no resource pools are
specified, the default resource pool for the host is used.
The following example is of an inventory path without a specified resource pool:
vi://username:pass@localhost/my_datacenter/host/esx01.example.com
NOTE You must specify the /host/ section of an inventory path when using a vi destination locator. If you are
specifying the destination of a resource pool, you must include the /Resources/ section of the path.
26 VMware, Inc.
Chapter 2 Using the VMware OVF Tool
Some of the options are not needed if there is only one virtual datacenter to choose from. If there are more than
on datacenter, the catalog option is required. The org option is mandatory, because it is used to log in to
vCloud Director.
NOTE OVF Tool supports all source types for vCloud Director 1.5. For vCloud Director 1.0, OVF Tool only
supports OVF/OVA/vCloud sources. OVF Tool does not support vi, vmx, or vapprun sources for vCloud
Director 1.0.
This example exports a vCloud Director vApp to the OVF file /tmp/test1.ovf
ovftool vcloud://user1:[email protected]:7443?org=o&vapp=my_test1 /tmp/test1.ovf
If you use a network, you map the network in the usual way:
--net:sourceNET=targetNET
Partial Locators
When using OVF Tool, it is often not necessary to specify source and target types as long as certain filename
conventions are used. It is possible to the ignore locator type and specify the source and target explicitly using
the arguments --sourceType=... and --targetType=.
OVF Tool assumes the locator type based on the following rules:
If the name starts with vcloud://, OVF Tool assumes vCloud Director type.
If the name starts with vi://, OVF Tool assumes vSphere type.
If the name ends with .ovf, OVF Tool assumes OVF type.
If the name ends with .vmx, OVF Tool assumes VMX type.
If the name ends with .ova, the OVF tool assumes OVA type.
If the locator is a file path to a directory that represents a vApprun workspace or an entity in a vApprun
workspace, then OVF Tool assumes vApprun type.
Similarly, source and target types can be inferred from folder locators. OVF Tool assumes the type using the
following rules:
If the source locator is a folder, OVF Tool assumes that the source is an OVF package and that the OVF
descriptor is called the same as the folder, for example, my-ovf/my-ovf.ovf.
If the source is an OVF package and the target locator is a directory, such as MyVirtualMachines/, OVF
Tool assumes that the target is a VMX locator. The created VMX/VMDK file is put in a directory with the
target name, for example, MyVirtualMachines/MyVM/MyVM.vmx.
If the source is a VMX locator and the target locator is a directory, OVF Tool assumes that the target is an
OVF package.
If the source is a vSphere locator, and the target locator is a directory, OVF Tool assumes that the target is
an OVF package.
OVF Tool supports partial vSphere locators when deploying or exporting. For an incomplete locator path, the
tool suggests completions at the command line. Example 1 shows the command-line dialog when partial
locators are used.
VMware, Inc. 27
OVF Tool User’s Guide
OVF Tool supports partial vSphere locators when deploying or exporting. For an incomplete locator path, the
tool suggests completions at the command line. Example 2 shows the command-line dialog when partial
locators are used. First, OVF Tool signals that there is more than one virtual datacenter present, then multiple
catalogs, then multiple networks. At each attempt, you must select one of the options that OVF Tool presents.
"vcloud://jd:[email protected]:443/?org=myOrg&vapp=test1&vdc=orgVdc&catalog=catalog"
Opening OVF source: LAMP.ovf
Warning: No manifest file
Opening vCloud target: vcloud://js:[email protected]:443/
Error: Multiple networks found on target. Possible completions are:
extNet2
extOrgNet
intNet2
intnet
Completed with errors
28 VMware, Inc.
Chapter 2 Using the VMware OVF Tool
Configuration Files
OVF Tool has many options. Rather than repeatedly entering long commands on the command line, you can
create a configuration file. A configuration file uses the following syntax:
option1=value
...
#comment
optionN=value
You can create local or global configuration files. A local configuration file has the .ovftool suffix and is read
in the folder from which you invoke OVF Tool. A global configuration file is per user.
On pre-Vista Windows, the global configuration file is read from the following location:
C:\Documents and Settings\$USERNAME\VMware\ovftool.cfg
On post-Vista Windows, the global configuration file is read from the following location:
C:\Users\$USERNAME\AppData\Roaming\VMware\ovftool.cfg
On Linux and Mac, the global configuration file is read from the following location:
$HOME/.ovftool (example: ~/.ovftool)
When using configuration files, globally defined options are overwritten by locally defined and command-line
options. Locally defined options are overwritten by command-line options. Note: there are some variables,
such as proxy, that do not allow you to specify the options in multiple places. If the ovftool stops running with
the error, “already exists“, it is very likely that you have specified options on the command line and in the
configuration file.
You can use the ovftool --help config command to get information about how to use a configuration file.
In addition, the current contents of the global configuration file as well as any local configuration file is shown.
Handling Authentication
OVF Tool generates AUTHENTICATION output messages if access to a resource requires a username or
password. For example, a proxy server, a vSphere or vCloud locator, or an authenticated URL require
usernames and passwords. OVF Tool only generates AUTHENTICATION messages for resources where
passwords are not explicitly provided as part of the locator or as command-line arguments.
source locators
target locators
proxyServer
For source and target locators, you must provide the username on the command-line. If you do not provide a
password, OVF Tool generates an AUTHENTICATION message and you must provide the password on STDIN.
If the proxy server requires authentication, you must provide both the username and password on STDIN
VMware, Inc. 29
OVF Tool User’s Guide
PASSWORDSOURCE
password
PASSWORDTARGET
password
PASSWORDPROXY
username password
For an example of the output of running machineOutput in authentication mode, see “Output from Running
machineOutput in Import Mode” on page 48.
If you use the --I:morefArgs argument, the values for --vmFolder, --network, --net, and --datastore
are interpreted as MoRefs instead of names, as shown in the following example:
> ovftool --name=vm5 \
--I:morefArgs \
--net:VM Network=vim.Network:network-12 \
--datastore=vim.Datastore:datastore-17 \
c:\temp\vm1\ \
vi://root:@localhost?moref=vim.ResourcePool:resgroup-42
30 VMware, Inc.
3
You can see similar examples within the OVF Tool, by typing --help examples on the command line while
you are in the directory where the ovftool script is running.
VMware, Inc. 31
OVF Tool User’s Guide
OVF (.ovf) Open Virtualization Format National ANSI standard for packaging software for virtual
machines, originally created by an industry task force
known as the Distributed Management Task Force (DTMF).
An OVF package includes: a descriptor file, optional
manifest and certificate files, optional disk images, and
optional resource files (such as ISOs). The disk image files
can be files in VMware’s .vmdk disk image format or in any
other supported disk image format.
OVF packages can be used by the software of any
hypervisor or processor architecture that supports this
format.
OVA (.ova) Open Virtual Appliance A TAR archive that contains an OVF package.
VMX (.vmx) Virtual Machine When you create a new virtual machine, this file is created
Configuration File to store information about the operating system, disk sizes,
networking, and virtual hardware.
Files in this format and the .vmdk format are sometimes
referred to together as, ‘VMware runtime format’.
VMDK (.vmdk) Virtual Machine Disk Files with this extension may contain disk characteristics
(,vmdk), contents (-flat.vmdk), or snapshot files
(-delta.vmdk). These files are called out on the OVF Tool
command line, but may exist within the package.
VI (vi://) VMware Infrastructure This is an older term that originated with ESX 3, but is still
seen in the command line syntax for the OVF Tool. As an
OVF command line option, ‘vi//’ is used before the
credentials and path to a server.
vCloud vCloud Director format The vCloud Director REST API makes basic transfer
between clouds possible using OVF packages, which
preserve application properties, networking configuration
and other settings.
ISO (.iso) Optical Image File An ISO archive is a CD/DVD image. Creating a package as
an ISO image allows you to install a virtual appliance using
a CD ROM drive.
This type of archive is called an ISO because it was created
by the International Standards Organization’s 9660
standard.
FLP (.flp) Floppy Disk Image File Use this format if you need to transfer data from a floppy
drive or to the virtual machine floppy drive. Instructions are
available in Knowledge Base article 1739.
Use the OVF Tool with the Target Type option to specify the target out as OVF, OVA, VMX, VI, vCloud, ISO,
FLP, vApprun.
In this following example, the target type is set to the ‘vmx’ or VMware runtime format (.vmx and .vmdk files)
> ovftool -tt=vmx /ovfs/my_vapp.ovf /vms/
The resulting files are: /vms/my_vapp/my_vapp.vmx and /vms/my_vapp/my_vapp.vmdk files (like the
contents of a typical virtual machine directory).
32 VMware, Inc.
Chapter 3 Examples of OVF Tool Syntax
Because the source is an OVF package, you can specify it as a URL or a local file path.
If you convert an OVF package to a VMX format without specifying the target directory, OVF Tool creates a
directory using the OVF package name and writes the .vmx and .vmdk files in it.
> ovftool "Windows 7.ovf" .
You can also convert from an ovf format to a vmx format using a URL, as shown:
> ovftool https://my_ovf_server/ovfs/my_vapp.ova /vm/my_vm.vmx
VMware, Inc. 33
OVF Tool User’s Guide
or
> ovftool vi://username:pass@my_host/my_datacenter/vm/my_vm_folder/my_vm_name /ovfs/my_vapp.ovf
This example sets two properties: the administrator’s email address and the number of concurrent sessions.
> ovftool --prop:[email protected] --prop:concurrentSessions=200 package.ovf
vi://localhost/?dns=fast-esx=host1.example.com
If the OVF descriptor only specifies one network name, you can specify the target network name of the
network mapping, as in the following example:
> ovftool --network=”VM Network” <source> <vSphere locator>
34 VMware, Inc.
Chapter 3 Examples of OVF Tool Syntax
If the source contains only a single virtual machine, the --makeDeltaDisks option does not yield any
compression boost. In this case, the --compress=9 option gives maximum compression.
Unit Keyword
Bytes b
Kilobytes kb
Gigabytes gb
For example, to create an OVF package optimized for a FAT32 file system, use the following command:
> ovftool --chunkSize=2gb <source> package.ovf
Each file chunk has a sequentially numbered suffix. For example, for a 6GB disk, the chunks have these names:
disk1.vmdk.000000000, disk1.vmdk.000000001, disk1.vmdk.000000002
VMware, Inc. 35
OVF Tool User’s Guide
If your host has multiple data stores, use the -ds option:
> ovftool package.ovf -ds=storage1 vi://my.esx-machine.example.com/
See also “Special Consideration: Running OVF Tool from ESXi instead of vCenter” on page 14.
To deploy an OVF package into a vApprun workspace, simply use a target locator that points to your vApprun
workspace, as shown in the following example:
> ovftool myOvfPackage c:\My_vApprun_workspace\
A common scenario is that the current directory is the vApprun workspace (since all vApprun commands are
relative to this), so you can just use a “.” as the target locator, as shown in the following example:
> ovftool http://www.mycompany.com/ovflib/BigDemo.ovf.
(Imports an OVF from http into a vCloud instance and names the vApp myVapp)
36 VMware, Inc.
Chapter 3 Examples of OVF Tool Syntax
(This imports an OVF from http into a vCloud instance and creates a vApp template)
NOTE This option does not perform a shutdown of the operating system. This is only a power off operation.
Prepend the name of the entity to export to the path. If the current directory is the vApprun workspace, you
only specify the name, as shown in the following example. This example takes advantage of the fact that any
source locator can be used with any destination locator. Thus, the vApp transfers directly from the vApprun
workspace to the vCenter installation.
> ovftool BigDemo vi://MyvCenterServer/...
NOTE vApprun does not keep the same level of meta-data around as vSphere. Thus, the vApprun-created
OVF packages will not contain any EULAs, description of properties, and such.
VMware, Inc. 37
OVF Tool User’s Guide
If everything is correct, OVF Tool shows the result of probing OVF. Otherwise, it shows warnings and errors.
IMPORTANT Being compliant with OVF 1.0 or 1.1 is only part of the requirements for a valid OVF package.
Schema validation does not check for all the requirements specified in the OVF 1.0 and OVF 1.1 specifications.
Using a Proxy
You can specify a proxy for the OVF Tool. The following examples show the use of the --proxy option:
> ovftool --proxy=proxy.example.com http://external-site.com/ovf/package.ovf
> ovftool --proxy=http://proxy.example.com http://external-site.com/ovf/package.ovf
The OVF Tool allows proxies that require authentication. Credentials are supplied in the proxy path as shown
in the following example:
> ovftool --proxy=user:[email protected] http://external-site.com/ovf/package.ovf
You can omit the username and password for a proxy server that requires authentication. OVF Tool prompts
for them. If you are using vSphere or vCloud as the locator for a source or target, you have to add the UseProxy
option: --X:viUseProxy for vSphere or --X:vCloudUseProxy for vCloud.
> ovftool --X:viUseProxy --proxy=proxy.example.com package.ovf vi://my.esx-machine.example.com/
> ovftool --X:vCloudUseProxy --proxy=proxy.example.com package.ovf
"vcloud://USERNAME:[email protected]:443/?org=myOrg&vapp=test&vdc=orgVdc&catalog=catalog"
You can also power on the newly written virtual machine or vApp at the same time. In the following example,
the target machine is powered off and deleted, the package.ovf is imported, and the imported virtual machine
or vApp is powered on.
> ovftool --overwrite --powerOffTarget --powerOn package.ovf
vi://localhost/?dns=production-host.example.com
38 VMware, Inc.
4
To display the contents of a .pem file at the command line, type the following:
VMware, Inc. 39
OVF Tool User’s Guide
....
To create a trusted certificate, use the OpenSSL command, omitting the --x509 option. This creates a certificate
request in a .pem file that you can send to any public authority, such as Verisign.
Signing an OVF package requires a .pem file that contains a private key and a certificate, as shown in section
“Creating an RSA Public/Private Key Pair and Certificate” on page 39.
To sign a generated OVF package, include the --privateKey option. The option syntax is shown in the following
example:
> ovftool --privateKey=<path to .pem file> <source> <output OVF or OVA file>
When this option is used, OVF Tool uses the private key and certificate to generate a signature based on the
SHA digest of each file that is included in the OVF package, including the OVF descriptor itself.
OVF Tool generates an additional .cert file with a signed SHA signature and the certificate used to sign it.
Example 4-2 shows an example of the .cert file generated by OVF Tool.
To quickly validate the authenticity of an OVF package, use the probe mode as shown in the following
example:
> ovftool signed-package.ovf
40 VMware, Inc.
5
To use the probe feature, omit the target locator when invoking OVF Tool. For example, at the command line,
type: ovftool LAMP.ovf. The tool displays all available information about the LAMP.ovf.
When probe mode is used on an OVF or OVA package, OVF Tool also validates the certificate file, if present.
As part of the information displayed in probe mode, the EULA is displayed by default. To prevent the EULA
from displaying, use the --hideEula option.
> ovftool --hideEula LAMP.ovf
Annotation: This vApp offers the programming environment stack: Linux, Apache,
MySQL and PHP programming environment -- LAMP. More specifically
the vApp contains a Database server running MySQL and Web server
VM running Apache2 and PHP.
Deployment Sizes:
Flat disks: 16.00 GB
Sparse disks: Unknown
Networks:
Name: VM Network
Description: The VM Network network
VMware, Inc. 41
OVF Tool User’s Guide
Virtual Hardware:
Family: vmx-04
Disk Types: SCSI-lsilogic
Properties:
Key: db_ip
Label: IP address
Type: ip:VM Network
Description: The IP address of the database server.
Key: ws_ip
Label: IP address
Type: ip:VM Network
Description: The IP address of the Web server.
IP Allocation Policy:
Schemes: ovfenv dhcp
Protocols: IPv4
42 VMware, Inc.
6
OVF Tool inserts a blank line to signal the end of an operation. Each response line is prefixed with a plus (+)
to avoid confusion with the terminating blank line. The last status it sends is always RESULT. OVF Tool sends
all output, including errors and warnings, to standard output (stdout) so clients can listen on only one stream.
Table 6-9. Machine Mode Status
Status Details Description
PROBE XML Probe result with information about the
source.
CERTIFICATE Validate, Self-signed, or Failed validate Signals that a certificate is present and
shows the result of the validation.
TARGET_ID Text, for example SugarCRM.ovf or Shows the target ID after upload and
vim.VirtualMachine:vm-415. download finishes.
To run the machineOutput option in probe mode, you run the following command.
For an example, see “Output from Running machineOutput in Probe Mode” on page 45.
VMware, Inc. 43
OVF Tool User’s Guide
To run the machineOutput option in validate host mode, you run the following command.
ovftool.exe --machineOutput --verifyOnly source_locator destination_locator
For an example, see “Output from Running machineOutput in Validate Host Mode” on page 47.
To use machine mode to upload an OVF to vSphere, you run the following command.
ovftool.exe --machineOutput \
--acceptAllEulas \
--I:morefArgs \
--I:targetSessionTicket=<session ticket> \
--net:<ovf netname>=vim.Network:<moref-id> \
--datastore=vim.Datastore:<moref-id> \
--vmFolder=vim.Folder:<moref-id> \
--deploymentOption=<value> \
--diskMode=<value> \
--ipAllocationPolicy=<value> \
--ipProtocol=<value> \
--name=<value> (optional) \
--overwrite (optional) \
--powerOffTarget (optional) \
--powerOn (optional) \
--prop:<key>=<value> \
<src URL or PATH> \
vi://<servername>?moref=vim.ResourcePool:<moref-id>
For an example, see “Output from Running machineOutput in Import Mode” on page 48.
44 VMware, Inc.
Chapter 6 Using the VMware OVF Tool Machine Mode
To use machine mode to download an OVF from vSphere, you run the following command.
ovftool.exe --machineOutput \
--I:sourceSessionTicket=<session ticket> \
-tt <OVA or OVF> \
-n=<name> \
--overwrite (optional) \
--powerOffSource (optional) \
--chunkSize=<value> (optional) \
--compress=<value> (optional) \
vi://<servername>?moref=<type>:<moref-id> \
<directory>
When you specify --machineOutput, OVF Tool monitors STDIN, and cancels the operation if it reads the
ABORT\n line in stdin.
For an example, see “Output from Running machineOutput in Export Mode” on page 48.
Example Output
You can run the OVF Tool machine mode --machineOutput option in probe mode, validate host mode, or
import mode. In import and validate Host modes, --machineOutput is meant for third party program to use
silently without any interactive prompt appearing in the standalone OVF tool command console. If your OVF
file contains EULA information, you should add this option --acceptAllEulas so that the program doesn’t
pause to wait for acceptance of the license agreement. This section contains the following topics:
VMware, Inc. 45
OVF Tool User’s Guide
+ </vendorUrl>
+ </productInfo>
+ <annotation>
+ This vApp offers the programming environment stack: Linux, Apache, MySQL and PHP programming
environment -- LAMP. More specifically the vApp contains a Database server running MySQL and Web
server VM running Apache2 and PHP.
+ </annotation>
+ <eulas>
+ <eula>
+
+ Eula for OVF
+
+ </eula>
+ </eulas>
+ <sizes>
+ <download>
+ 633412608
+ </download>
+ <flat>
+ 17179869184
+ </flat>
+ <sparse>
+ Unknown
+ </sparse>
+ </sizes>
+ <networks>
+ <network>
+ <name>
+ VM Network
+ </name>
+ <description>
+ The VM Network network
+ </description>
+ </network>
+ </networks>
+ <properties>
+ <property>
+ <classId>
+
+ </classId>
+ <key>
+ db_ip
+ </key>
+ <instanceId>
+
+ </instanceId>
+ <category>
+
+ </category>
+ <label>
+ IP address
+ </label>
+ <type>
+ ip:VM Network
+ </type>
+ <description>
+ The IP address of the database server.
+ </description>
+ <value>
+
+ </value>
+ </property>
+ <property>
+ <classId>
+
+ </classId>
+ <key>
+ ws_ip
46 VMware, Inc.
Chapter 6 Using the VMware OVF Tool Machine Mode
+ </key>
+ <instanceId>
+
+ </instanceId>
+ <category>
+
+ </category>
+ <label>
+ IP address
+ </label>
+ <type>
+ ip:VM Network
+ </type>
+ <description>
+ The IP address of the Web server.
+ </description>
+ <value>
+
+ </value>
+ </property>
+ </properties>
+ <deploymentOptions>
+ </deploymentOptions>
+ <ipAllocationSchemes>
+ ovfenv,dhcp
+ </ipAllocationSchemes>
+ <ipProtocols>
+ IPv4
+ </ipProtocols>
+ </probeResult>
RESULT
+ SUCCESS
PROGRESS
+ 0
TARGET_ID
VMware, Inc. 47
OVF Tool User’s Guide
RESULT
+ SUCCESS
TARGET_ID
+ vim.VirtualApp:resgroup-v61
RESULT
+ SUCCESS
TARGET_ID
+ /tmp/LAMP.ovf
RESULT
+ SUCCESS
48 VMware, Inc.
Index
B L
benefits of OVF 9 Linux
path syntax for file locators 24
C
command-line options 15 M
--compress 11 Machine Mode Operations 43
compression 11 --makeDeltaDisks 11
configuration files 29
O
D Output from Running machineOutput in Probe
delta disk compression Mode 45
introduction 11 Output from Running machineOutput in Validate
limitations 12 Host Mode 47
OVF standard 9
E OVF support in vSphere 10
examples OVF Tool
cancelling OVF Tool while running 38 command-line options 15
chunking 35 partial locators 27
convert .ova to .vmx 33 source and target locator definitions 15
convert .ovf to .vmx 33, 34 OVT Tool as a helper process, integration options 30
convert .vmx to .ova 33
convert .vmx to .ovf 33
P
deploying and powering on 36 partial locators
deploying OVF package 36 command-line dialog 27
downloading from a protected site 38 OVF Tool assumptions 27
exporting a running virtual machine or vApp 37 Partial vCloud DirectorLocators at the Command
Line 28
maximum compression 35
platforms supported 10
omitting disks in output 35
protocol locators, HTTP, HTTPS, FTP 25
overwriting a running virtual machine or
vApp 38
S
renaming the OVF package 35
source locator
setting OVF network mappings 34
definition 15
setting OVF properties 34
vSpherer 25
using a proxy 38
supported platforms 10
validating 38
T
F
target locator
feature highlights 10
definition 15
file locators 24
technical support resources 7
Forum 8
U
I
URI, using for file locators 24
integration options 30
URI, using for locators 24
inventory path
host or resource pool 26 V
virtual machine or vApp 26
vApprun
VMware, Inc. 49
OVF Tool User’s Guide
W
Windows
path syntax for file locators 24
50 VMware, Inc.