Interactive Backup Integrations

This page describes the OpenNebula interactive backup workflow for backup integrations. It is intended for integration developers and for administrators following a specific integration guide, such as the OpenNebula-Veeam® Backup Integration.

The interactive backup datastore driver is a coordination driver. It is not a general-purpose backup backend where users store and manage backup payloads directly. For regular OpenNebula backup storage, use the Restic or Rsync backup datastore guides. For Veeam deployments, follow the Veeam guide, which explains the datastore attributes required by that integration.

Interactive backups use the OpenNebula Backup Exporter (OneBEX). OneBEX is started on demand on the hypervisor that is running the VM backup operation. OpenNebula prepares the disk export, OneBEX exposes the export through an HTTP API, and the external backup system reads the backup data from the hypervisor. The external backup product stores the backup payload in its own repository, while OpenNebula keeps the backup image metadata needed to track and restore the backup.

How It Works

From OpenNebula’s point of view, an interactive backup has three phases:

  1. Pre-backup (Transfer Manager / TM driver): The TM driver prepares the VM disks for export. Depending on the storage backend, it may create snapshots or temporary devices to provide a consistent source. It writes an interactive_exports.json file describing each prepared disk and starts OneBEX on the hypervisor. The export session is initialized through POST /export.
  2. Backup (Datastore / DS driver): After the external backup application has retrieved the disk data and completed the export session, the DS driver creates a backup image containing the metadata OpenNebula needs to identify and restore that backup. The actual disk data remains in the external application’s repository.
  3. Post-backup (TM driver): The TM driver removes the temporary snapshots, devices, and files created during pre-backup. These storage resources are distinct from any sockets, processes, or connections managed by a OneBEX exporter.

Between Step 1 and Step 2, OneBEX serves the prepared disks over HTTP. The external backup application checks the VM status, obtains each transfer’s disk information and block extents, and requests the byte ranges it needs. It then finalizes each disk transfer and finishes the VM export session. OneBEX releases exporter-owned resources and stops when there are no remaining transfers.

Export Description and Exporter Selection

During pre-backup, the TM driver writes <backup_dir>/interactive_exports.json. The file contains a JSON object indexed by VM disk ID. Each disk entry tells OneBEX which exporter can read the prepared source and provides the information needed by that exporter.

For example:

{
  "0": {
    "exporter": "nbd",
    "source": "/var/lib/one/datastores/100/123/disk.0",
    "format": "qcow2"
  },
  "1": {
    "exporter": "lvm",
    "source": "/dev/vg-one/lv-one-123-1",
    "format": "raw"
  }
}

The exporter selects one of the OneBEX available exporters, source identifies the prepared image or device, and format describes its disk format. The file can also include exporter-specific fields, for example snapshot identifiers or an incremental block map.

When OneBEX receives POST /export, it reads this file from the supplied BACKUP_DIR, selects the requested disks (or all disks when DISKS is omitted), and looks up the exporter name in its registry. OneBEX creates a separate transfer and exporter instance for each disk. The backup application then accesses those transfers through the HTTP API described below.

To add a new storage backend, the corresponding TM driver must prepare its disk source and describe it in this file. A custom OneBEX exporter then implements the storage-specific reads. See Developing OneBEX Exporters for the Ruby interface, example implementation, installation, and testing instructions.

Enabling Interactive Backups for a Transfer Driver

A Transfer Manager driver must explicitly advertise interactive backup support in its TM_MAD_CONF entry in /etc/one/oned.conf:

TM_MAD_CONF = [
    NAME                       = "my_storage",
    # Other TM driver attributes...
    INTERACTIVE_BACKUP         = "YES",
    INTERACTIVE_BACKUP_FORMATS = "raw,qcow2"
]

INTERACTIVE_BACKUP="YES" makes disks managed by this TM driver eligible for interactive backups. The optional INTERACTIVE_BACKUP_FORMATS value limits support to the listed disk image formats. Omit the attribute or leave it empty to allow every format supported by the driver and its exporter.

After changing oned.conf, restart OpenNebula:

systemctl restart opennebula

For the complete parameter reference, see the TM_MAD_CONF configuration.

Compatibility

The current interactive backup implementation supports the following configuration:

ComponentSupport
HypervisorKVM
VM disk storageFile-based qcow2 disks, disks on LVM datastores, and Ceph RBD disks
Backup typesFull and incremental
Incremental modeCBT only (INCREMENT_MODE="CBT")
VM stateRunning and powered off VMs
OneBEX exporterNBD, LVM, RBD

