I recently had a need to deploy an OVA using ovftool on a Windows desktop and I ran into the following error:
Error: Could not lookup host: root
Since the environment I was deploying to did not have DNS, the failed hostname lookup was expected. This was pretty annoying with previous releases of ovftool but it looks like with the latest 4.0 version, there is a new advanced option called --X:disableHostnameResolve that would allow you to disable this check. Using the new version of ovftool and the advanced option, I was able to bypass the check and deploy the OVA.
One really useful advanced option found in the latest version of ovftool 4.0 is --X:injectOvfEnv which I have already written about here, To get the complete list of ovftool advanced options, you just need to specify --help integration option. To download ovftool 4.0, you will need to either install the 2014 Tech Preview of VMware Workstation or Fusion.
Here is an example of running this on Windows system:
C:\Users\wlam\Desktop>"C:\Program Files (x86)\VMware\VMware Workstation\OVFTool\ovftool.exe" --help integration
OVF Advanced Options | Description |
---|---|
--X:apiVersion | Specify what vim api version to use. This applies to both source and destination |
--X:binaryOvaSize | Force file entries in OVA file headers to be written in binary format instead of the standard octal format. |
--X:connectionReconnectCount | Specifies how many times a reconnectshould be attempted when resuming up/downloads on broken connections. |
--X:connectionReconnectDelay | Specifies the delay in milliseconds between attempts at reconnecting on lost connections. |
--X:connectionReconnectDelayDouble | Double the delay between attempts at reconnecting on lost connections if a reconnect fails |
--X:connectionRetryCount | Specifies how many times up/downloads should be resumed on broken connections. |
--X:defaultSslCiphers | Use the default OpenSSL cipher suite for https connections. |
--X:disableHostnameResolve | Disable ovftool hostname resolve for windows. |
--X:enableHiddenProperties | Enable source properties that are marked as ovf:userConfigurable=false OVF Tool will set the value to true. The default is false |
--X:forceDnsName | Use the domain name given in the locator instead of resolving it to an IP address. |
--X:forceVi2 | Force source and/or target to be treated as VI2. |
--X:guest | Sets a guestinfo.<key>=<value> variable. This must be used together with --powerOn the VI target and a single VM source. |
--X:httpTimeout | HTTP/HTTPS/FTP connection timeout defined in minutes. Default is no timeout |
--X:ignoreSha1Collisions | If SHA1 values equals do not recheck the underlying data for equality. (use in conjunction with --makeDeltaDisks). |
--X:imageReadSize | Specify in bytes the data size for non-disk reads The size without unit is assumed to be in kilobytes. Accepted units are b kb mb gb; e.g. 2gb or 100kb. Default is 256kb. |
--X:injectOvfEnv | Force the given OVF properties to be inserted into an OVF Environment and injected through VMware Tools. Must be used together with --powerOn the VI target for an ESX host and a single VM source. |
--X:logFile | Log internal events to given log file. |
--X:logLevel | Log level (none quiet panic error warning info verbose trivia). |
--X:logToConsole | Log internal events to console. |
--X:logTransferHeaderData | Add transfer header data to the log. Use with care. Default value false |
--X:maxNumberOfTermSignals | How many interrupt and term signals before forcefully halting OVF Tool instead of gracefully cleaning up. Default value is 5. |
--X:maxRedirects | Maximal number of allowed URL redirections (default value is 256). |
--X:maximalDeltaConfSize | Maximal size of a delta disk configuration. Default value is 8. Raising will make the delta disk approximation algorithm more accurate but slower. |
--X:maximalDeltaHeight | Maximal height of initial delta disk hierarchies (use in conjunction with --makeDeltaDisks) |
--X:maximalDeltaTreeSize | Maximal size of a delta disk tree (use in conjunction with --makeDeltaDisks). Set to 0 to allow any delta tree size. |
--X:monitor | Monitor the given first boot status file. Argument must be on the form: file://username:password@/path/to/statusFie.json Supported only for the VI target and together with the --X:waitForIp option. |
--X:noPrompting | Makes sure that OVF Tool fails if source and/or target require authentication. |
--X:progressSmoothing | Estimate download damping interval. Default value is 60 seconds. Set higher for more smoothing and lower for less. |
--X:useMacNaming | Specify that the directory created by default should use the the extension .vmwarevm |
--X:vCloudEnableGuestCustomization | Enable guest customization for uploaded VMs in an OVF. This only applies to vCloud 1.5 Targets. Default value is false. |
--X:vCloudKeepAliveTimeout | Specify the vCloud connection keep alive timeout in minutes. Default is 5 minutes. |
--X:vCloudKeepTemplate | Keep uploaded template in catalog. Default value is true |
--X:vCloudTimeout | vCloud server timeout defined in minutes. Default is 60 minutes (--X:vCloudTimeout=60). |
--X:vCloudVersion | Specify what vCloud api version to use. This applies to both source and destination |
--X:viUseProxy | Enable the use of proxy servers when using VI-locators. The default is false |
--X:vimSessionTimeout | Specify keep-alive interval for VI connections in minutes. Default is ten minutes (--X:vimSessionTimeout=10). |
--X:waitForIp | Waits for VMware tools to return an IP address and print it out. Must be used together with --powerOn the VI target and a single VM source. |
paul hayes says
Hi William, do you know if there is a way to set an administrator password on a virtual machine being deployed using the ovftool options --prop? Thanks, Paul
BobF says
Thanks! Very useful.
Would you expect the various retry options to apply when both source and target locators are ESX hosts (as you've described in another article). Just to see these working, I set to 100, but then verbose log seemed to indicate it still gave up on first connection loss (pulling the cable out for a few seconds).
2015-06-24T17:01:13.893+01:00 verbose -[08264] [Originator@6876 sub=Default] Curl session torn down
2015-06-24T17:01:13.894+01:00 verbose -[02368] [Originator@6876 sub=Default] Connection error, sleep then retry (100 remaining)
Transfer Failed
Transfer Failed
2015-06-24T17:01:18.897+01:00 verbose -[02368] [Originator@6876 sub=Default] Retry due to up/downloads size mismatch. 100 attempts remaining
2015-06-24T17:01:18.898+01:00 verbose -[02368] [Originator@6876 sub=Default] Determining source
2015-06-24T17:01:18.899+01:00 verbose -[02368] [Originator@6876 sub=Default] Determining target
Removing temporary objects and files
Error: Execution aborted
2015-06-24T17:01:18.903+01:00 verbose -[02368] [Originator@6876 sub=Default] Backtrace:
-->
--> [backtrace begin] product: VMware Workstation, version: e.x.p, build: build-2444548, tag: -
--> backtrace[00] vmacore.dll[0x001BBC9A]
--> backtrace[01] vmacore.dll[0x0005D18F]
--> backtrace[02] vmacore.dll[0x0005E3CE]
--> backtrace[03] vmacore.dll[0x00012C5B]
--> backtrace[04] ovftool.exe[0x00090815]
--> backtrace[05] ovftool.exe[0x0007AD72]
--> backtrace[06] ovftool.exe[0x00074CF5]
--> backtrace[07] ovftool.exe[0x000755C4]
--> backtrace[08] ovftool.exe[0x00307F46]
--> backtrace[09] KERNEL32.DLL[0x000013D2]
--> backtrace[10] ntdll.dll[0x000703C4]
--> [backtrace end]
-->
Completed with errors
Rogers says
Thanks William. --X:injectOvfEnv made my day !!!