Besides the newest N backups of each VM, a schedule keeps the newest backup
of each of the last N weeks and of the last N months that have one (panel
time zone); 0 keeps none. The schedules list shows them.
Audit of the alerts and backup verification: an operator could learn
that the alert mail or webhook works only from a real failure. Settings
> Alerts gets "Send a test alert", sent at once to the channels saved,
each channel's result shown. A damaged backup's reasons were only in a
tooltip, so not on a touch screen: they show under the badge. A restore
of a backup that a verification found damaged, or of an incremental on
a damaged base (shown as Ready), said nothing: the restore pages warn.
The daily target check only finds files that are gone. Verify (a ready
backup's Restore menu, superusers) runs backup.verify: it reads the
backup's files and those of the backups it builds on whole from the
target through a libvirt stream: each there, a disk at its size and in
its format on its base's file, the small files with their SHA-256, and
a disk with the SHA-256 recorded at its first verification. What is
wrong is kept on the backup and shown as Damaged; a target that cannot
be read fails the job and leaves the backup as it was. Progress in
bytes, cancellable.
A backup schedule backs up a compute's VMs, chosen VMs, or now every VM
with a tag: those that have it at each run, templates left out, so a VM
given the tag is backed up from the next day on. The form checks the
target's pools on the hosts of the tag's VMs now; a VM tagged later on a
host without one fails its run with that reason, as a compute's new VM
does. The schedules list says "VMs tagged prod".
A tag a schedule uses is not deleted: the Tags page says which schedules
back up its VMs.
- A VM may be named "<another backup's prefix>-x": its backups' files then
begin with that prefix too, and deleting the other backup removed them.
Backup.owns() takes a file only when no other backup UUID follows the
prefix; deletion and the storage pages' refusal use it.
- The restore-over page failed with a server error when the VM's pool
could not be read while naming the copies; it now says why.
Someone looking at the target's directory could not tell whose backup a
file was without opening its manifest. A new backup's files are named
<vm>-<backup uuid>-<file> (the VM's name made safe for a file name, at most
64 characters). The prefix is kept on the row: backups made before keep
their wvc-<uuid> names (migration 0007), and an import takes it from the
manifest's file name. Manifests of either naming are found by their
UUID suffix.
- A backup's volume is no longer attached to a VM as an existing volume:
the VM would write into the backup, and the backup's deletion (by hand
or retention) would remove the VM's disk.
- A backup whose create job ended without it (uncertain, then resolved)
stayed "creating" for good and could not be deleted. Only a backup whose
job still runs is being made; the others show as failed and are deleted.
- A VM with an NVDIMM or virtio-pmem device is refused: the host file
behind it is not copied, and its restore would use the original's file.
- A block device's or network NVRAM is refused by its path, instead of a
ready backup without the firmware state.
- A VM owner's restore pages link back to the VM's Backups tab, not to the
superusers' backup list.
A failed run kept the error as English text and the schedule page passed
the whole sentence to gettext, which found no catalog entry once values
were filled in. The run now keeps the error as messages (text and values),
as jobs do, and the page shows them with the new words filter.
A permission 'Can back up instances' lets a user back up the VMs they
may change into targets open to VM owners, restore those backups over
the VM or as a new VM, and delete the backups they took by hand. Each job
checks the rights at admission and again when it runs.
- A backup quota (GiB, in the user's quota) counts the owner's own
backups: a backup being made holds its estimate, what its disks and the
files below them hold. An owner's backups run one at a time, so each
run's check sees the others.
- An owner restores as a new VM on the VM's compute, into its first
disk's pool, within the VM quota; the job counts in it until its VM is
recorded, as a clone does.
- An owner's restore over the VM removes the disks it ran from once the
switch is done, unless another VM uses them: the owner cannot remove
them.
- Recovery never begins a deletion the job had not begun.
Superusers keep everything they had.
An incremental backup is restored by copying its chain flat: every base's
disk file is checked first, as the backup's own, and a chain whose base's
row is gone is refused. A backup that a living backup builds on is not
deleted, by hand or by retention: retention deletes a chain only once all
of it is beyond keep, newest first; a failed backup holds no base. The
target check marks a backup missing when a base's file is gone. Reading a
target links each incremental backup to its base, read first, and leaves
one without its base unread. Restoring over the VM forgets its
checkpoints: its disks are replaced, and the next backup is full.
A schedule with 'a full backup every N backups' above one makes a
checkpoint with each running VM's backup. The next builds on the
schedule's newest ready backup: the changed blocks are pushed into qcow2
volumes made with the base's file as backing file, by its name, as the
target pool's directory differs per host. The base is used only when its
chain is shorter than N, its disks are the VM's, every file of the chain
is in the target, and its checkpoint has a sized bitmap for every disk;
otherwise the backup is full and starts a chain.
Before each scheduled backup of a running VM, the VM's backup
checkpoints are pruned to each schedule's newest base. A checkpoint
libvirt no longer lists, as after a migration, is redefined first so
that its bitmap goes too.
A shut-off VM's backup checkpoints are forgotten before its external
snapshot: libvirt 11.10 makes no offline external snapshot while a
checkpoint exists. The next scheduled backup is then full.
A VM with the panel's emulated TPM 2.0 is backed up when it is shut off:
each state file of libvirt's swtpm directory for the VM, read through a
transient pool on it, becomes a small file of the backup (role tpm),
written and read back like the NVRAM file. A running or paused VM with a
TPM is refused, and so is a TPM with its own settings (encryption, a
state path, another backend). The manifest says whether the TPM state was
copied or never written.
A backup schedule (BackupPolicy) names its VMs, chosen or every VM of a
compute at the time it runs (templates left out), a target, a daily time
in the panel's time zone, how many backups of each VM to keep (one at
least), whether frozen file systems are required, and the superuser its
jobs run as. A run (BackupRun) records one VM's backup of one day, keyed
by the VM's row, not its UUID, which two VM rows may share. A backup
keeps the schedule that made it; deleting the schedule keeps its
backups. A backup whose files are gone can be marked missing, and a
target keeps when it was last checked.
The worker runs the tasks apps register with register_periodic about
once a minute, on a thread of their own, one pass at a time, each
guarded: a pass stuck on a host takes no thread recovery or a cancel
needs, and one failing task stops none of the others. Nothing registers
one yet.
backup.create takes the schedule that asked for it; one deleted while
the job was queued leaves the backup without a schedule.
A new app holds VM backups: a backup target (a storage pool on each
compute that sees it, its UUID kept to refuse a replaced pool), the
backups (kept with the VM's name and UUID when the VM row goes) and their
files. Claim keys for a target and a backup. Nothing uses them yet.
Installs with their own settings.py add "vmbackups" to INSTALLED_APPS.