---
title: "Creates a VM in the project and returns the async operation."
method: POST
path: "/projects/{project_id}/compute/vms/instances"
tags: ["VMs"]
---

# Creates a VM in the project and returns the async operation.

`POST /projects/{project_id}/compute/vms/instances`

## Path parameters

- `project_id` string, required

## Request body

- InstancesPostRequestV1 — InstancesPostRequestV1 is the request type for POST requests to the vms.instances endpoint.
  - `commitment_period` integer — commitment is no longer supported
  - `crusoe_watch_agent_install_mode` 'docker' | 'native' — Installation mode for the Crusoe Watch Agent: docker or native. Defaults to docker.
  - `custom_image` string — ID of a custom image to use for the new VM. Either image or custom_image should be supplied, not both.
  - `disks` DiskAttachment[] — Disks to attach to the new VM.
    - `attachment_type` 'os' | 'data', required — Role the disk plays for the VM: os or data.
    - `disk_id` string, required — ID of the disk to attach.
    - `mode` 'read-only' | 'read-write', required — Access mode to attach the disk with: read-only or read-write.
  - `host_channel_adapters` PartialHostChannelAdapter[] — Host channel adapters to attach to the new VM.
    - `ib_partition_id` string — Deprecated: Use transport_partition_id instead.
    - `transport_partition_id` string — ID of the transport partition to assign the host channel adapter to.
  - `image` string — Name of the OS image to use for the new VM. Either image or custom_image should be supplied, not both.
  - `install_crusoe_watch_agent` boolean, nullable — Whether to install the Crusoe Watch Agent on the VM. Defaults to true.
  - `location` string, required — Location to create the VM in.
  - `maintenance_policy` string — Host maintenance policy to apply to the new VM: manual, stop-vm, or unspecified.
  - `name` string, required — Name for the new VM.
  - `network_interfaces` NetworkInterface[] — Network interfaces to attach to the new VM.
    - `external_dns_name` string, required — External DNS name of the network interface.
    - `id` string, required — ID of the network interface.
    - `interface_type` string, required — Type of the network interface.
    - `ips` IPAddresses[], required — IP addresses assigned to the network interface.
      - `private_ipv4` PrivateIPv4Address, required
        - `address` string, required — Private IPv4 address.
      - `public_ipv4` PublicIPv4Address, required
        - `address` string, required — Public IPv4 address.
        - `id` string, required — ID of the public IPv4 address.
        - `type` string, required — Allocation type of the public IPv4 address (for example, dynamic).
    - `mac_address` string, required — MAC address of the network interface.
    - `name` string, required — Name of the network interface.
    - `network` string, required — ID of the VPC network the interface is attached to.
    - `subnet` string, required — ID of the VPC subnet the interface is attached to.
  - `nvlink_domain_id` string — ID of the NVLink domain to create the VM in.
  - `reservation_specification` ReservationSpecification
    - `id` string — ID of the reservation to use for the VM. Incompatible with selection_strategy.
    - `selection_strategy` 'lowest_cost' | 'on_demand' — Strategy for automatically selecting a reservation: lowest_cost or on_demand. Use on_demand to opt out of reservation usage. Incompatible with id.
  - `shutdown_script` string — Script to run when the VM shuts down.
  - `ssh_public_key` string, required — SSH public key to grant access to the new VM.
  - `startup_script` string — Script to run when the VM starts.
  - `type` string, required — Product name of the VM type to create.
  - `virtualization_features` VirtualizationFeatures
    - `nested_virtualization` boolean — Whether nested virtualization is enabled, allowing a VM to run inside this VM.

## Response `200`

- AsyncOperationResponse
  - `operation` Operation, required — Individual resources that use Operations should populate the `metadata` field with resource-specific information.
    - `completed_at` string, required
    - `metadata` string, required
    - `operation_id` string, required
    - `result` string
    - `started_at` string, required
    - `state` 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED', required

## Other responses

- `400` — Error Bad Request
- `401` — Error Authentication Failed
- `403` — Error Permissions
- `500` — Error Internal Server

---

[API](https://skmtc.net/crusoecloud/apis/crusoe-cloud-api-gateway.md) · [All operations](https://skmtc.net/crusoecloud/apis/crusoe-cloud-api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crusoecloud/crusoe-cloud-api-gateway/versions/a3fd2dedc72b/schema)
