Documentation menu
Docs / Backup responsibility

Backup responsibility

SimpleVirt protects the platform. You protect the data inside your virtual machines.

This page draws the line precisely, so there is no gap you only discover during a restore.


What SimpleVirt backs up

SimpleVirt-Command controller state

SimpleVirt-Command can back up and restore its own state: the host inventory and the credentials that let the controller manage each host, operator accounts and roles, cluster definitions, HA configuration and state, the ISO library catalogue, directory (LDAP/AD) settings, the task log, certificates, and — when the controller runs on its bundled database — a dump of that database.

  • Take a backup: Administration → Backup and restore → Download encrypted backup, or POST /api/v1/backup with {"passphrase": "…"} (at least 12 characters). Every backup is encrypted as a whole with that passphrase (Argon2id key derivation, XChaCha20-Poly1305 in authenticated blocks), so nothing in it, not even a file name, is readable without the passphrase, and a copy that was cut short or altered is refused. On a bundled-database controller the backup also carries /etc/simplevirt-command/db-key, wrapped under the same passphrase, so it restores on a replacement controller. The passphrase is never stored: keep it apart from the backup, because without it the backup cannot be restored. The old unencrypted download (GET /api/v1/backup) is gone and answers 410.
  • Schedule backups off this controller: Administration → Backup and restore → Scheduled backups (GET/PUT /api/v1/backup/schedule). Set an interval, how many backups to keep (and optionally for how many days), a schedule passphrase, and one or more targets: an SFTP server (its host key pinned by fingerprint), an NFSv3 export, an SMB share (message signing required unless you allow otherwise) or an S3-compatible object store. Test writes, reads back and removes a small file on a target. After each run the controller reads the copy back from every target, checks its SHA-256 (a .sha256 file sits beside each verified backup), decrypts it to the end, unpacks it into a scratch directory and checks it the way a restore would. The .sha256 file is written only once the copy verified, and a copy that does not verify is removed again, so only verified copies count toward how many are kept. Each scheduled file name carries a short tag of the controller that wrote it, and retention only removes that controller's files; still, give each controller its own directory (see Known limitations). A run that leaves any target without a verified copy raises the stale-backup alarm at once, naming the target and the reason, and is retried after an hour. Back up now runs the schedule immediately. The schedule passphrase is sealed on the controller and never shown again; record it apart from the backups.
  • Before every controller update the controller takes an encrypted backup of itself, with its database dump beside it, checks that it restores, and records its path, size and SHA-256 on the Lifecycle page; only then does it reboot into the update (see Operations). The last three are kept in /var/lib/simplevirt-command/.backups/ on the controller's own disk. Because they stay on that disk they do not count as the controller's last backup: the Backup page names the newest one as on this controller only, and the stale-backup alarm stays armed until a backup leaves the controller (a download or a scheduled copy).
  • What a backup leaves out: a staged update image, for the controller (updates/staged.iso) or for hosts, is a re-uploadable file, not state, and is never in a backup. A backup the controller's data disk has no room for (it needs about three times what it holds, for the database dump, the encrypted copy and its check, plus 512 MiB kept free) is refused before anything is written, with how much it needs.
  • Restore: upload a backup in the same place, with its passphrase, or POST /api/v1/restore with the passphrase in X-SimpleVirt-Backup-Passphrase-Base64. The controller swaps in the restored state and restarts on it. A wrong passphrase changes nothing. An unencrypted backup taken by an older version still restores, with a warning first in the answer and in the audit log: anyone who has a copy of such a file has the migration CA key, so delete every copy and rotate the migration CA (below).

