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

  1. Call the VirtualApp.ExportVApp method, which returns HttpNfcLease. The deviceURL is stored in the info property of HttpNfcLease.
  2. Call the HttpNfcLeaseInfo.getDeviceUrl method to access the device URL and download the image data from the device URL.
  3. Add the image to the OVF package.
  4. Call the OvfManager.CreateDescriptor method, which returns OvfCreateDescriptorResult. 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.

Figure 1. Generating an OVF Package
Diiagram shows steps to create an OVF pcakage with the API.