1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 17:06:09 +00:00
Commit graph

9 commits

Author SHA1 Message Date
catborise
348628f13d fix(vmbackups): seventh audit: files of a VM named after a backup, restore-over page
- 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.
2026-11-18 15:33:30 +03:00
catborise
8e0a84a3bd fix(vmbackups): full audit: backup volumes attached, ended creates, refusals
- 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.
2026-11-18 14:30:51 +03:00
catborise
bd5d42e65a fix(vmbackups): third audit: retention keep, target changes, import
- A retention deletion checks the schedule's keep and later dependants
  once the target is reached, right before deleting: keep raised while
  the target connection waited no longer loses the backup.
- Pool and target changes on the target page take the target claim, so
  an import or backup running into the target keeps the pools it uses.
- Import reads a manifest only with its definition and a disk; an
  unreadable manifest is skipped and listed, the others are imported.
- The backups list shows 50 a page and keeps its filter across pages.
2026-11-18 08:29:22 +03:00
catborise
df11685037 fix(vmbackups): second audit: a frozen guest, refused copies, stuck deletes, lists
Codex's audit of the module, each fix tested:
- a backup cancelled while its guest stayed frozen ends through recovery,
  which thaws the guest first, not as a cancel that never thaws it;
- a restore copy libvirt refuses fails and removes the copies, instead of
  waiting on an administrator as an unknown outcome;
- a deletion that did not end can be asked again from the page;
- recovery starts a restored VM the restore was asked to start;
- a manifest with a bad UUID no longer stops reading the target's others;
- an owner is not linked to a job only its submitter or a superuser opens.

From the browser audit: with a long VM name the backup list pushed the
state and the actions out of view, and on a phone only the time and VM
showed. The list folds the target under the time and the schedule under
the VM, cuts long names (whole on hover), shows the restore menu as an
icon on a phone, and fits from 390 px up. An owner without a backup quota
is told so, and quota sizes never read 0.0 GiB.
2026-11-18 07:29:36 +03:00
catborise
fc87a3034e fix(vmbackups): clearer backup pages; a deletion stays on its page
Deleting a backup took the user to the generic job page, which named
neither the backup nor a way back. The deletion now stays on the page it
was asked from, says which backup is being deleted, shows the row as
being deleted and reads the page again until it is gone. The confirm
dialog is 'Delete backup' and names the target and that it cannot be
undone; the job's label names the VM and the backup's time.

The lists keep a VM's and a target's name and a row's actions on one
line, link a backup's job only when it is being made (Progress) or failed
(Why?), and say 'While shut off' for an offline backup. The schedule form
puts the full-backup setting on a row of its own and the schedule list
shows it; the restore form starts on the VM's host.
2026-11-17 20:14:12 +03:00
catborise
db4cbf806a feat(vmbackups): VM owners back up and restore their VMs within a quota
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.
2026-11-17 19:40:24 +03:00
catborise
d856ccca68 feat(vmbackups): restore, delete, retention, check and import know chains
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.
2026-11-17 17:12:05 +03:00
catborise
44aa7afe04 feat(vmbackups): pages and API for restoring over the VM and one disk
A ready backup's Restore button becomes a menu: as a new VM, over the VM
(offered when the backup has its VM row) and one disk. Restoring over the
VM shows each disk's volume now and the new one before it is confirmed,
and why not when it cannot be done. The API gains restore-over and
restore-disk actions, answered 202 with the job.
2026-11-17 16:10:17 +03:00
catborise
7227867d78 feat(vmbackups): delete a backup; the Backups page
Backups in the menu now opens a page of every backup, newest first,
filtered by VM name, target and state; a removed VM's backups are
marked. Each backup, there and on the VM's Backups tab, has a Delete
button (also DELETE /api/v1/backups/<uuid>/, 202 with the job).

The backup.delete job holds the backup and its target. Through the
first of the target's computes that reaches its pool, it marks the
backup deleting, removes the manifest first, so the target no longer
holds a complete backup, then every other file named from the backup's
UUID (also those a failed backup left), then the row. Recovery runs the
same steps again. A backup being made is refused: its job is cancelled
instead.

States and consistency are shown in the reader's language.
2026-11-17 09:14:07 +03:00