Server Actions

Create Image from a Server

Creates an Image (snapshot) from a Server by copying the contents of its disks. This creates a snapshot of the current state of the disk and copies it into an Image. If the Server is currently running you must make sure that its disk content is consistent. Otherwise, the created Image may not be readable.

To make sure disk content is consistent, we recommend to shut down the Server prior to creating an Image.

You can either create a backup Image that is bound to the Server and therefore will be deleted when the Server is deleted, or you can create a snapshot Image which is completely independent of the Server it was created from and will survive Server deletion. Backup Images are only available when the backup option is enabled for the Server. Snapshot Images are billed on a per GB basis.

post/servers/{id}/actions/create_image

Request

  • Base URL: https://api.hetzner.cloud/v1
  • URL: https://api.hetzner.cloud/v1/servers/{id}/actions/create_image
  • Auth: HTTP bearer

Path parameters

idinteger required

ID of the Server.

Example:42

ID of the Server.

Request body

descriptionstring

Description of the Image, will be auto-generated if not set.

type'snapshot' | 'backup'

Type of Image to create.

labelsobject

User-defined labels (key/value pairs) for the Resource. For more information, see "Labels".

Example request

{
  "description": "my image",
  "type": "snapshot",
  "labels": {
    "environment": "prod",
    "example.com/my": "label",
    "just-a-key": ""
  }
}

Response

Request succeeded.

Example response

{
  "image": {
    "id": 42,
    "type": "snapshot",
    "status": "available",
    "name": "ubuntu-24.04",
    "description": "Ubuntu 24.04 Standard 64 bit",
    "image_size": 2.3,
    "disk_size": 10,
    "created": "2016-01-30T23:55:00Z",
    "created_from": {
      "id": 1,
      "name": "Server"
    },
    "os_flavor": "ubuntu",
    "os_version": "24.04",
    "deprecated": "2018-02-28T00:00:00Z",
    "deprecation": {
      "unavailable_after": "2023-09-01T00:00:00Z",
      "announced": "2023-06-01T00:00:00Z"
    },
    "labels": {
      "environment": "prod",
      "example.com/my": "label",
      "just-a-key": ""
    },
    "architecture": "x86"
  },
  "action": {
    "id": 42,
    "command": "start_resource",
    "started": "2016-01-30T23:55:00Z",
    "finished": "2016-01-30T23:55:00Z",
    "progress": 100,
    "resources": [
      {
        "id": 42,
        "type": "server"
      }
    ],
    "error": {
      "code": "action_failed",
      "message": "Action failed"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.