5.5
Table Of Contents
- vCloud API Programming Guide
- Contents
- vCloud API Programming Guide
- About the VMware vCloud API
- Hello vCloud: A Simplified RESTful Workflow
- Exploring a Cloud
- Summary of vCloud API Browsing Requests
- Retrieve the Login URL and List of Supported API Versions
- Create a Login Session Using the Integrated Identity Provider
- Retrieve a List of Organizations Accessible to You
- Retrieve an Administrative View of a Cloud
- Retrieve a List of vSphere Platform Operations and Objects for a Cloud
- Provisioning an Organization
- Summary of vCloud API Provisioning Requests
- Upload an OVF Package to Create a vApp Template
- Download a vApp or vApp Template as OVF
- Upload a Media Image
- Download a Media Image
- Capturing and Importing vApps
- Managing Catalog Items
- Creating and Using Independent Disks
- View or Change the Owner of an Object
- Controlling Access to vApps and Catalogs
- Deploying and Operating vApps
- Summary of vCloud API vApp and Virtual Machine Operations Requests
- Create a vApp From a Template
- Create a vApp From an OVF Package
- Compose a vApp From Existing Virtual Machines
- Recompose a vApp to Add or Remove Virtual Machines
- Clone a vApp
- Capture a vApp as a Template
- Update vApp Access Controls
- Provide User Input Requested by a Virtual Machine
- Attach or Detach an Independent Disk
- Creating and Using vApp Snapshots
- Operate a vApp
- Configuring vApps and Virtual Machines
- Retrieve the Configuration Links for a vApp
- Retrieve the Configuration Links for a Virtual Machine
- Update Multiple Sections of a Virtual Machine
- Retrieve or Update a Modifiable Section
- Update a vApp Network Configuration
- Update the NetworkConnectionSection of a Virtual Machine
- Retrieve or Modify the CPU Configuration of a Virtual Machine
- Retrieve or Modify the GuestCustomizationSection of a Virtual Machine
- Retrieve or Modify ProductSection Elements
- Retrieve or Modify Groups of Related Sections in a Virtual Machine
- Retrieve or Modify the Hard Disk Configuration of a Virtual Machine
- Update the Storage Profile for a Virtual Machine
- Creating and Managing Organizations
- Summary of Administrative Requests
- Administrator Credentials and Privileges
- Organization Administration
- VDC Administration
- Network Administration
- Catalog Administration
- User and Group Administration
- Working With Roles and Rights
- Managing and Monitoring a Cloud
- Summary of System Administration Requests
- Retrieve or Update System Settings
- Attach a vCenter Server
- Finding Available vCenter Resources
- Create a Provider VDC
- Create an External Network
- Create a Network Pool
- Import a Virtual Machine from vCenter
- Relocate a Virtual Machine to a Different Datastore
- Truststore and Keytab Maintenance
- Retrieve the vSphere URL of an Object
- Working With Object Metadata
- Using the Query Service
- Configuring and Using Blocking Tasks and Notifications
- vCloud Director Extension Services
- XML Representations in the vCloud API
- Index
Compose a vApp From Existing Virtual Machines
With the vCloud API composeVApp operation, you can build a vApp from existing virtual machines,
including virtual machines contained by vApps and vApp templates to which you have access.
Every VDC includes a link to a composeVApp operation, which creates a new vApp in it. To compose a vApp,
POST a composeVApp request to this link. The request body is a ComposeVAppParams element, which includes
the following information:
n
An InstantiationParams element that can include any of the section types listed under “Configuring a
vApp,” on page 117. This is where you define the vApp network to which all the virtual machines in
the composed vApp connect, and custom vApp lease settings and startup parameters for the virtual
machines.
n
An optional Description of the composed vApp.
n
Zero or more SourcedItem elements, each of which defines a source of virtual machines to include in the
composition. Each SourcedItem must contain a Source element that references a composition source, the
href of a Vm, VApp, or VAppTemplate. If the Source element references a virtual machine, the SourcedItem
can include any of the following elements:
n
An InstantiationParams element specific to that virtual machine. This element can include any of
the section types listed under “Configuring a Virtual Machine,” on page 117.
n
A NetworkAssignment element that specifies how the network connections in the virtual machine
are mapped to vApp networks defined in the InstantiationParams element that applies to the
composed vApp.
n
A VAppScopedLocalId element that provides a unique identifier for the virtual machine in the scope
of the composed vApp.
If the Source element references a vApp or vApp template, all Vm elements from each composition
source become peers in the Children collection of the composed vApp.
n
If any of the composition items is subject to a EULA, the ComposeVAppParams element must include an
AllEULAsAccepted element that has a value of true, indicating that you accept the EULA. Otherwise,
composition fails.
The composed vApp must be deployed and powered on before you can use it.
Prerequisites
Verify that you are logged in to the vCloud API as a system administrator or member of an organization in
the cloud.
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 102.
Chapter 5 Deploying and Operating vApps
VMware, Inc. 101