Network Requirements

The external backup system must be able to connect to OneBEX on every hypervisor that can run VMs backed up by the integration.

Make sure that:

  • The OneBEX listen address and port are reachable from the external backup system.
  • Firewalls allow the configured OneBEX port on the hypervisors.
  • OpenNebula remotes are synchronized after changing the OneBEX configuration.
  • The standard OpenNebula Front-end to Host connectivity is working.

Configuring OneBEX

OneBEX is configured from the OpenNebula remotes directory on the Front-end:

/var/lib/one/remotes/etc/onebex/onebex-server.conf

After changing this file, synchronize the remotes to the Hosts:

$ onehost sync -f

The configuration file defines the OneBEX listen address, logging settings, and Puma web server concurrency limits.

Server Configuration

ParameterDefault valueDescription
:host:0.0.0.0Address where OneBEX listens for HTTP requests. By default, it listens on all available interfaces.
:port:13014TCP port where OneBEX listens for HTTP requests.

Log Configuration

ParameterDefault valueDescription
:log: :level:2Log verbosity level. Supported values are 0 for ERROR, 1 for WARNING, 2 for INFO, and 3 for DEBUG.
:log: :system:fileLogging backend used by OneBEX. Supported values are file and syslog.

Puma Configuration

ParameterDefault valueDescription
:puma: :min_threads:1Minimum number of Puma threads used to handle concurrent OneBEX HTTP requests.
:puma: :max_threads:4Maximum number of Puma threads used to handle concurrent OneBEX HTTP requests.

These limits apply to HTTP requests, not to the number of VM sessions or exported disks.

Integration Datastore

An interactive backup integration needs a BACKUP_DS datastore using DS_MAD="interactive". This datastore records OpenNebula backup metadata and lets the integration identify which backups belong to it. The backup payload itself is stored by the external backup system.

Do not create this datastore as a standalone backup target. Create it only when required by an integration guide. Integrations can require additional marker attributes. For example, the Veeam integration requires VEEAM_DS="YES" so the oVirtAPI server can select the datastore used by Veeam.

The minimal datastore shape is:

NAME   = "Integration Backups"
TYPE   = "BACKUP_DS"

DS_MAD = "interactive"
TM_MAD = "-"

DATASTORE_CAPACITY_CHECK="NO"

The datastore must be added to every cluster that contains VMs managed by the integration.

$ onecluster adddatastore <cluster_name> <datastore_name>

Restoring Interactive Backups

During interactive restores, OpenNebula passes the Image Datastore downloader a OneBEX URL in the following form:

onebex://<IMAGE_DS_ID>:<PORT_ID>

IMAGE_DS_ID is the destination Image Datastore ID where the restored disk image will be created. PORT_ID is the restore transfer port allocated for the interactive restore session.

The writer accepts one frame per TCP connection. Each frame starts with a one-byte type:

TypeNamePayload
0x00DATAThree unsigned 64-bit big-endian integers containing the start byte, payload size, and total image size, followed by the image data.
0x01FINISHNo payload. Stops the writer and lets OpenNebula finalize the restore transfer.

After sending all the image data, the integration must open one final connection to the restore transfer port and send the FINISH frame. The integration must also send this frame when a restore is cancelled or fails. Do not send more data after the FINISH frame.

If a restore fails, the restored Image remains in LOCKED state and should be removed manually:

OneBEX API Reference

The OneBEX API is consumed by backup integrations. The current API is:

API Endpoints

EndpointMethodPurposeHTTP Status Code
/GETReturns basic server information and the available API routes.200
/statusGETReturns the current export status for a VM. Requires VM_ID.200, 400
/exportersGETLists the exporter backends available in OneBEX.200
/exportPOSTStarts one or more disk exports for a VM. Requires VM_ID, DS_ID, and BACKUP_DIR. DISKS is optional.200, 400, 404, 409, 500, 503
/transfers/:TRANSFER_ID/infoGETReturns size and format information for a transfer.200, 404, 500
/images/:TRANSFER_IDOPTIONSReturns supported image transfer features and concurrency limits.200
/images/:TRANSFER_ID/extentsGETReturns block extent information for a transfer.200, 404, 500
/images/:TRANSFER_IDGETReads a byte range from a transfer. Requires an HTTP Range header.206, 400, 404, 416, 500
/images/:TRANSFER_IDPUTImage write operation. Currently not implemented.501
/images/:TRANSFER_IDPATCHAccepts a flush operation when the request body uses op=flush.200, 400, 404
/transfer/:TRANSFER_ID/finalizePOSTFinalizes a transfer and releases its exporter resources.200, 400, 404
/vms/:VM_ID/cancelPOSTCancels VM export preparation and active transfers, waiting for cleanup.200, 400, 500
/vms/:VM_ID/finishPOSTPublishes the VM result after preparation and all transfer cleanup have completed.200, 409, 500