After a restore, the controller observes before it acts. A backup is a picture of the fleet when it was taken; the hosts kept running on everything that happened since. So a restored controller starts in a hold, shown as an alarm and on Administration → Backup and restore, until an administrator chooses Resume there (or POST /api/v1/restore/hold/release):

  • HA fails over only a host the controller has read since the restore, and restarts only VMs whose current definition it has read since. A host that is down when the controller comes back is not failed over from the backup's list of its VMs; its own recovery paths, or you, bring those VMs back. HA failover records from the backup are left as they are: no ghost copy is removed, no storage fence is released or newly applied on their word, and a failover plan from the backup cannot be approved. One thing is kept going: when a VM HA restarted is seen running now on a host the controller has read since the restore, the storage fence that keeps its old host off its disk is refreshed by its recorded entries, so it does not lapse.
  • Distributed-switch changes that would push the stored declaration to hosts (Remediate, an edit, attaching a host) show what they would change on each host and need that list confirmed; Adopt live writes what the hosts run into the declaration instead. A host joining or rejoining a cluster gets no switch realized until you resume.
  • The load distributor moves no VM.
  • The live-migration roster, peer firewall list and certificates are not pushed to hosts, so no host restarts its hypervisor service because of the restore. A host paired after the backup is not in the restored records: add it again before you resume.
  • The controller's cached list of each host's VMs is not restored; it is read from the hosts.

Nothing is stopped, fenced or moved because of the restore. When a host holds a newer power intent for a VM than the restored records (the VM was started or stopped after the backup), the controller adopts the host's, and a power action you take afterwards is recorded above it so it reaches every host.

Before a restore replaces anything, the controller keeps a snapshot of its current state in a .pre-restore-<time> directory under its data directory. When the backup brings a different encryption key, the key the controller used until then is kept in that snapshot as db-key: the snapshot's database dump opens only with it.

Both operations are recorded in the audit log, because a backup contains secrets — host credentials, Kubernetes join tokens, the local password store, and the private keys of the migration certificate authority every host trusts and of the console's HTTPS certificate. They are encrypted with the passphrase, which is why the passphrase must not be stored beside the backup. Keep backups off the storage you are trying to be able to recover from.

Rotating the migration certificate authority

The migration CA's key can make a certificate every host's libvirt accepts. If a backup taken before backups were encrypted, or a copy of the controller's disk, may have left your hands, rotate it in Administration → Backup and restore → Migration certificate authority (GET /api/v1/migration-ca, POST /api/v1/migration-ca/rotation with {"action": …}). It is two steps, and live migration keeps working through both:

  1. Rotate CA… (start) creates a new CA beside the current one. Every host is first given a trust file holding both CAs, then a certificate from the new CA, one host at a time. At no point does a host refuse another: each trusts both. A host counts as having taken a step only once it reports that its libvirtd has loaded the new files, not when they were written: the second half of the step waits until every host's libvirtd trusts both CAs. A host that cannot be reached, or whose libvirtd could not reload the files while VMs run (it shows Blocking in the card, with its status, for example pending-maintenance:certificate), stops the rotation at its step; it loads them at its next maintenance or reboot, and Retry (retry) continues once it has.
  2. Retire old CA… (retire) is allowed once every host's libvirtd serves a certificate from the new CA. The new CA becomes the CA, the old one is moved to retired-<time>/ in the CA directory, and every host is told to trust the new CA alone.

Each step changes certificates only. A host whose migration listener is running reloads them into its running libvirtd without a restart, as a routine certificate renewal does; a host whose listener is not up yet gets the same safety-gated libvirtd restart a first certificate gets.

Re-adopting clusters without a backup

Every host keeps a definition of its clusters signed by its controller: the clusters, their member hosts, their distributed switches, the datastores the members mount, and their HA and workload-distribution policy. Administration → Backup and restore → Re-adopt clusters shows this controller's signing-key fingerprint: record it with your backups. If the controller is lost with no backup, install a fresh one and pair the surviving hosts with it (they come back standalone). The same card then lists each definition the hosts hold, the fingerprint it was signed with, and which of its hosts are paired; compare the fingerprint with the one you recorded, then Re-adopt (GET /api/v1/adoptable-clusters/definitions, POST /api/v1/adoptable-clusters/adopt-definition). The cluster comes back with its switches (each host's uplinks follow it to its new id) and its workload-distribution policy; HA is turned back on only when you tick it. Nothing is pushed to a host to do this: the networks and datastores are already on the hosts. A fresh controller never overwrites another controller's definition on a standalone host, so pairing first and deciding afterwards is safe: it pushes its own only when the host answers that it holds none, never after a timeout or an error. A host whose definition is replaced by a different controller's keeps the replaced one aside, and the card offers that one too.

