Recompose a vApp to Add or Remove Virtual Machines
The vCloud API supports recomposition of a vApp to add or remove virtual machines (Vm elements). To
recompose a vApp, a client makes a recomposeVApp request, supplying a RecomposeVAppParams element as
the request body. The RecomposeVAppParams element allows an arbitrary number of DeleteItem elements,
but is otherwise identical to ComposeVAppParams. This means that in addition to adding or removing virtual
machines, a recomposeVApp request can also change the name and description of the vApp, and can supply
new InstantiationParams to change various sections of the composed vApp or any of the added virtual
machines.
Example 5-6. vApp Before Recomposition
Request:
GET http://vcloud.example.com/api/v1.0/vApp/vapp-33
Response:
200 OK
Content-type: application/vnd.vmware.vcloud.vApp+xml
...
<VApp name="Example Corp's CRM Appliance" type="application/vnd.vmware.vcloud.vApp+xml"
<Link rel="up" type="application/vnd.vmware.vcloud.vdc+xml"
<Description>Composed CRM Appliance</Description>
...
<Children>
<Vm status="8" name="CRM-DB" href="http://vcloud.example.com/api/v1.0/vApp/vm-7" ...>
...
</Vm>
<Vm status="8" name="CRM-CRM" href="http://vcloud.example.com/api/v1.0/vApp/vm-44" ...>
...
</Vm>
<Vm status="8" name="CRM-HTTP" href="http://vcloud.example.com/api/v1.0/vApp/vm-45" ...>
...
</Vm>
</Children>
...
</VApp>
Example 5‐7 shows a recomposeVApp request that modifies the vApp shown in Example
of the virtual machines it contains and creating a new StartupSection that specifies a startup order for the
two virtual machines that remain in the vApp.
Example 5-7. Recompose a vApp
Request:
POST http://vcloud.example.com/api/v1.0/vApp/vapp-33/action/recomposeVApp
Content-Type: application/vnd.vmware.vcloud.recomposeVAppParams+xml
...
<RecomposeVAppParams name="Example Corp's CRM Appliance" xmlns="http://www.vmware.com/vcloud/v1"
<InstantiationParams>
<NetworkConfigSection>
<ovf:Info>Configuration parameters for logical networks</ovf:Info>
<NetworkConfig networkName="CRMApplianceNetwork">
</NetworkConfig>
</NetworkConfigSection>
VMware, Inc.
status="8" href="http://vcloud.example.com/api/v1.0/vApp/vapp-33" ...>
href="http://vcloud.example.com/api/v1.0/vdc/5"/>
xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">
<Configuration>
<ParentNetwork href="http://vcloud.example.com/api/v1.0/network/54"/>
<FenceMode>bridged</FenceMode>
</Configuration>
Chapter 5 Datacenter Operations
5‐6 by removing one
67
Need help?
Do you have a question about the VCLOUD API 1.0 - API and is the answer not in the manual?
Questions and answers