Deploy OVF using OVFTool

VMware OVF Tool is a command-line utility that can import and export Open Virtualization Format (OVF) packages to and from many VMware products.

This tool can be used to deploy OVF/OVA packages instead of vSphere GUI, where OVF deploy sometimes just don’t work and is pain to troubleshoot, since it is web browser based. I was missing in OVF documentation example how to deploy virtual machine to specific folder and resource pool. This is important, when you have rights assigned just to specific resource pool and vmFolder.

"C:\Program Files\VMware\VMware OVF Tool\ovftool.exe" ^
--datastore=Datastore1 --diskMode=thin --network="dvPortGroup1" --name=example_vm ^
--vmFolder="Lab/Linux/Test Folder" ^
source_virtual_machine.ovf ^
"vi://your.username@vcenter.fqdn/DATACENTER_NAME/host/CLUSTER_NAME/Resources/TOP_RESOURCE_POOL/SUB_RESOURCE_POOL"

This is example, which will deploy source_virtual_machine.ovf  to virtual machine named example_vm in VMFolder path Lab/Linux/Test Folder and into sub resource pool TOP_RESOURCE_POOL/SUB_RESOURCE_POOL which resided under cluster CLUSTER_NAME

Note: ^ character is only used for multi-line input in cmd (pretty formatting). Command can be in one line, without ^

2 thoughts on “Deploy OVF using OVFTool

  1. I am trying to copy vm from 1st esxi host to the 2nd esxi host.
    When I do this, it copies the VM to the root of the datastore of the 2nd esxi host.
    I would like to copy the vm to a folder located on the datastore of the 2nd esxi host.
    Not on the actual root.
    Therefore, I am trying to use the following cmd –vmFolder=Backup2022
    I keep getting following error : Invalid VM folder specified

    I don’t have Vsphere, I am accessing the esxi host through VMWorkstation 16.
    I am using the following script: ovftool.exe -ds=datastore3 –vmFolder=Backup2022 vi://”Source IP address”/”VM name” vi://”Target IP Address”

    Any help is appreciated,

  2. I think you misunderstood what is “vmfolder”. It is not a folder on datastore, it is object in vcenter’s inventory.

Leave a Reply

Your email address will not be published. Required fields are marked *