Installing updates and upgrading LexiVirt OS
This guide covers 2.2.2 and later. Updates are installed from the web console (System → Updates), with no shell or SSH. The same operations are available on the host as lexivirt-update, and from the installation medium for hosts that cannot install updates themselves, such as 2.2.1.
What an update package is
An update package is one file, lexivirt-os-<version>-update.tar. It contains:
| Member | What |
|---|---|
update-manifest.json | the release manifest, signed through the release key chain (root key → signing-key certificate → manifest) |
lexivirt-os-<version>-controlplane.tar.xz | the release: control plane, web console, system files, offline Python wheels |
os/*.rpm (optional) | operating-system packages; none in 2.2.2 |
The manifest pins every file by SHA-256 and size. It also states:
- the versions the release upgrades from (
upgrade_from); - the host requirements: architecture, base system, CPU level;
- whether a host restart is needed;
- the changes, in English and Hebrew.
How a package is trusted. A SHA-256 sum proves only that a file is intact, not where it came from. A host accepts a package only when all of the following hold:
- The signing-key certificate is signed by a root key pinned on that host, in
/etc/lexivirt/trust/. - The certificate is inside its validity window, and its key may publish to the host's release channel.
- The manifest signature verifies, and the manifest has not expired.
- Every file matches its signed SHA-256 sum.
- The version is newer than the installed one. Downgrades are refused; going back is done only by Rollback, to the release this host had before.
If any of these fails, the package is refused and deleted. A refused package can never be installed, through the API or otherwise. 2.2.2 is signed with test keys. Production keys need a separate approval.
Installing from the web console
Open System → Updates as a platform administrator.
- Get the package.
- Upload a package: choose the
.tarfile and select Upload and verify. - Check for updates: if an update source is configured, select Check now and then Download and verify. An update source is an
https://orfile:///directory that publisheslatest.release.json; its signature is checked too. - Review. The review lists every check as Pass, Note or Blocks:
- signature and file integrity;
- the upgrade path from the installed version;
- the base system and CPU capabilities (the server model is never checked);
- the database schema change and whether it can be reversed;
- free disk space and memory;
- running tasks;
- another update in progress;
- running VMs;
- local changes to system files;
- restart requirements.
The review also shows the changes and the impact. Any check marked Blocks prevents installation.
- Install. Type the version to confirm. Two more confirmations appear only when they apply:
- replace system files that were changed on this host (copies are kept in the backup);
- accept that the host must restart afterwards. The restart is a separate step that you start yourself.
- Progress. The phases are: checks → prepare → pause control plane → backup → switch release → system files → database → start → health check → done. While the control plane restarts, the web console is unavailable for about a minute; the page reconnects by itself. New tasks are refused until the update finishes.
- Result. The result is one of:
- Completed.
- Rolled back: the health check failed and the previous version was restored automatically, together with the database copy and system files taken after the control plane stopped, so no data is lost.
- Failed: the error and the recovery steps are shown.
Running VMs keep running. Only the control-plane service restarts. The updater records each running VM's libvirt ID before the update and checks it again afterwards; the result says how many are still running with the same process. If a VM stopped meanwhile, the update did not cause it (the updater never touches VMs), so it is reported as a warning rather than rolled back: a rollback would not bring the VM back.
Automatic installation is off for Testing releases and cannot be turned on, either in the console or through the API.
Rolling back
After a completed update, Rollback returns to the previous release. It stays available until the next update, while the previous release is kept on the host.
- If every schema migration of the update has a down migration (2.2.2's does), the rollback reverses the schema change. Data created after the update is kept.
- Otherwise, the rollback restores the database copy taken before the update. Everything changed since then is lost, so the console asks you to confirm that separately.
A rollback restores the previous release's system files and units, removes files the update added, and checks the previous version's health.
Interrupted updates
The updater writes a journal after every phase (/var/lib/lexivirt/update/journal.json).
- Updater killed or crashed:
lexivirt-update.serviceruns recovery as soon as the updater stops. - Power loss or host restart:
lexivirt-recover.serviceruns recovery at boot, before the control plane starts. - Manual: Recover on the Updates page, or option 3 in the LexiVirt OS recovery boot entry.
Recovery does one of three things:
- Interrupted before the control plane was paused: nothing had changed; the attempt is closed.
- Interrupted after the pause, before the new release passed its health check: rolled back (previous release, database copy, system files).
- Interrupted after the health check passed: completed.
Command line on the host (optional)
lexivirt-update status lexivirt-update check /path/lexivirt-os-2.2.3-update.tar # the review, changes nothing lexivirt-update install /path/lexivirt-os-2.2.3-update.tar # asks you to type the version lexivirt-update rollback lexivirt-update recover lexivirt-update history
Every operation, from the console or the command line, is recorded in the update history and the audit log (update.* actions).
Upgrading a 2.2.1 host to 2.2.2
2.2.1 cannot install updates. It only verifies them. Upgrade it from the 2.2.2 installation medium:
- Shut down the VMs on the host. The upgrade restarts the computer; VMs set to start automatically start again.
- Boot the host from
lexivirt-os-2.2.2-amd64.iso(virtual media, USB or DVD) and choose Upgrade an existing LexiVirt OS installation, the second menu entry. - The upgrade screen lists the LexiVirt OS installations it found, with the installed and the new version. Type
upgrade. - The update package on the medium must verify against the trust root of the installed host. Its checks run, the database and system files are backed up, and 2.2.2 is installed next to 2.2.1.
- The computer restarts. At the first start, 2.2.2 is health-checked; if it is not healthy, the host returns to 2.2.1 by itself.
- Sign in. System → Updates shows the completed upgrade, and offers Rollback to 2.2.1.
Nothing is erased: the medium's install entry is not used, and no disk is partitioned or formatted.
Supported upgrade paths
| From | To | How |
|---|---|---|
| 2.2.1 | 2.2.2 | installation medium, Upgrade entry (2.2.1 has no updater) |
| 2.2.2 | later 2.2.x releases that list 2.2.2 in upgrade_from | web console, lexivirt-update, or the medium |
| 2.1.x (legacy line) | — | not supported (see below) |
The updater refuses the following, and changes nothing:
- versions a package does not list;
- versions older than the installed one;
- a database whose schema is newer than the release;
- a host that is not LexiVirt OS.
Why there is no upgrade from 2.1.x
The 2.1.x line is a different product: a different code base, file layout, database and data model. The updater recognizes a 2.1.x host (/opt/lexivirt/VERSION without /opt/lexivirt/current) and refuses it with an explanation. It never creates a partial migration. A supported migration would need:
- A data exporter for 2.1.x. It would read the 2.1.x database (
/opt/lexivirt/data/lexivirt.db) and produce a documented, versioned export: users and roles, nodes, networks, storage definitions, VM records, backups and keys. - A mapping to the 2.2 model, with tests on real 2.1.x data covering:
- organizations and projects (2.1.x has none);
- roles and permissions;
- network definitions on bridges and VLANs;
- storage pools;
- VM definitions (libvirt XML and disks, which must be adopted, not copied);
- backup chains;
- secrets, re-encrypted with the 2.2 key.
- A dry run on a copy of the 2.1.x data that reports what would be imported, changed or dropped, before anything is changed.
- A rollback plan. The 2.1.x host is replaced at the OS level, so the migration needs a full backup of the 2.1.x system and a tested restore.
- Tests on a real 2.1.x installation, with running VMs, before the path is marked supported.
Until then, move a 2.1.x installation by installing 2.2 on a new or wiped host and recreating the configuration. Existing VM disks can be imported as volumes.
Host restart and kernel changes
A package may declare that the host must restart, for example for a new kernel. The review says so before installation, and installing needs a separate confirmation. The restart itself is another step:
- the console shows Host restart required;
- Restart host asks you to type
restart; - the restart is refused while any VM is running.
2.2.2 contains no operating-system packages and needs no restart. Installing operating-system packages from an update package has not been tested on real hardware yet; see KNOWN-ISSUES.md.
Files on the host
| Path | What |
|---|---|
/opt/lexivirt/releases/<version>/ | release trees (current and previous) |
/opt/lexivirt/current | symlink to the running release |
/var/lib/lexivirt/update/journal.json | the current or last update operation |
/var/lib/lexivirt/update/history.jsonl | every finished operation (replayed into the audit log) |
/var/lib/lexivirt/update/backups/<id>/ | database copy and replaced system files of the last update |
/var/lib/lexivirt/update/managed-files.json | SHA-256 of the system files LexiVirt OS installed (detects local changes) |
/etc/lexivirt/trust/*.pub | pinned release root keys |