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:
- 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.jsonfile describing each prepared disk and starts OneBEX on the hypervisor. The export session is initialized throughPOST /export. - 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.
- 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:
| Component | Support |
|---|---|
| Hypervisor | KVM |
| VM disk storage | File-based qcow2 disks, disks on LVM datastores, and Ceph RBD disks |
| Backup types | Full and incremental |
| Incremental mode | CBT only (INCREMENT_MODE="CBT") |
| VM state | Running and powered off VMs |
| OneBEX exporter | NBD, LVM, RBD |
SNAPSHOT increment mode. OpenNebula rejects this combination when the backup configuration is updated.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.
OneBEX uses unauthenticated HTTP by default and transfers VM disk data during backups. Unencrypted traffic can be intercepted, and reachable endpoints can be queried during active exports.
Enable TLS using the integration’s supported proxy or equivalent on each hypervisor; OneBEX does not terminate TLS. For an example with Veeam, see Configuring SSL in the Hosts.
Restrict access to OneBEX and proxy ports to the Front-end and required backup components on every eligible hypervisor. If TLS terminates at a local proxy, keep its HTTP connection to OneBEX local to the host.
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
/var/log/one/onebex.log.The configuration file defines the OneBEX listen address, logging settings, and Puma web server concurrency limits.
Server Configuration
| Parameter | Default value | Description |
|---|---|---|
:host: | 0.0.0.0 | Address where OneBEX listens for HTTP requests. By default, it listens on all available interfaces. |
:port: | 13014 | TCP port where OneBEX listens for HTTP requests. |
Log Configuration
| Parameter | Default value | Description |
|---|---|---|
:log: :level: | 2 | Log verbosity level. Supported values are 0 for ERROR, 1 for WARNING, 2 for INFO, and 3 for DEBUG. |
:log: :system: | file | Logging backend used by OneBEX. Supported values are file and syslog. |
Puma Configuration
| Parameter | Default value | Description |
|---|---|---|
:puma: :min_threads: | 1 | Minimum number of Puma threads used to handle concurrent OneBEX HTTP requests. |
:puma: :max_threads: | 4 | Maximum 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.
0.0.0.0). Set the ONE_BEX_WRITER_ADDR environment variable in the Front-end to constrain it to listen on a specific address. Since the writer accepts raw image data without authentication or encryption, restrict the restore transfer ports at the firewall to the integration components that send restore data.The writer accepts one frame per TCP connection. Each frame starts with a one-byte type:
| Type | Name | Payload |
|---|---|---|
0x00 | DATA | Three unsigned 64-bit big-endian integers containing the start byte, payload size, and total image size, followed by the image data. |
0x01 | FINISH | No 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:
Get the restore transfer port from the Image PATH attribute and send the FINISH frame to the writer. This stops the writer gracefully and allows OpenNebula to complete the transfer cleanup. Use a Front-end address that is reachable from the system where you run the command. If you run it directly on the Front-end, you can use 127.0.0.1. The restore transfer port must be allowed by any intervening firewall:
python3 -c 'import socket, sys; s = socket.create_connection((sys.argv[1], int(sys.argv[2]))); s.sendall(b"\x01"); s.close()' <FRONTEND_ADDRESS> <PORT_ID>
After the writer finishes, delete the incomplete Image:
oneimage delete <IMAGE_ID>
OneBEX API Reference
The OneBEX API is consumed by backup integrations. The current API is:
API Endpoints
| Endpoint | Method | Purpose | HTTP Status Code |
|---|---|---|---|
/ | GET | Returns basic server information and the available API routes. | 200 |
/status | GET | Returns the current export status for a VM. Requires VM_ID. | 200, 400 |
/exporters | GET | Lists the exporter backends available in OneBEX. | 200 |
/export | POST | Starts 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/info | GET | Returns size and format information for a transfer. | 200, 404, 500 |
/images/:TRANSFER_ID | OPTIONS | Returns supported image transfer features and concurrency limits. | 200 |
/images/:TRANSFER_ID/extents | GET | Returns block extent information for a transfer. | 200, 404, 500 |
/images/:TRANSFER_ID | GET | Reads a byte range from a transfer. Requires an HTTP Range header. | 206, 400, 404, 416, 500 |
/images/:TRANSFER_ID | PUT | Image write operation. Currently not implemented. | 501 |
/images/:TRANSFER_ID | PATCH | Accepts a flush operation when the request body uses op=flush. | 200, 400, 404 |
/transfer/:TRANSFER_ID/finalize | POST | Finalizes a transfer and releases its exporter resources. | 200, 400, 404 |
/vms/:VM_ID/cancel | POST | Cancels VM export preparation and active transfers, waiting for cleanup. | 200, 400, 500 |
/vms/:VM_ID/finish | POST | Publishes the VM result after preparation and all transfer cleanup have completed. | 200, 409, 500 |
HTTP Status Codes
| Code | Description |
|---|---|
200 OK | Request completed. Check SUCCESS in lifecycle responses for the backup result. |
206 Partial Content | Requested byte range returned successfully. |
400 Bad Request | Invalid request, missing parameters, malformed JSON, invalid range format, or unsupported operation. |
404 Not Found | Transfer, disk, export metadata, or endpoint not found. |
409 Conflict | An 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 Satisfiable | Required byte range is missing or invalid. |
500 Internal Server Error | Unexpected server-side error, invalid export metadata, or exporter/backend failure. |
501 Not Implemented | Operation exists but is not implemented. |
503 Service Unavailable | OneBEX 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.
| Exporter | VM disk storage | Transport | Description |
|---|---|---|---|
nbd | File-based qcow2 disks | Network Block Device | Exposes the backup disk through NBD. OneBEX starts a read-only qemu-nbd process and serves the disk export through a Unix socket. |
lvm | Disks on LVM datastores | Direct block-device reads | Exposes 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. |
rbd | Ceph RBD disks | Direct RBD reads | Exposes the prepared Ceph RBD snapshot directly. Full backups return the full image extent, while incremental backups return the changed extents between RBD snapshots. |
nbd and rbd exporter reads disk data with the nbdsh tool from the python3-libnbd package. This package is installed automatically as a dependency of opennebula-node-kvm on all supported platforms except SLES 15, where it is not available in the SUSE repositories. To use the nbd or rbd exporter on SLES 15 hosts, install python3-libnbd manually, for example from the openSUSE Leap 15.6 repositories, together with the matching libnbd0 package.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.
Configure the VM backup. Set
BACKUP_CONFIGin the VM Template, or update an existing VM withonevm 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_IDSis optional: omit it to back up all eligible disks, or provide a comma-separated list such as"0,2". Select disks here, not throughPOST /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, notSNAPSHOT.Use an interactive Backup Datastore. The target Backup Datastore must have
TYPE="BACKUP_DS"andDS_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.Start a VM backup through the integration’s OpenNebula API workflow. An equivalent CLI example is:
onevm backup --schedule now -d 100 132The Transfer Manager (TM) prepares the disks and calls
POST /exportautomatically. The external backup application must not call/exportagain.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.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' | jqThe
infoendpoint 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
extentsendpoint 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
0for a total of7516192768bytes. 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, andholeflags indicate whether a region has changed, contains zeroes, or is unallocated, respectively.Read the required extents with
GET /images/:TRANSFER_IDand an inclusiveRangeheader. For the incremental extent above:curl -sS --fail \ -H 'Range: bytes=1048576-3145727' \ 'http://host:13014/images/one-132-0-0bbaeb42' \ --output changed-blocks.binThe response is
206 Partial Contentwith 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.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}' | jqEvery disk transfer must be finalized individually. Repeat this request for each
TRANSFER_IDreturned byGET /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"}' | jqIf 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.
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' | jqIf 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 ConflictwithSTATUS="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}' | jqCancellation 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
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
4007and Image Datastore1, create an Image template namedrestored_image.tmpl:NAME="restored_image" PATH="onebex://1:4007" TYPE="OS" SIZE="4096" FROM_BACKUP_DS="100"SIZEspecifies the expected restored virtual size in MiB:4096MiB (4 GiB) in this example.FROM_BACKUP_DSidentifies the interactive Backup Datastore, here100. Backup Datastore100does 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 1The port must be available and assigned to this restore session. Inspect the newly created Image with
oneimage show <IMAGE_ID>to confirm itsPATHand restore port. OpenNebula starts a TCP restore writer on the Front-end; the Image remainsLOCKEDwhile data is being received.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:Field Size Value Frame type 1 byte 0x00(DATA)Start offset 8 bytes Unsigned 64-bit, big-endian Payload length 8 bytes Unsigned 64-bit, big-endian Total disk size 8 bytes Unsigned 64-bit, big-endian Data Payload length Raw virtual-disk bytes Send each block at its correct offset. This is a TCP protocol, not a OneBEX HTTP endpoint.
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. SendFINISHeven if the restore is cancelled or fails, to release the writer. Do not send data after it. If the restore fails and the Image remainsLOCKED, clean up the incomplete Image as described in Restoring Interactive Backups.
GIVE FEEDBACK
Was this resource helpful?
Glad to hear it
Sorry to hear that