Incus Integration with Bareos: New Plugin Preview

Bareos continues to grow with new integrations for modern open-source infrastructure. In our latest video, Benjamin Somers from IMT Atlantique presents his work on a new Bareos plugin for Incus.
Incus is a system container, application container and virtual machine manager from the Linux Containers project. It provides a public-cloud-like experience and lets users manage containers and virtual machines with shared storage and networking concepts.

With many teams looking for open-source virtualization options and VMware alternatives, Incus is worth a closer look. Proxmox is already well known in this space, but Incus offers another approach: one manager for containers and virtual machines, from local setups to larger server environments.

The new Bareos plugin adds backup and restore workflows for Incus containers and virtual machines. The plugin is already merged and planned for the upcoming major Bareos release.

Why Incus backup matters

Incus can manage system containers, application containers and virtual machines. It also supports different storage backends and network types, and can be managed through a command line tool, REST API or third-party tools and integrations.

This makes Incus useful in very different environments: local development systems, cloud instances, server racks and larger clustered setups. In the presentation, Benjamin also mentions real-world use cases such as build infrastructure, local isolated environments and large-scale cloud clusters.

When Incus is used for real workloads, backup becomes part of the infrastructure design. Containers and virtual machines need to be protected in a way that fits how Incus exports data, manages instances and works with storage.

The new Bareos plugin adds backup and restore workflows for Incus containers and virtual machines. The goal is to support full and incremental backups and restores for both instance types.

How the plugin works

For containers, the plugin uses a streaming approach. Incus produces a tar file, and the plugin streams it to Bareos file by file. The data goes directly from Incus to the plugin and then to Bareos, without creating a large temporary file.

This is useful when the host does not have enough free space to store a full temporary export before the backup.

For virtual machines, the problem is different. VM disk images can be very large. If the whole disk is treated as one file, even a small change can make incremental backups inefficient.

The plugin handles this by cutting the disk stream into chunks. It computes a hash for each chunk and sends the chunk to Bareos. During incremental backups, Bareos can compare the hash with the value stored in its database and back up only the chunks that changed.

This helps avoid backing up the whole VM disk image every time.

Restore workflow

For containers, restore works in the opposite direction. Bareos restores the files, the plugin converts them back into a tar stream and the stream is sent back to Incus. Again, this works as a stream and does not require a large temporary file.

For virtual machines, restore is more complex. During incremental restores, disk chunks may be restored in an order that does not match their final position in the disk image. The plugin has to reorder the chunks and reconstruct the disk image before sending it back to Incus.

What comes next

The current plugin focuses on backup and restore for Incus containers and virtual machines.

Future ideas include support for more Incus objects, such as storage volumes not directly attached to virtual machines, key-value buckets, operating system images and server configuration. More granular restore workflows are also planned, such as restoring only part of a container or, as a longer-term goal, restoring only parts of disk images through Incus APIs.

The work on the plugin also helped identify possible improvements in Incus itself, especially around reducing temporary files and improving import and export mechanisms.

Watch the video

Watch the full presentation here:

Scroll to Top