HTTP Status Codes

CodeDescription
200 OKRequest completed. Check SUCCESS in lifecycle responses for the backup result.
206 Partial ContentRequested byte range returned successfully.
400 Bad RequestInvalid request, missing parameters, malformed JSON, invalid range format, or unsupported operation.
404 Not FoundTransfer, disk, export metadata, or endpoint not found.
409 ConflictAn export already exists or was cancelled/failed in the current process, or a VM cannot finish while preparation or transfer cleanup is pending.
416 Range Not SatisfiableRequired byte range is missing or invalid.
500 Internal Server ErrorUnexpected server-side error, invalid export metadata, or exporter/backend failure.
501 Not ImplementedOperation exists but is not implemented.
503 Service UnavailableOneBEX is stopping because the export was not admitted.

Responses

GET /

200 OK

{
  "NAME": "OpenNebula OneBEX Server",
  "VERSION": "0.1",
  "ROUTES": {
    "STATUS": "GET /status",
    "EXPORTERS": "GET /exporters",
    "EXPORT": "POST /export",
    "EXPORT_FINISH": "POST /vms/:VM_ID/finish",
    "EXPORT_CANCEL": "POST /vms/:VM_ID/cancel",
    "TRANSFER_INFO": "GET /transfers/:TRANSFER_ID/info",
    "IMAGE_OPTIONS": "OPTIONS /images/:TRANSFER_ID",
    "IMAGE_EXTENTS": "GET /images/:TRANSFER_ID/extents",
    "IMAGE_READ": "GET /images/:TRANSFER_ID",
    "IMAGE_WRITE": "PUT /images/:TRANSFER_ID",
    "IMAGE_FLUSH": "PATCH /images/:TRANSFER_ID",
    "IMAGE_FINALIZE": "POST /transfer/:TRANSFER_ID/finalize"
  }
}

GET /status

200 OK

{
  "VM_ID": 123,
  "STATUS": "executing",
  "SUCCESS": true,
  "TRANSFERS": [
    {
      "TRANSFER_ID": "one-123-0-ab12cd34",
      "DISK_ID": 0,
      "EXPORTER": "nbd",
      "STATUS": "ready",
      "RC": true
    }
  ]
}

400 Bad Request

{
  "error": "Missing VM_ID"
}

GET /exporters

200 OK

{
  "EXPORTERS": [
    "nbd",
    "lvm",
    "rbd"
  ]
}

POST /export

Request:

{
  "VM_ID": 123,
  "DS_ID": 100,
  "BACKUP_DIR": "/var/lib/one/datastores/100/123/backup",
  "DISKS": [
    0
  ]
}

BACKUP_DIR is the VM backup directory that contains interactive_exports.json. When DISKS is omitted, OneBEX starts exports for all disks listed in interactive_exports.json.

200 OK

{
  "VM_ID": 123,
  "DS_ID": 100,
  "TRANSFERS": [
    {
      "TRANSFER_ID": "one-123-0-ab12cd34",
      "DISK_ID": 0,
      "EXPORTER": "nbd",
      "STATUS": "ready",
      "RC": true
    }
  ]
}

400 Bad Request

{
  "error": "Missing VM_ID, DS_ID or BACKUP_DIR"
}

or:

{
  "error": "Unsupported exporter: <exporter>"
}

404 Not Found

{
  "error": "Disk 0 not found"
}

or:

{
  "error": "Export file not found: <path>"
}

409 Conflict

A second export cannot replace a VM’s active or preparing export:

{
  "error": "VM 123 already has an export"
}

If the VM was cancelled, or its previous export failed in the current process:

{
  "error": "Backup cancelled"
}

503 Service Unavailable

{
  "error": "OneBEX is stopping"
}

No export was admitted for this response. TM waits up to 60 seconds for the server to stop and retries once, starting a new server if necessary.

500 Internal Server Error

Invalid export metadata or an unexpected preparation/exporter error returns its error message:

{
  "error": "<error message>"
}

