Skip to main content
POST
/
project
/
{project_id}
/
location
/
{location}
/
vm
/
{vm_reference}
Create a new VM in a specific location of a project
curl --request POST \
  --url https://api.ubicloud.com/project/{project_id}/location/{location}/vm/{vm_reference} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "boot_image": "<string>",
  "init_script": "<string>",
  "enable_ip4": true,
  "private_subnet_id": "<string>",
  "public_key": "<string>",
  "size": "<string>",
  "storage_size": 123,
  "gpu": "<string>",
  "unix_user": "<string>"
}'
{
  "id": "vmhfy8gff8c67hasb0eez2k1pd",
  "ip4": "127.0.0.1",
  "ip4_enabled": true,
  "ip6": "2606:4700:3108::ac42:2835",
  "location": "eu-central-h1",
  "name": "my-vm-name",
  "size": "<string>",
  "state": "<string>",
  "storage_size_gib": 123,
  "unix_user": "<string>",
  "firewalls": [
    {
      "description": "<string>",
      "firewall_rules": [
        {
          "cidr": "<string>",
          "id": "fraz0q3vbrpa7pkg7zbmah9csn",
          "port_range": "<string>",
          "description": "<string>"
        }
      ],
      "id": "fwfg7td83em22qfw9pq5xyfqb7",
      "location": "<string>",
      "name": "<string>"
    }
  ],
  "private_ipv4": "127.0.0.1",
  "private_ipv6": "2606:4700:3108::ac42:2835",
  "subnet": "<string>",
  "gpu": "<string>"
}

Authorizations

Authorization
string
header
required

Path Parameters

project_id
string
required
Example:
location
string
required
Example:
vm_reference
string
required

Body

application/json
public_key
string
required
boot_image
string
init_script
string
enable_ip4
boolean
private_subnet_id
string
size
string
storage_size
integer
gpu
string
unix_user
string

Response

id
string
required
Example:
ip4
string<ipv4> | null
required
ip4_enabled
boolean
required
ip6
string<ipv6> | null
required
location
string
required
Example:
name
string
required
Example:
size
string
required
state
string
required
storage_size_gib
integer
required
unix_user
string
required
firewalls
object[]
required
private_ipv4
string<ipv4>
required
private_ipv6
string<ipv6>
required
subnet
string
required
gpu
string