5.1

Table Of Contents
Procedure
1 Find the composeVApp link in the target vDC.
The XML representation of the vDC contains a composeVapp link, which has the following form:
<Link
rel="add"
type="application/vnd.vmware.vcloud.composeVAppParams+xml"
href="https://vcloud.example.com/api/vdc/5/action/composeVApp" />
2 Create a ComposeVappParams element that specifies the details of the composition.
3 POST the ComposeVappParams element to the composeVapp link of the target vDC.
See the Request portion of “Example: Compose a vApp,” on page 88.
Example: Compose a vApp
This request specifies two vAppTemplate items and one Vm item. The Vm item requires InstantiationParams that
modify its NetworkConnectionSection to specify the vApp network created for this vApp. The vAppTemplate
items inherit this setting from the base InstantiationParams element that appears before the first
SourcedItem is specified.
NOTE Virtual machines specified in Source elements must be powered off or this operation will fail. You can
use a query like this one to return a list of references to powered-off virtual machines that you have access to.
https://vcloud.example.com/api/query?type=adminVM&format=references&filter=status==POWERED_OFF
See Chapter 9, “Using the Query Service,” on page 247.
Request:
POST https://vcloud.example.com/api/vdc/5/action/composeVApp
Content-Type: application/vnd.vmware.vcloud.composeVAppParams+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<ComposeVAppParams
name="Example Corp’s CRM Appliance"
xmlns="http://www.vmware.com/vcloud/v1.5"
xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">
<Description>Composed CRM Appliance</Description>
<InstantiationParams>
<NetworkConfigSection>
<ovf:Info>Configuration parameters for logical networks</ovf:Info>
<NetworkConfig
networkName="CRMApplianceNetwork">
<Configuration>
<ParentNetwork
href="https://vcloud.example.com/api/network/54" />
<FenceMode>natRouted</FenceMode>
</Configuration>
</NetworkConfig>
</NetworkConfigSection>
</InstantiationParams>
<SourcedItem>
<Source
href="https://vcloud.example.com/api/vApp/vm-4" />
<InstantiationParams>
<NetworkConnectionSection
vCloud API Programming Guide
88 VMware, Inc.