GET /transfers/:TRANSFER_ID/info

200 OK

Example for an NBD transfer:

{
  "TRANSFER_ID": "one-123-0-ab12cd34",
  "SIZE": 10240,
  "FORMAT": "qcow2"
}

SIZE is returned in MiB.

404 Not Found

{
  "error": "Transfer not found"
}

OPTIONS /images/:TRANSFER_ID

200 OK

{
  "features": [
    "checksum",
    "extents",
    "flush",
    "zero"
  ],
  "max_readers": 1,
  "max_writers": 1
}

GET /images/:TRANSFER_ID/extents

200 OK

Returns block extent information as JSON. For example:

[
  {
    "start": 0,
    "length": 1048576,
    "dirty": true,
    "zero": false,
    "hole": false
  }
]

404 Not Found

{
  "error": "Transfer not found"
}

GET /images/:TRANSFER_ID

Requires a range in the following format:

Range: bytes=start-end

206 Partial Content

Returns the requested byte range as binary application/octet-stream data.

400 Bad Request

{
  "error": "Invalid Range format. Expected: bytes=start-end"
}

404 Not Found

{
  "error": "Transfer not found"
}

416 Range Not Satisfiable

When the Range header is missing:

{
  "error": "Missing Range header"
}

When the end byte is lower than the start byte:

{
  "error": "Invalid Range header"
}

PUT /images/:TRANSFER_ID

501 Not Implemented

{
  "error": "Write operation not implemented"
}

PATCH /images/:TRANSFER_ID

Request:

{
  "op": "flush"
}

200 OK

The flush request is accepted. The response has no JSON body.

400 Bad Request

{
  "error": "Unsupported operation"
}

404 Not Found

{
  "error": "Transfer not found"
}

POST /transfer/:TRANSFER_ID/finalize

Optional request body:

{
  "SUCCESS": true,
  "MESSAGE": "Transfer completed"
}

SUCCESS defaults to true.

200 OK

{
  "VM_ID": 123,
  "TRANSFER_ID": "one-123-0-ab12cd34",
  "STATUS": "finished",
  "SUCCESS": true,
  "PENDING_TRANSFERS": []
}

400 Bad Request

Returned when the request body contains invalid JSON.

404 Not Found

{
  "error": "Transfer not found"
}

POST /vms/:VM_ID/cancel

Optional request body:

{
  "MESSAGE": "Backup cancelled by an Administrator",
  "FORCE": true
}

MESSAGE defaults to Backup cancelled.

FORCE defaults to true. When true, OneBEX cancels immediately, without waiting for export preparation, active read operations, or another finalizer. Set it to false to wait for in-progress operations and stop exporter processes gracefully.

200 OK

{
  "VM_ID": 123,
  "STATUS": "cancelled",
  "SUCCESS": false,
  "PENDING_TRANSFERS": []
}

400 Bad Request

Returned when the request body contains invalid JSON.

POST /vms/:VM_ID/finish

200 OK

{
  "VM_ID": 123,
  "STATUS": "finished",
  "SUCCESS": true,
  "PENDING_TRANSFERS": []
}

If export preparation or transfer cleanup is still pending:

409 Conflict

{
  "VM_ID": 123,
  "STATUS": "executing",
  "SUCCESS": true,
  "PENDING_TRANSFERS": [
    "one-123-0-ab12cd34"
  ]
}

Common Error Responses

Malformed JSON request bodies return 400 Bad Request:

{
  "error": "Invalid JSON body: <error>"
}

When a transfer does not exist or is no longer available, endpoints that look up an existing transfer return 404 Not Found:

{
  "error": "Transfer not found"
}

Unsupported endpoints return 404 Not Found:

{
  "error": "Unsupported endpoint"
}

Unexpected server errors and exporter/backend failures return 500 Internal Server Error:

{
  "error": "<error message>"
}

Exporters

OneBEX selects a storage-specific exporter for each prepared disk, as described in Export Description and Exporter Selection. The built-in implementations are listed below.

To implement and register another storage backend, see Developing OneBEX Exporters.

ExporterVM disk storageTransportDescription
nbdFile-based qcow2 disksNetwork Block DeviceExposes the backup disk through NBD. OneBEX starts a read-only qemu-nbd process and serves the disk export through a Unix socket.
lvmDisks on LVM datastoresDirect block-device readsExposes the prepared LVM block device directly. Full backups return the full device extent. Incremental backups use thin_delta to return changed extents from LVM thin metadata.
rbdCeph RBD disksDirect RBD readsExposes the prepared Ceph RBD snapshot directly. Full backups return the full image extent, while incremental backups return the changed extents between RBD snapshots.

