1.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
- Provisioning an Organization with vApps, Templates, and Media
- Deploying and Operating vApps
- Summary of vCloud API vApp and Virtual Machine Operations Requests
- Create a vApp From a Template
- Compose a vApp From Existing Virtual Machines
- Recompose a vApp to Add or Remove Virtual Machines
- Operate a vApp
- Configuring vApps and Virtual Machines
- Retrieve the Configuration Links for a vApp
- Retrieve the Configuration Links for 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
- Creating, Provisioning, and Managing Organizations
- Summary of Administrative Requests
- Administrator Credentials and Privileges
- Organization Administration
- Network Administration
- vDC Administration
- Catalog Administration
- User and Group Administration
- Working With Roles and Rights
- Controlling Access to vApps and Catalogs
- Using vCloud API Extensions to Provision and Manage a Cloud
- Working With Object Metadata
- Using the Query Service
- Configuring and Using Blocking Tasks and Notifications
- XML Representations in the vCloud API
- Index
Example: Create a Provider vDC
This request creates a small Provider vDC using a resource pool and datastore extracted from the response
portion of “Example: Retrieve a List of Resource Pools from a vCenter Server,” on page 169. In practice, the
DataStoreRefs element typically includes additional VimObjectRef elements that reference other datastores
available on the specified VimServer. The vCenter server that provides the resources is referenced in the
VimServerRef and VimServer elements.
Request:
POST https://vcloud.example.com/api/admin/extension/providervdcs
Content-Type: application/vnd.vmware.admin.vmwprovidervdc+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<vmext:VMWProviderVdc
xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
name="PvDC-Example"
type="application/vnd.vmware.admin.vmwprovidervdc+xml">
<vcloud:Description>Example Provider vDC</vcloud:Description>
<vmext:DataStoreRefs>
<vmext:VimObjectRef>
<vmext:VimServerRef
type="application/vnd.vmware.admin.vmwvirtualcenter+xml"
href="https://vcloud.example.com/api/admin/extension/vimServer/9" />
<vmext:MoRef>datastore-173</vmext:MoRef>
<vmext:VimObjectType>DATASTORE</vmext:VimObjectType>
</vmext:VimObjectRef>
</vmext:DataStoreRefs>
<vmext:ResourcePoolRefs>
<vmext:VimObjectRef>
<vmext:VimServerRef
type="application/vnd.vmware.admin.vmwvirtualcenter+xml"
href="https://vcloud.example.com/api/admin/extension/vimServer/9" />
<vmext:MoRef>resgroup-195</vmext:MoRef>
<vmext:VimObjectType>RESOURCE_POOL</vmext:VimObjectType>
</vmext:VimObjectRef>
</vmext:ResourcePoolRefs>
<vmext:VimServer
type="application/vnd.vmware.admin.vmwvirtualcenter+xml"
href="https://vcloud.example.com/api/admin/extension/vimServer/9" />
</vmext:VMWProviderVdc>
The response includes a Task that tracks the creation of the Provider vDC, and a set of Link elements that you
can use to operate on or modify the Provider vDC. It also includes read-only values for ComputeCapacity,
StorageCapacity, and HighestSupportedHardwareVersion that were derived from the vCenter, datastores, and
resource pool specified in the request, and a list of HostReferences identifying the ESX hosts that provide the
resources.
Response:
201 Created
Content-Type: application/vnd.vmware.admin.vmwprovidervdc+xml
...
<vmext:VMWProviderVdc
xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
vCloud API Programming Guide
174 VMware, Inc.