openSUSE / transactional-update

Atomic updates for Linux operating systems
Other
107 stars 31 forks source link

transactional-update

Update the operating system in an atomic way

transactional-update provides an application and library to update a Linux operating system in a transactional way, i.e. the update will be performed in the background while the system continues running as it is. Only if the update was the successful as a whole the system will boot into the new snapshot.

It consists of the following components:

What's a "transaction" when thinking about OS updates?

You may be familiar with the term "transaction" in the context of a classical database transaction: Only if all the single changes to the database tables could be applied successfully, then a final COMMIT will activate them, otherwise a ROLLBACK will just discard everything again.

In the context of operating system updates this is equivalent: Only if all updates (or other changes) could be applied successfully, then the system will switch into that new updated state. If any error occured - think about failed package post scripts or running out of disk space - the updated system will just be discarded again. All of this is happening in the background, i.e. the currently running system just continues to run all the time.

Or in a more formal way: A transactional update is an update that

Supported Systems

How does this work?

With the Snapper implementation, first a new snapshot of the system is created. Afterwards, this snapshot is changed from read-only to read-write and several special directories such as /dev, /sys and /proc are mounted. The proposed change(s) will be performed in that snapshot in a chroot environment; on (open)SUSE systems for example zypper is wrapped into a tukit call to install, update or remove RPMs. If the update did succeed, then switch the snapshot to read-only (on ro systems) and make the subvolume the new default. On next boot, the system will boot the new snapshot. If the updated system should not boot (see also health-checker), the system can simply be rolled back to the old snapshot.

How to update an atomic system

Applications can integrate support directly (such as dnf or Cockpit - see Known Users below), otherwise any command can be wrapped with tukit execute (e.g. zypper).

User Documentation

API Documentation

Developers that want to integrate support for transactional updates may be interested in the following official API ressources:

Known Users

transactional-update was originally developed for the openSUSE project as the update mechanism for all transactional / read-only systems (openSUSE MicroOS, SUSE Linux Enterprise Micro, SUSE Linux Enterprise Server / openSUSE Leap / openSUSE Tumbleweed "Transactional Server" role) and is used as the update mechanism there.

Additionally the following components support transactional-update directly:

Caveats