Host configuration

Each SimpleVirt host holds its own configuration — its networking, its datastore mounts, its VM definitions — and an in-place upgrade preserves all of it, along with the VM disks under /var/lib/libvirt and the local accounts. SimpleVirt-Command also keeps a backup of every host's own settings (its time servers, DNS servers and search domain, the SSH service, lockdown and its exceptions), taken every 6 hours and on Back up now (host Settings → Security → Configuration backup), one per installation, in the controller's database and so in every controller backup. A host reinstalled from scratch is added to the controller again under its name; Restore on that card then applies the backup of the installation before it, and the cluster's networking and storage are re-applied from the host's Finish adding panel as before. The management address, the VM definitions and the VM disks are not in that backup: see known limitations §125.


What SimpleVirt does not back up

The data inside your virtual machines. Guest filesystems, databases, application state — SimpleVirt keeps no copy of any of it. There is no built-in VM backup job, no backup schedule and no catalogue.

What SimpleVirt provides is the backup API (in the appliance's documentation) a backup product uses to do that job: it hands out a VM's disks at one point in time (the guest frozen through its agent for that instant when it has one, never paused), says which blocks changed since the last backup, and writes disks back into a stopped VM for a restore. The copies, their schedule, their retention and where they are kept are the backup product's.

The controller backup above does not contain a single byte of guest data. Restoring it onto a rebuilt controller gives you back a controller that knows about your fleet; it gives you back nothing that was inside a VM.


What you must put in place

Before you run anything you care about on SimpleVirt, have a backup product that covers guest data. In practice that means one of:

  • A backup product that uses SimpleVirt's backup API (in the appliance's documentation) — it copies each VM's disks (changed blocks only after the first copy) from the hosts to its own repository outside the cluster, and restores them. Give it a role with backup.operate (and vm.edit to restore), and see Known limitations §66 for what the API does not cover yet.
  • An in-guest backup agent — your backup product's agent installed inside each VM, writing to a repository outside the cluster. This is the most portable option and the one that gives you application-consistent copies of databases, because the agent coordinates with the application.
  • Storage-tier backup — snapshots and replication performed by the NFS appliance or array that hosts your datastore, managed by that system rather than by SimpleVirt.

Whichever you choose:

  1. Keep copies off the datastore holding the VM. A copy that dies with the datastore is not a backup.
  2. Cover the controller too. Set a backup schedule in Administration → Backup and restore → Scheduled backups to a target off the controller, and keep the schedule passphrase apart from the backups. Record the cluster-definition signing fingerprint shown there too.
  3. Test a restore. An untested backup is an assumption.

How the pieces you do have fit a recovery plan

SimpleVirt gives you two things that look like protection. Both are useful. Neither is a backup, and knowing the difference is what keeps a recovery plan honest.

Snapshots — a short-term undo, not a backup

Take a snapshot before a change you might want to reverse within the hour: a patch, an upgrade, a configuration edit. Revert it or delete it when you know the outcome.

