API creates VM from Template
Overview
In this manual, you will find detailed information on how to prepare & create a VM from the template.
This API creates a VM with the default name (VM name of template), default network "VM Network," and default compute and storage.
Procedure
Step 1: Preparation
Log in to IAM portal -> vCD portal: collect the information
{{vcd_url}}

{{vdc_uuid}}: Login vCD portal -> select VDC-> take a look and note vdc_uuid on the URL

{{network_uuid}}: On the vCD portal -> Networking -> Networks -> New
Note that the network name must be “VM Network”

Select the “VM Network” -> take a look and note the network uuid on the url


{{vappTemplate_uuid}}: On the vCD portal -> Content Hub -> Catalogs ->HIGIO Shared Catalogs

-> vApp Templates -> select the template that you want to create VM -> take a look the vappTemplate_uuid on the url


{{Bearer Token}}: Please follow “Api token login” document
Step 2: Create VM from template
Postman:
POST https://{{vcd_url}}/api/vdc
/{{vdc_uuid}}/action/instantiateVAppTemplate
Authorization: {{Bearer Token }}
Headers:
- 'Accept: */*;version=37.2
- ‘Content-type’: application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml; charset=ISO-8859-1

Body: {{select raw, copy, paste and edit the code below}}
<?xml version="1.0" encoding="UTF-8"?>
<vcloud:InstantiateVAppTemplateParams
xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1"
xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
deploy="false"
name="your vapp name"
powerOn="false">
<vcloud:Description>VApp Description</vcloud:Description>
<vcloud:InstantiationParams>
<vcloud:NetworkConfigSection>
<ovf:Info>NetInfo</ovf:Info>
<vcloud:NetworkConfig networkName="VM Network">
<vcloud:Configuration>
<vcloud:ParentNetwork
href="https:// {{vcd_url}}/api/network/{{network_uuid}}"
name="VM Network"
type="application/vnd.vmware.vcloud.network+xml"/>
<vcloud:FenceMode>bridged</vcloud:FenceMode>
</vcloud:Configuration>
</vcloud:NetworkConfig>
</vcloud:NetworkConfigSection>
</vcloud:InstantiationParams>
<vcloud:Source
href="https://{{vcd_url}}/api/vAppTemplate/{{vappTemplate_uuid}}"
name="HIGIO"
type="application/vnd.vmware.vcloud.vAppTemplate+xml"/>
</vcloud:InstantiateVAppTemplateParams>

SEND request.
Last updated