> For the complete documentation index, see [llms.txt](https://docs.higiocloud.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.higiocloud.vn/compute/4.-hi-gio-api/api-creates-vm-from-template.md).

# API creates VM from Template

## <mark style="color:green;">Overview</mark>

* 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.

## <mark style="color:green;">Procedure</mark>

{% stepper %}
{% step %}
**Step 1: Preparation**

&#x20;Log in to IAM portal -> vCD portal: collect the information

**{{vcd\_url}}**

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FTW9ExMkiUFCHf3mJol4f%2Fimage.png?alt=media&amp;token=df40e552-ae10-4201-88e9-754a70a4b611" alt=""><figcaption></figcaption></figure>

\
**{{vdc\_uuid}}:** Login vCD portal -> select VDC-> take a look and note **vdc\_uuid** on the URL

<div align="left"><figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FWSSBqR1uqcoenea6ewtk%2Fimage.png?alt=media&amp;token=64abd1c6-89bb-4973-999a-9dded971b7b1" alt="" width="563"><figcaption></figcaption></figure></div>

**{{network\_uuid}}:** On the vCD portal -> Networking -> Networks -> New

{% hint style="warning" %}
**Note that the network name must be “VM Network”**
{% endhint %}

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2Fq5uTFuIuK3adewKG0ot5%2Fimage.png?alt=media&amp;token=0c9e46bf-6f76-4426-9374-641452423b4f" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2F20XMpEeF0BPV60q0Pz8r%2Fimage.png?alt=media&amp;token=79e7dcae-b1f4-4529-a822-f1db92d3edf6" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FwSKUUaEH5arYS11qDCEN%2Fimage.png?alt=media&amp;token=30830570-2b16-4996-bc27-4c1eb27e6851" alt=""><figcaption></figcaption></figure>

&#x20; **{{vappTemplate\_uuid}}:** On the vCD portal -> Content Hub -> Catalogs ->HIGIO Shared Catalogs

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FkMHzKqvZWqQJNBXeechy%2Fimage.png?alt=media&amp;token=1309b759-b5ef-4393-97ce-db81ec848f83" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FhMsvqUQDE5DU39W5do3S%2Fimage.png?alt=media&amp;token=1eb68272-7a0d-4eee-b188-9e98d769eefc" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FP18hv5axWMKsbpVNAbYe%2Fimage.png?alt=media&amp;token=640b032b-1497-4086-a167-75ad0ffe35f4" alt=""><figcaption></figcaption></figure>

&#x20;**{{Bearer Token}}**: Please follow **“**[**Api token login**](https://docs.higiocloud.vn/compute/4.-hi-gio-api/api-token-login.md)**”** document
{% endstep %}

{% step %}
**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

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FLFjtZs0EpOHZ1s3UXDcF%2Fimage.png?alt=media&amp;token=5ad4a84b-51ca-457e-8e09-e72f00f50a5c" alt=""><figcaption></figcaption></figure>

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>
```

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2Fzrb5FN0DPl0HjTJqT10a%2Fimage.png?alt=media&amp;token=955a91df-4dad-494b-ae86-871c8f72a2c1" alt=""><figcaption></figcaption></figure>

**SEND request.**
{% endstep %}

{% step %}

### Step 3: Verify

On the vCD -> Data Center -> select your Virtual Data Center ->vApps -> check your vApp and VM.

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.higiocloud.vn/compute/4.-hi-gio-api/api-creates-vm-from-template.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
