---
title: "Create a new VM"
method: POST
path: "/project/{project_id}/location/{location}/vm/{vm_reference}"
tags: ["Virtual Machine"]
---

# Create a new VM

`POST /project/{project_id}/location/{location}/vm/{vm_reference}`

## Request body

- object
  - `boot_image` string — Boot image of the VM
  - `init_script` string — VM init script
  - `enable_ip4` boolean — Enable IPv4
  - `private_subnet_id` string — ID of the private subnet
  - `public_key` string, required — Public SSH key for the VM, or name of registered SSH public key
  - `size` string — Size of the VM
  - `storage_size` integer — Requested storage size in GiB
  - `gpu` string — Requested GPU count and type, in the form of "count:type"
  - `unix_user` string — Unix user of the VM

## Response `200`

A VM

- object
  - `boot_image` string, required — Boot image of the VM
  - `id` string, required — ID of the VM
  - `ip4` string, ipv4, nullable, required — IPv4 address
  - `ip4_enabled` boolean, required — Whether IPv4 is enabled
  - `ip6` string, ipv6, nullable, required — IPv6 address
  - `location` string, required — Location of the VM
  - `name` string, required — Name of the VM
  - `size` string, required — Size of the underlying VM
  - `state` string, required — State of the VM
  - `storage_size_gib` integer, required — Storage size in GiB
  - `unix_user` string, required — Unix user of the VM
  - `firewalls` Firewall[], required — List of firewalls
    - `description` string, required — Description of the firewall
    - `firewall_rules` FirewallRule[], required — List of firewall rules
      - `cidr` string, required — CIDR of the firewall rule
      - `id` string, required — ID of the firewall rule
      - `port_range` string, required — Port range of the firewall rule
      - `protocol` 'tcp' | 'udp', required — Protocol of the firewall rule (tcp or udp)
      - `description` string, required — Description of the firewall rule
    - `id` string, required — ID of the firewall
    - `location` string, required — Location of the firewall
    - `name` string, required — Name of the firewall
  - `private_ipv4` string, ipv4, required — Private IPv4 address
  - `private_ipv6` string, ipv6, required — Private IPv6 address
  - `subnet` string, required — Subnet of the VM
  - `gpu` string — GPU configuration

## Other responses

- `default` — An error response

## Changes

- **2026-06-04** `162c73892508` — 1 info
  - added the required property `allOf[#/components/schemas/Vm]/boot_image` to the response with the `200` status
- **2026-05-21** `65eaca27bbb7` — 1 info
  - added the required property `allOf[subschema #2]/firewalls/items/firewall_rules/items/protocol` to the response with the `200` status
- **2025-10-27** `dec15dec4776` — 1 info
  - added the new optional request property `init_script`
- **2025-10-25** `d81708f425bb` — 1 info
  - added the required property `allOf[subschema #2]/firewalls/items/firewall_rules/items/description` to the response with the `200` status

[Change history](https://skmtc.dev/ubicloud/apis/clover-api/changes/project/:project_id/location/:location/vm/:vm_reference/post.md)

---

[API](https://skmtc.dev/ubicloud/apis/clover-api.md) · [All operations](https://skmtc.dev/ubicloud/apis/clover-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ubicloud/clover-api/revisions/ae229e5ccaee/schema)
