To export a virtual application, you must generate an OVF package. The Web Services API supports the generation of OVF packages. It does not support the generation of OVA files. An OVA file is a tar file that contains an OVF package. The OVF package consists of one of more images and an OVF file descriptor. You can create an OVA file by creating a tar file out of the OVF package for your exported virtual application.
The following steps describe how to use the vSphere VirtualApp
and OvfManager
API to generate an OVF package for a virtual application. The steps assume the simplest scenario: downloading one image from one device URL. You use the same steps to download many images from many device URLs. You can also export a VirtualMachine with the same steps, but use VirtualMachine.ExportVm
rather than VirtualApp.ExportVApp
.
Procedure
- Call the
VirtualApp.ExportVApp
method, which returnsHttpNfcLease
. ThedeviceURL
is stored in theinfo
property ofHttpNfcLease
. - Call the
HttpNfcLeaseInfo.getDeviceUrl
method to access the device URL and download the image data from the device URL. - Add the image to the OVF package.
- Call the
OvfManager.CreateDescriptor
method, which returnsOvfCreateDescriptorResult
. Write the file descriptor to a file with the file extension .ovf. Add the .ovf file to the OVF package.
Example
Generating an OVF Package shows the major steps.