Skip to main content

Create a Virtual Machine

Deploy a new VM instance with a single API call. This endpoint provisions compute, attaches a network, and sets up access credentials in one request.

Base URL: https://cloud.octosinfra.com/backend/api


Required information

Before creating a VM, you'll need these slugs from your account. Use the corresponding list endpoints to retrieve them:

ParameterDescriptionHow to find
cloud_providerCloud provider slugGET /cloud-providers
projectProject slugGET /projects
regionData center region slugGET /regions
templateOS template slugGET /templates
planCompute plan slugGET /plans

Create a VM

curl -X POST "https://cloud.octosinfra.com/backend/api/virtual-machines" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "my-web-server",
"hostname": "my-web-server",
"cloud_provider": "alto",
"server": "cloud-compute",
"project": "default-126",
"region": "frankfurt",
"billing_cycle": "hourly",
"template": "ubuntu-2204-1",
"template_type": "Operating System",
"plan": "dv-series-1-1",
"storage_category": "ssd-storage",
"boot_source": "image",
"is_public": true,
"username": "admin",
"password": "YourSecureP@ss123",
"authMethod": "password",
"os_family": "Linux",
"networks": [],
"security_groups": ["dsg-default-126-frankfurt"],
"additional_options": ["monitoring"],
"is_vnf": false,
"is_free_trial_plan": false,
"is_vm_password_required": true,
"is_vm_ssh_required": true
}'

Response:

{
"status": "Success",
"message": "Creating virtual machine",
"data": {
"name": "my-web-server",
"hostname": "my-web-server",
"username": "admin",
"state": "Starting",
"slug": "my-web-server",
"is_vnf": false
}
}

List all VMs

curl -X GET "https://cloud.octosinfra.com/backend/api/virtual-machines?include=cloud_provider,project,region,ipaddresses,virtual_machine_templates,offering" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"

Get VM details

curl -X GET "https://cloud.octosinfra.com/backend/api/virtual-machines/{VIRTUAL_MACHINE_SLUG}?include=cloud_provider,region,project,networks,parentable" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"

VM power actions

Control your VM's power state:

# Stop a VM
curl -X PUT "https://cloud.octosinfra.com/backend/api/virtual-machines/{VIRTUAL_MACHINE_SLUG}/stop" \
-H "Authorization: Bearer YOUR_API_TOKEN"

# Start a VM
curl -X PUT "https://cloud.octosinfra.com/backend/api/virtual-machines/{VIRTUAL_MACHINE_SLUG}/start" \
-H "Authorization: Bearer YOUR_API_TOKEN"

# Reset (reboot) a VM
curl -X PUT "https://cloud.octosinfra.com/backend/api/virtual-machines/{VIRTUAL_MACHINE_SLUG}/reset" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Endpoint reference

ActionMethodEndpoint
List VMsGET/virtual-machines
Create VMPOST/virtual-machines
Get VMGET/virtual-machines/{SLUG}
Stop VMPUT/virtual-machines/{SLUG}/stop
Start VMPUT/virtual-machines/{SLUG}/start
Reset VMPUT/virtual-machines/{SLUG}/reset
Change LabelPUT/virtual-machines/{SLUG}/change-label
Change PlanPOST/virtual-machines/{SLUG}/change-plan