I recently came across an interesting question about using the ovftool to deploy OVF files that are located on an ESXi datastore. My initial thought was that you would not be able to deploy the OVF files since the ovftool would not have access to the files locally. After finishing a recent article about ESXi datastore management using the vCLI's vifs utility, I then realized there might actually be a way to deploy OVF files that are stored on an ESXi datastore.
If you take a look on page 17 of the ovftool user guide, there is a table describing the various source locators that are supported. You can see that the source of an OVF file can be accessed by ovftool in 4 different methods including HTTP/HTTPs which is a key for this specific request.
|Source Type||Default File||Extension Protocol|
|OVF||.ovf||File, HTTP, HTTPS, FTP|
|OVA||.ova||File, HTTP, HTTPS, FTP|
Files and folders management for a datastore is exposed through the fileManager in the vSphere API and datastores are referenced as a URL or remote path.
A URL has the form
- scheme is http or https.
- authority specifies the hostname or IP address of the Center or ESX(i) server and optionally the port.
- dcPath is the inventory path to the Datacenter containing the Datastore.
- dsName is the name of the Datastore.
- path is a slash-delimited path from the root of the datastore.
Here is an OVF that is stored on a datastore located on an ESXi host:
https://vesxi50-4.primp-industries.com/folder/MyVM/MyVM.ovf?dcPath=ha-datacenter&dsName=iSCSI-1To confirm the URL path, we can use ovftool to perform a simple "probe" on our OVF, this will provide you with a quick summary of the OVF.