---
title: "Creates an instance template in the project and returns the created instance template."
method: POST
path: "/projects/{project_id}/compute/instance-templates"
tags: ["Instance Templates"]
---

# Creates an instance template in the project and returns the created instance template.

`POST /projects/{project_id}/compute/instance-templates`

## Path parameters

- `project_id` string, required

## Request body

- InstanceTemplatePostRequestV1
  - `custom_image_name` string — Custom image to use for all VMs created from this instance template. Only one of Image or CustomImage should be supplied at once.
  - `disks` DiskTemplate[] — Disks to attach to all VMs created from this instance template.
    - `size` string, required — Size of the disk, including a unit suffix.
    - `type` 'persistent-ssd' | 'shared-volume', required — Type of disk to create: persistent-ssd or shared-volume.
  - `ib_partition_id` string — Deprecated: Use transport_partition_id instead.
  - `image_name` string — OS Image to use for all VMs created from this instance template.
  - `location` string — Location to use for all VMs created from this instance template. If provided, all location-specific resources must also be provided.
  - `maintenance_policy` string — Host maintenance policy controlling how VMs created from this instance template behave during host maintenance.
  - `nvlink_domain_id` string — NVLink domain to assign to all VMs created from this instance template.
  - `placement_policy` string — Placement policy controlling how VMs created from this instance template are distributed across hosts: spread or unspecified.
  - `public_ip_address_type` string — Public IP address type to use for all VMs created from this instance template. Must either be "static" or "dynamic".
  - `reservation_id` string — Reservation to use for all VMs created from this instance template.
  - `shutdown_script` string — Shutdown script to use for all VMs created from this instance template.
  - `ssh_public_key` string, required — SSH public key to use for all VMs created from this instance template.
  - `startup_script` string — Startup script to use for all VMs created from this instance template.
  - `subnet_id` string — Subnet to use for all VMs created from this instance template. This is location-specific and must be provided if location is provided.
  - `template_name` string, required — Name of the instance template. (This is not the name of the VMs created from this instance template.)
  - `transport_partition_id` string — IB or RoCE partition to use for all VMs created from this instance template. Should only be provided for transport-enabled VM types. This is location-specific and must be provided if location is provided.
  - `type` string, required — Product name of the VM type we want to create from this instance template.
  - `virtualization_features` VirtualizationFeatures
    - `nested_virtualization` boolean — Whether nested virtualization is enabled, allowing a VM to run inside this VM.

## Response `200`

- InstanceTemplate
  - `created_at` string, required — Creation timestamp of the instance template, in RFC3339 format.
  - `custom_image_name` string — Custom image to use for all VMs created from this instance template.
  - `disks` DiskTemplate[] — Disks attached to all VMs created from this instance template.
    - `size` string, required — Size of the disk, including a unit suffix.
    - `type` 'persistent-ssd' | 'shared-volume', required — Type of disk to create: persistent-ssd or shared-volume.
  - `ib_partition_id` string, required
  - `id` string, required — ID of the instance template.
  - `image_name` string, required — OS Image to use for all VMs created from this instance template.
  - `location` string, required — Location to use for all VMs created from this instance template. May be empty if we do not want to bind this template to a location.
  - `maintenance_policy` 'manual' | 'stop-vm' | 'unspecified', required — Host maintenance policy controlling how VMs created from this instance template behave during host maintenance: manual, stop-vm, or unspecified.
  - `name` string, required — Name of the instance template. (This is not the name of the VMs created from this instance template.)
  - `nvlink_domain_id` string — NVLink domain assigned to all VMs created from this instance template.
  - `placement_policy` 'spread' | 'unspecified', required — Placement policy controlling how VMs created from this instance template are distributed across hosts: spread or unspecified.
  - `project_id` string, required — ID of the project this instance template belongs to.
  - `public_ip_address_type` string, required — Public IP address type to use for all VMs created from this instance template. Must either be "static" or "dynamic".
  - `reservation_id` string — Reservation used for all VMs created from this instance template.
  - `shutdown_script` string, required — Shutdown script to use for all VMs created from this instance template.
  - `ssh_public_key` string, required — SSH public key to use for all VMs created from this instance template.
  - `startup_script` string, required — Startup script to use for all VMs created from this instance template.
  - `subnet_id` string, required — SubnetID to use for all VMs created from this instance template. Only used if template has a location.
  - `transport_partition_id` string, required — IB or RoCE partition to use for all VMs created from this instance template. Only used for transport-enabled VM types. Empty if template has no location.
  - `type` string, required — Product name of the VM type we want to create from this instance template.
  - `virtualization_features` VirtualizationFeatures
    - `nested_virtualization` boolean — Whether nested virtualization is enabled, allowing a VM to run inside this VM.

## Other responses

- `400` — Error Bad Request
- `401` — Error Authentication Failed
- `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/revisions/a3fd2dedc72b/schema)