What a snapshot cannot do for you:

  • Its consistency depends on the storage tier. An NFS (qcow2) snapshot is always crash-consistent: SimpleVirt does not quiesce the guest, so it captures the VM as if the power had been cut, and a database recovers from it the way it recovers from a crash. On SimpleVirt HCI (Ceph/RBD), a snapshot of a running VM is application-consistent when SimpleVirt Guest Tools (or a qemu-guest-agent) freezes the guest's filesystems first, and falls back to crash-consistent when no agent answers.
  • It lives on the same datastore as the VM, inside the VM's own storage. It does not survive the loss of that datastore.
  • It is available on both NFS and SimpleVirt HCI storage. An NFS snapshot is an internal qcow2 snapshot; an HCI snapshot is a native RBD snapshot taken across all of the VM's images. The one VM SimpleVirt will not snapshot is one whose disks mix Ceph/RBD and file storage, because the two cannot be captured at a single consistent point — SimpleVirt refuses that case up front and says why.
  • It does not survive a host move or an HA recovery. Moving the VM to another host, or having HA restart it on a survivor, loses every rollback point; the Migrate wizard warns you before you commit a host move. A storage migration is different: SimpleVirt refuses it outright while the VM has snapshots ("delete the snapshots first, then migrate the storage"), so the move is blocked rather than committed-and-destructive — you must delete the snapshots yourself first.

The controller backup — recovery of management, not of workloads

If the controller VM is lost, install a fresh SimpleVirt-Command from the ISO and restore the backup. You get back the fleet inventory, users, clusters, HA configuration and the credentials that let the controller manage the hosts. The hosts keep running their VMs throughout — they do not stop because the controller is gone. What you lose while the controller is down is management, and, unless the cluster's cluster services are armed, HA failover (see Known limitations).

If the controller is lost with no backup, its clusters can still be re-adopted from the signed definition every host keeps (see Re-adopting clusters without a backup), and a SimpleVirt HCI cluster also by the Ceph fsid its members share (GET/POST /api/v1/adoptable-clusters). Neither brings back operator accounts, roles, directory settings, the ISO catalogue, Kubernetes clusters or File Services, which only a restored backup recovers.

On a bundled-database controller — the default appliance — the host-management credentials in the backup are encrypted with a key stored at /etc/simplevirt-command/db-key. Every backup this version takes carries that key, wrapped under the backup's passphrase. An unencrypted backup from an older version that was taken without a passphrase does not: to restore one onto a replacement controller, put the key file back before you restore it; otherwise the restore is refused and rolled back in full — not just the host credentials, but the inventory, users, clusters and HA state with them — so nothing is recovered. A key restored from a backup is used from /var/lib/simplevirt-command/.db-key.restored until it is installed at /etc/simplevirt-command/db-key, which the service cannot write: the Health Center shows the command to run, and the notice clears at the next start once the key file holds the same key. A file-based controller (an empty dsn, which stores host tokens in the clear) is unaffected.

The controller takes a verified backup of itself before every controller upgrade. Keep a schedule running for everything else: adding or removing hosts and clusters, changing roles or directory settings.

Putting it together

If you lose… Recovered by What you still need
A change you made inside a VM (within the hour) VM snapshot revert —
The controller VM SimpleVirt-Command backup restore onto a fresh controller The backup's passphrase (for an unencrypted backup from an older version on a bundled-database controller, the preserved /etc/simplevirt-command/db-key, restored before the backup)
The controller VM, with no backup Re-adopting the clusters from the hosts' signed definitions Accounts, roles, directory, library and Kubernetes clusters are not recovered
A VM's data (deletion, corruption, ransomware) Your backup product (through the backup API, or an in-guest agent) SimpleVirt keeps no copy; the backup API hands the disks to your product and writes them back
A datastore, array or site Your backup product, plus rebuilding the datastore SimpleVirt keeps no copy; restore into new VMs through the backup API
A host HA restart or manual re-registration of the host Guest data still comes from your backup product if the storage went with it

  • Backup API (in the appliance's documentation) — the API a backup product uses to copy and restore VM disks
  • Known limitations — the full statement of what this release does not do
  • Operations — controller backup as part of the upgrade sequence
  • Installation — protecting the controller's disk
This page is part of the SimpleVirt 1.1.0 documentation set. The same guides ship inside the appliance images at /usr/share/doc/simplevirt.