v1

latestSwagger 2.02026-08-04232286653.5 KB
VMs

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

post/projects/{project_id}/compute/vms/instances

Path parameters

project_idstring required

Request body

commitment_periodinteger

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_imagestring

ID of a custom image to use for the new VM. Either image or custom_image should be supplied, not both.

imagestring

Name of the OS image to use for the new VM. Either image or custom_image should be supplied, not both.

install_crusoe_watch_agentboolean nullable

Whether to install the Crusoe Watch Agent on the VM. Defaults to true.

locationstring required

Location to create the VM in.

maintenance_policystring

Host maintenance policy to apply to the new VM: manual, stop-vm, or unspecified.

namestring required

Name for the new VM.

nvlink_domain_idstring

ID of the NVLink domain to create the VM in.

shutdown_scriptstring

Script to run when the VM shuts down.

ssh_public_keystring required

SSH public key to grant access to the new VM.

startup_scriptstring

Script to run when the VM starts.

typestring required

Product name of the VM type to create.

Example request

{
  "disks": [
    {
      "attachment_type": "data",
      "disk_id": "09ae8411-0fbb-411c-898c-2b8f19622ae1",
      "mode": "read-write"
    }
  ],
  "image": "ubuntu:20.04",
  "location": "us-northcentral1-a",
  "maintenance_policy": "manual,stop-vm,unspecified",
  "name": "my-first-vm",
  "network_interfaces": [
    {
      "id": "ca39e669-47ee-456b-968d-303234fbf99f",
      "interface_type": "ethernet",
      "ips": [
        {
          "private_ipv4": {
            "address": "10.1.2.3"
          },
          "public_ipv4": {
            "address": "121.0.0.0",
            "id": "1ce839b7-3fab-46f9-8e54-7a6bb4ac1ffc",
            "type": "dynamic"
          }
        }
      ],
      "mac_address": "00:00:5e:00:53:af",
      "name": "network-interface-1",
      "network": "1ce839b7-3fab-46f9-8e54-7a6bb4ac1ffc",
      "subnet": "1ce839b7-3fab-46f9-8e54-7a6bb4ac1ffc"
    }
  ],
  "reservation_specification": {
    "id": "804bf3a2-81f2-4d78-9a9e-dc6a55ed33d8",
    "selection_strategy": "lowest_cost"
  },
  "shutdown_script": "#!/bin/bash\\necho 'goodbye'",
  "ssh_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCspdG97nTS/h4PEPq2QD2RYVK1jxFXLFZuSDMI8Rtxpucl6LDZLOghEYoj13lxKQnGtcsM3Iu68lh+4YgZe7CbI6cc/TxPbeAX2HJTqDh0J7+GAlLBHK9tsepC0QlhIDiazJptOPDZ3cesCBXdxSnzEbhDaqgYOfl393cp1fCeOKRIDWEP3H9CM25dCbWF66sTDziLsojJ9dMnxhgKm9/JkZc5gYncLT/2Ey+VWfV9Fs65mGUrBbQOn3c8S/nEk6WRcYn4PFOnIp0Mz+Chb50iCJrW677pllLnkTGSU+4c0H9J5z4HDG0I+91RoiQ0QsayFTYO1JtSn+THLuq98V+D",
  "startup_script": "#!/bin/bash\\necho 'hello'",
  "type": "a100.2x",
  "virtualization_features": {
    "nested_virtualization": true
  }
}

Response

Example response

{
  "operation": {
    "completed_at": "2021-12-03T19:59:34Z",
    "metadata": "{}",
    "operation_id": "F6EF489C-086E-458D-B812-7962964A28C9",
    "result": "{}",
    "started_at": "2021-12-03T19:58:34Z",
    "state": "IN_PROGRESS"
  }
}