Skip to main content
POST
/
project
/
{project_id}
/
location
/
{location}
/
machine-image
/
{machine_image_reference}
/
version
/
{version}
Create a new version of a machine image from a stopped VM
curl --request POST \
  --url https://api.ubicloud.com/project/{project_id}/location/{location}/machine-image/{machine_image_reference}/version/{version} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "vm": "<string>",
  "destroy_source": true
}
'
{
  "id": "mvn30gjk1d1e2jj34v9x0dq4rp",
  "version": "v1.0",
  "state": "creating",
  "created_at": "2023-11-07T05:31:56Z",
  "actual_size_mib": 123,
  "archive_size_mib": 123
}

Documentation Index

Fetch the complete documentation index at: https://ubicloud.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

project_id
string
required

ID of the project

Pattern: ^pj[0-9a-hj-km-np-tv-z]{24}$
Example:

"pjkkmx0f2vke4h36nk9cm8v8q0"

location
string
required

The Ubicloud location/region

Example:

"eu-central-h1"

machine_image_reference
string
required

Machine Image ID or name Resource ID or name

Pattern: ^[a-z0-9](?:[a-z0-9\-]{0,61}[a-z0-9])?$
version
string
required

Version label of the machine image

Pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$

Body

application/json
vm
string
required

UBID of the source VM

destroy_source
boolean

Destroy the source VM after capture

Response

A machine image version

id
string
required

ID of the machine image version

Example:

"mvn30gjk1d1e2jj34v9x0dq4rp"

version
string
required

Version label

Example:

"v1.0"

state
enum<string> | null
required

Lifecycle state, or null if no metal record exists

Available options:
creating,
ready,
destroying
created_at
string<date-time>
required

Creation timestamp

actual_size_mib
integer | null

Actual size of the image in MiB

archive_size_mib
integer | null

Size of the archived image in MiB