To initiate the OVF upload, a client makes a POST request to the uploadVAppTemplate URL of the target vDC. The request body is an UploadVAppTemplateParams element.

The first step in uploading an OVF package is to request vCloud Director to create a vAppTemplate object to represent the template that will be constructed from the upload. This request returns a response that includes a URL to which you can upload the package's descriptor file.

Verify that you have the following information:

An OVF package to upload.

You are logged in as a user who has permission to upload OVF packages and create vApp templates.

You know the URL of the target vDC that will receive the upload. Retrieve the XML representation of your organization to see a list of the vDCs that it contains.

1

Find the uploadVappTemplate link in the target vDC.

Retrieve the XML representation of the vDC using a request like the one shown in the request portion of Example: Deployment Information in a vDC. The response contains an uploadVappTemplate link, which has the following form:

<Link
      rel="add"
      type="application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml"
      href="https://vcloud.example.com/api/vdc/5/action/uploadVAppTemplate" />
2

Create an UploadVAppTemplateParams element that specifies a name for the template.

The Description element is optional. Using it to provide a concise description of this object is a best practice. See the request portion of Example: Initiating the Upload.

3

(Optional) If the OVF package includes a manifest, include a manifestRequired="true" attribute in the UploadVAppTemplateParams element.

Some OVF packages include a manifest document, which provides a checksum for each file in the package. When the UploadVAppTemplateParams element includes a manifestRequired="true" attribute, the set of File elements returned after you upload the OVF descriptor includes one for the manifest itself.

4

Make an HTTP POST request to the uploadVAppTemplate link that you retrieved in Step 1, supplying the UploadVAppTemplateParams element in the request body.

See the request portion of Example: Initiating the Upload.

5

Examine the response.

The response, a VAppTemplate element, contains a File element that specifies an upload URL for the package's OVF descriptor. See the response portion of Example: Initiating the Upload.

The server creates a new VAppTemplate object in the target vDC and returns the object's XML representation in the response. See the response portion of Example: Initiating the Upload.

This example assumes an OVF package that has no manifest.

Request:

POST https://vcloud.example.com/api/vdc/5/action/uploadVAppTemplate
Content-Type: application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<UploadVAppTemplateParams
   name="Ubuntu Template"
   xmlns="http://www.vmware.com/vcloud/v1.5"
   xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">
   <Description>Ubuntu vApp Template</Description>
</UploadVAppTemplateParams>

Response:

201 Created
Content-Type: application/vnd.vmware.vcloud.vAppTemplate+xml
...
<VAppTemplate
   xmlns="http://www.vmware.com/vcloud/v1.5"
   xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1"
   ovfDescriptorUploaded="true"
   goldMaster="false"
   status="0"
   name="Ubuntu Template"
   id="urn:vcloud:vapptemplate:268"
   href="https://vcloud.example.com/api/vAppTemplate/vappTemplate-268"
   type="application/vnd.vmware.vcloud.vAppTemplate+xml">
   <Link
      rel="up"
      type="application/vnd.vmware.vcloud.vdc+xml"
      href="https://vcloud.example.com/api/vdc/5"/>
   <Link
      rel="remove"
      href="https://vcloud.example.com/api/vAppTemplate/vappTemplate-268" />
   <Description>Ubuntu vApp Template</Description>
   <Files>
      <File
         name="descriptor.ovf"
         bytesTransferred="0">
         <Link
            rel="upload:default"
            href="https://vcloud.example.com/transfer/.../descriptor.ovf" />
      </File>
   </Files>
   <Owner>
      ...
   </Owner>
   <Children />
   <LeaseSettingsSection>
      ...
   </LeaseSettingsSection>
   <CustomizationSection>
      ...
   </CustomizationSection>
</VAppTemplate>

The response body includes the following attributes:

An href attribute whose value is a link to the new VAppTemplate object.

An ovfDescriptorUploaded attribute with a value of false, indicating that the OVF descriptor file is not uploaded.

A status attribute with a value of 0, indicating that the file references in the descriptor are not uploaded. (A VAppTemplate with a status of 0 is said to be unresolved.)

A goldMaster attribute, initially set to false.

An id attribute. See Objects, References, and Representations.

The response body also includes a File element with an upload URL (rel="upload:default") for the OVF descriptor. The server creates the name attribute of this File element, which specifies a container that the server creates to receive the contents of the descriptor. The name attribute has no relation to the file name of the descriptor in the client’s file system.

In addition to the File element, the response includes Owner, Children, LeaseSettingsSection, and CustomizationSection elements that the server creates and sets to their default contents. For more information about these elements, see the schema reference.