5.5

Table Of Contents
Procedure
1 Examine the OVF descriptor of the template to determine the values that you can include in a
SourcedVmInstantiationParams element.
See “Example: Modify Virtual Machine Hardware During vApp Template Instantiation,” on page 96
for guidelines.
2 Include the SourcedVmInstantiationParams element in an InstantiateVAppTemplateParams element.
See “Example: Modify Virtual Machine Hardware During vApp Template Instantiation,” on page 96.
3 Make a POST request to the action/instantiateVAppTemplate URL of the VDC.
Supply the InstantiateVAppTemplateParams element as the request body.
Example: Modify Virtual Machine Hardware During vApp Template Instantiation
This InstantiateVAppTemplateParams request extends the one shown in “Example: Instantiate a vApp
Template,” on page 94 to include a SourcedVmInstantiationParams element that makes several configuration
changes in the virtual machine referenced at https://vcloud.example.com/api/vAppTemplate/vm-4.
n
Specifies a storage profile for the virtual machine.
n
Adds a virtual CPU and changes the value of CoresPerSocket to 2. If you include a CoresPerSocket
element, its value must be an integer multiple of the value of the existing rasd:VirtualQuantity of CPU
items, or of the value you supply in NumberOfCpus. “Example: Modify the CPU Configuration of a
Virtual Machine,” on page 136 shows the original CPU configuration, and how to make this change by
reconfiguring the virtual machine in a deployed vApp.
n
Increases the capacity of the hard disk from 1GB to 10GB by including a Disk element that specifies a
Size of 10240 for the disk that has a rasd:InstanceID value of 2000. The value you supply for Size is
interpreted as megabytes. You can see the original disk configuration in “Example: Retrieve the Hard
Disks and Controllers in a Virtual Machine,” on page 142. “Example: Modify the Hard Disk
Configuration of a Virtual Machine,” on page 144 shows how to make the same change by
reconfiguring the virtual machine in a deployed vApp. If you include a Disk element, the value of its
instanceId attribute must match the value in the rasd:InstanceID element of an existing Item that
defines a virtual disk (RASD resource type 17). Disk capacity can be raised, but not lowered, for disks
on SATA and SCSI controllers. The capacity of other disk types cannot be changed. Item elements that
represent SATA disks have a vcloud:busType attribute with the value 20. Those that represent SCSI
disks have a vcloud:busType attribute with the value 6.
Request:
POST https://vcloud.example.com/api/vdc/5/action/instantiateVAppTemplate
Content-Type: application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<InstantiateVAppTemplateParams
xmlns="http://www.vmware.com/vcloud/v1.5"
name="Linux FTP server"
deploy="true"
powerOn="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">
<Description>Example FTP Server</Description>
<InstantiationParams>
<NetworkConfigSection>
<ovf:Info>Configuration parameters for logical networks</ovf:Info>
<NetworkConfig
networkName="vAppNetwork">
vCloud API Programming Guide
96 VMware, Inc.