Example: Backing Up and Restoring a VM with OneBEX

This example shows how an external backup application can retrieve full or incremental backups of VM 132 and restore a disk to an OpenNebula Image. Replace the example IDs, hostnames, and ports with those in your environment. OneBEX runs on the hypervisor at http://host:13014. The restore writer runs on the Front-end.

Retrieving a Backup (Full or Incremental)

For additional configuration details, see the OpenNebula VM Backup Operations guide.

  1. Configure the VM backup. Set BACKUP_CONFIG in the VM Template, or update an existing VM with onevm updateconf 132.

    For a full backup:

    BACKUP_CONFIG = [
        INTERACTIVE = "YES",
        MODE        = "FULL",
        DISK_IDS    = "0"
    ]
    

    For incremental backups (CBT):

    BACKUP_CONFIG = [
        INTERACTIVE    = "YES",
        MODE           = "INCREMENT",
        INCREMENT_MODE = "CBT",
        DISK_IDS       = "0"
    ]
    

    DISK_IDS is optional: omit it to back up all eligible disks, or provide a comma-separated list such as "0,2". Select disks here, not through POST /export. The first backup of an incremental chain is a full base backup. Later backups contain changes only since the latest successful backup/increment in that chain. You cannot choose an older increment as the source for the next incremental backup. Changing the selected disk set resets the chain and requires a new full base. Interactive incrementals support CBT, not SNAPSHOT.

  2. Use an interactive Backup Datastore. The target Backup Datastore must have TYPE="BACKUP_DS" and DS_MAD="interactive" and be available to the VM’s cluster. It stores backup metadata; the external backup application stores the disk data. See Integration Datastore.

  3. Start a VM backup through the integration’s OpenNebula API workflow. An equivalent CLI example is:

    onevm backup --schedule now -d 100 132
    

    The Transfer Manager (TM) prepares the disks and calls POST /export automatically. The external backup application must not call /export again.

  4. Discover the ready transfer on the hypervisor:

    curl -sS 'http://host:13014/status?VM_ID=132' | jq
    
    {
      "VM_ID": 132,
      "STATUS": "executing",
      "SUCCESS": true,
      "TRANSFERS": [
        {
          "TRANSFER_ID": "one-132-0-0bbaeb42",
          "DISK_ID": 0,
          "EXPORTER": "nbd",
          "STATUS": "ready",
          "RC": true
        }
      ]
    }
    

    Each disk has its own TRANSFER_ID, and each backup run generates new transfer IDs.

  5. Retrieve disk information and extents. Once the transfer is ready, retrieve the disk size, format, and extent map:

    curl -sS 'http://host:13014/transfers/one-132-0-0bbaeb42/info' | jq
    curl -sS 'http://host:13014/images/one-132-0-0bbaeb42/extents' | jq
    

    The info endpoint returns the virtual disk size in MiB and its format. For example, a 7 GiB disk returns:

    {
      "TRANSFER_ID": "one-132-0-0bbaeb42",
      "SIZE": 7168,
      "FORMAT": "qcow2"
    }
    

    The extents endpoint returns the disk regions to process. Its response depends on the backup type:

    • Full backup: The extent map describes the disk regions required for a complete backup. For example, a single extent covering the entire 7 GiB disk:

      [
        {
          "start": 0,
          "length": 7516192768,
          "dirty": true,
          "zero": false,
          "hole": false
        }
      ]
      

      In this example, the complete disk must be read, starting at byte 0 for a total of 7516192768 bytes. Depending on the storage backend, the extent map may contain multiple regions, including zeroed or unallocated areas.

    • Incremental backup: The extent map identifies only the disk regions changed since the previous backup in the incremental chain. For example:

      [
        {
          "start": 1048576,
          "length": 2097152,
          "dirty": true,
          "zero": false,
          "hole": false
        }
      ]
      

      In this example, only 2 MiB of the 7 GiB disk has changed, starting at offset 1 MiB. The backup solution only needs to retrieve the changed data rather than reading the entire disk.

    All offsets and lengths are expressed in bytes. The dirty, zero, and hole flags indicate whether a region has changed, contains zeroes, or is unallocated, respectively.

  6. Read the required extents with GET /images/:TRANSFER_ID and an inclusive Range header. For the incremental extent above:

    curl -sS --fail \
      -H 'Range: bytes=1048576-3145727' \
      'http://host:13014/images/one-132-0-0bbaeb42' \
      --output changed-blocks.bin
    

    The response is 206 Partial Content with raw virtual-disk bytes. Repeat for all required extents, splitting large ranges into manageable requests. Save each extent at its original disk offset, preserving zero/hole information. A full backup needs the entire required extent map; an incremental backup needs the changed extents and a reference to its preceding backup. Keep the complete chain in the external repository for restores.

  7. Finalize each disk transfer. After storing all required data for a disk, notify OneBEX that the transfer completed successfully:

    curl -sS -X POST 'http://host:13014/transfer/one-132-0-0bbaeb42/finalize' \
      -H 'Content-Type: application/json' \
      -d '{"SUCCESS":true}' | jq
    

    Every disk transfer must be finalized individually. Repeat this request for each TRANSFER_ID returned by GET /status.

    If a disk backup fails, finalize its transfer with SUCCESS=false:

    curl -sS -X POST 'http://host:13014/transfer/one-132-0-0bbaeb42/finalize' \
      -H 'Content-Type: application/json' \
      -d '{"SUCCESS":false,"MESSAGE":"Failed to store disk data"}' | jq
    

    If one disk fails, the remaining transfers must still be finalized. Do not report success until the external backup application has safely stored all required data.

  8. Finish the VM backup. Once all disk transfers have been finalized, notify OneBEX that the VM backup session is complete:

    curl -sS -X POST 'http://host:13014/vms/132/finish' | jq
    

    If all transfers succeeded, the response is:

    {
      "VM_ID": 132,
      "STATUS": "finished",
      "SUCCESS": true,
      "PENDING_TRANSFERS": []
    }
    

    If any transfer failed, the VM backup result reflects that failure. If transfers are still pending, the endpoint returns 409 Conflict with STATUS="executing" instead of completing the session.

    Cancellation: Alternatively, to cancel the entire VM backup and clean up its transfers, use:

    curl -sS -X POST 'http://host:13014/vms/132/cancel' \
      -H 'Content-Type: application/json' \
      -d '{"FORCE":true}' | jq
    

    Cancellation handles the transfer cleanup and completes the cancelled VM session. There is no need to call the VM finish endpoint afterwards.

