> For the complete documentation index, see [llms.txt](https://docs.i3d.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.i3d.net/compute/flexvm/creating-and-deleting-a-vm.md).

# Creating and Deleting a VM

## Create a VM via the API

Use the `POST /v3/flexVM/clouds/{cloudUuid}/vms` endpoint with a JSON body.

**Example request:**

```http
POST /v3/flexVM/clouds/{cloudUuid}/vms
Host: api.i3d.net
PRIVATE-TOKEN: YOUR_API_KEY
Content-Type: application/json

{
  "description": "DB1 VM",
  "image_name": "ubuntu-2404-server-amd64",
  "instance_type_name": "vm.gpu.1rtx4000.30c.240g",
  "name": "development.ubuntu-2404",
  "ssh_keys": [
    "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTuRa6Gtysdg2EF+SIXheVFVpHJrKYs4kWfNoHQg8ZG6PH4= ecdsa-key-20240131"
  ],
  "tags": [
    "project:odyssey",
    "env:build"
  ]
}
```

{% hint style="info" %}
Response (201 Created) returns the VM object, including its `vmUuid` and initial status (`provisioning`). The VM transitions through `provisioning` → `starting` → `running`. You can monitor its status using the GET VM endpoint.
{% endhint %}

## Configuring access and first boot

The example above uses `ssh_keys`, which is the shortest path to a reachable Linux VM: FlexVM installs the keys on the default user for you.

Instead of `ssh_keys` you can pass a `user_data` object, which is processed by cloud-init on the VM's first boot. Use it to create your own users, install packages, write files, or run a provisioning script — on Linux as well as Windows. `ssh_keys` and `user_data` cannot be combined, and providing `user_data` makes you responsible for configuring access. See [Cloud-init user-data](/compute/flexvm/cloud-init-user-data.md).

## Create a VM with Terraform

You can also create a VM with the i3D.net Terraform provider — see [Using Terraform](/compute/flexvm/using-terraform.md).

## Deleting a VM

Use the `DELETE /v3/flexVM/clouds/{cloudUuid}/vms/{vmUuid}` endpoint. No request body is required.

**Example request:**

```http
DELETE /v3/flexVM/clouds/{cloudUuid}/vms/{vmUuid}
Host: api.i3d.net
PRIVATE-TOKEN: YOUR_API_KEY
```

{% hint style="danger" %}
The VM's local LVM disk and NVMe passthrough disk are immediately wiped.
{% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.i3d.net/compute/flexvm/creating-and-deleting-a-vm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
