# Create a Cloud GPU VM

You can create a Cloud GPU VM in a specific data center using a composite call, a specialized configuration containing a GPU card. These resources must be defined simultaneously in a single composite request. Composite calls efficiently bundle a series of [<mark style="color:blue;">REST API</mark>](https://api.ionos.com/docs/cloud/v6/#tag/Servers) requests into a single operation, allowing you to use the output of one request as the input for a subsequent request.

{% hint style="info" %}
**Note:** The payload for a composite call that configures a Cloud GPU VM differs significantly from a standard `POST` request used to create an Enterprise Server. With the composite call, you can simultaneously create a new instance, define its direct-attached storage device, and select the image ([<mark style="color:blue;">public image</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/images-snapshots/public-images), a [<mark style="color:blue;">private image</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/images-snapshots/private-images), or a [<mark style="color:blue;">snapshot</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/images-snapshots/snapshots)) in a single request. Once the request is processed, the Cloud GPU VM is created, and the direct-attached storage is mounted automatically.
{% endhint %}

{% hint style="warning" %}
**Important considerations for Cloud GPU VMs:**

* **Live migrations are not supported:** Cloud GPU VMs cannot be migrated between hosts without downtime.
* **Maintenance reboots may occur without warning:** System maintenance may require unexpected reboots.
* **Limited availability:** The Cloud GPU VMs are only available using the API and in the **Frankfurt** `de/fra/2` region.
* **No direct attached storage for Cloud GPU VM:** Direct attached storage is not available for Cloud GPU VMs.
  {% endhint %}

## Request endpoint

Use the following endpoint for the Cloud GPU VM creation: `https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/servers`

## Request

Use a `POST` request to the servers collection endpoint within the target data center. This single request acts as the composite call, provisioning the VM and its specialized devices simultaneously.

```bash
curl --location \
--request POST 'https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/servers' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
--header 'Content-Type: application/json'
'{
  "properties": {
   "name": "My GPU server",
    "type": "GPU",
    "availabilityZone": "AUTO",
    "templateUuid": "e15d15e7-ea9a-48ae-a60a-29b9463f4519"
      },
      "entities": {
        "volumes": {
            "items": [
                {
                    "properties": {
                        "name": "GPU Volume",
                        "imageAlias": "ubuntu:latest",
                        "imagePassword": "xxxxxxxxxx"
                    }
                }
            ]
        }
    }
}'
```

### Request parameters

#### Header Parameters

To make authenticated requests to the API, the following fields are mandatory in the request header:

| **Name**        | **Type** | **Required** | **Description**             |
| --------------- | -------- | ------------ | --------------------------- |
| `Authorization` | string   | Yes          | The `Bearer token`.         |
| `Content-Type`  | string   | Yes          | Must be `application/json`. |

#### Path Parameters

To make authenticated requests to the API, the following fields are mandatory in the request header:

| **Name**       | **Type** | **Required** | **Description**            |
| -------------- | -------- | ------------ | -------------------------- |
| `datacenterId` | string   | Yes          | The ID of the data center. |

## Response

A **202** message confirms that the instance is in the process of being created. You may want to poll the status URI that is returned in the response header to follow the progress of provisioning. The instance will be available once the status is set to "DONE".

```json
{
  "id": "5de45b21-9b54-4957-b3d6-4af44d0c12cd",
  "type": "server",
  "href": "<RESOURCE-URI>",
  "metadata": {
    "etag": "45480eb3fbfc31f1d916c1eaa4abdcc3",
    "createdDate": "2015-12-04T14:34:09.809Z",
    "createdBy": "john.doe@example.com",
    "createdByUserId": "john.doe@example.com",
    "lastModifiedDate": "2015-12-04T14:34:09.809Z",
    "lastModifiedBy": "john.doe@example.com",
    "lastModifiedByUserId": "63cef532-26fe-4a64-a4e0-de7c8a506c90",
    "state": "BUSY"
  },
  "properties": {
    "name": "My GPU server",
    "cores": null,
    "ram": null,
    "availabilityZone": "AUTO",
    "vmState": null,
    "bootVolume": null,
    "cpuFamily": null,
    "type": "GPU",
    "templateUuid": "33e35155-1c77-4c34-b1e3-4094e307cd21",
    "nicMultiQueue": null,
    "bootCdrom": null
  },
  "entities": {
    "volumes": {
      "id": "5de45b21-9b54-4957-b3d6-4af44d0c12cd/volumes",
      "type": "collection",
      "href": "<RESOURCE-URI>"
    },
    "nics": null
  }
}
```