Restoring a Disk with OneBEX

  1. Create an Image in the destination Image Datastore using the OneBEX restore URL as its PATH:

    onebex://<IMAGE_DS_ID>:<PORT_ID>
    

    For example, using an available restore port 4007 and Image Datastore 1, create an Image template named restored_image.tmpl:

    NAME="restored_image"
    PATH="onebex://1:4007"
    TYPE="OS"
    SIZE="4096"
    FROM_BACKUP_DS="100"
    

    SIZE specifies the expected restored virtual size in MiB: 4096 MiB (4 GiB) in this example. FROM_BACKUP_DS identifies the interactive Backup Datastore, here 100. Backup Datastore 100 does not store the restored disk: disk data arrives over TCP and is stored in the destination Image Datastore.

    Create the Image using this template:

    oneimage create restored_image.tmpl --datastore 1
    

    The port must be available and assigned to this restore session. Inspect the newly created Image with oneimage show <IMAGE_ID> to confirm its PATH and restore port. OpenNebula starts a TCP restore writer on the Front-end; the Image remains LOCKED while data is being received.

  2. Send the restored virtual-disk contents to <FRONTEND_ADDRESS>:<PORT_ID>. The external application reconstructs the requested restore point from its full/incremental chain, then sends the disk data as DATA frames, one TCP connection per frame:

    FieldSizeValue
    Frame type1 byte0x00 (DATA)
    Start offset8 bytesUnsigned 64-bit, big-endian
    Payload length8 bytesUnsigned 64-bit, big-endian
    Total disk size8 bytesUnsigned 64-bit, big-endian
    DataPayload lengthRaw virtual-disk bytes

    Send each block at its correct offset. This is a TCP protocol, not a OneBEX HTTP endpoint.

  3. Finish the restore. After all data has been sent, open one final TCP connection to the same Front-end port and send the single byte 0x01 (FINISH), with no payload. The writer stops and OpenNebula can finalize the Image. Send FINISH even if the restore is cancelled or fails, to release the writer. Do not send data after it. If the restore fails and the Image remains LOCKED, clean up the incomplete Image as described in Restoring Interactive Backups.