1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 17:06:09 +00:00
webvirtcloud/vmbackups
catborise 819cdada69 feat(vmbackups): schedules back VMs up daily, keep the newest, check targets
The worker's periodic pass (about once a minute) runs the schedules:

- Each enabled schedule's VMs are backed up once a local day, from the
  schedule's time for 6 hours, as its owner. A late time's window goes
  on after midnight; a time a spring-forward gap skips falls an hour
  later, a repeated autumn time is its first. A run row per schedule,
  VM row and day, and a submission key made from them, keep a worker
  that stopped between the job and its row from backing a VM up twice.
- A busy target (one copy at a time) or an unreachable host is tried
  again at the next pass; a host in maintenance is waited for. A VM not
  started within the window, a VM that cannot be backed up (TPM) and a
  schedule whose owner is no longer an active superuser get a run row
  saying why. Times passed before a schedule was made are not run.
- Each compute's submissions are a task of their own: a hung host stops
  no other compute's schedules.
- Retention: each schedule's ready backups of a VM beyond keep, oldest
  first, one deletion a target at a time. The deletion checks again,
  before it changes anything, that the backup is still beyond keep.
  Backups by hand and backups of removed VMs are left alone.
- Each target is checked once a day by a backup.check job holding it: a
  ready backup with a file gone, its manifest included, becomes missing
  (restore refused, delete allowed); one whose files are back is ready
  again. A pool no compute reaches marks nothing.
- A scheduled backup carries the end of its window: one that waited
  past it for a worker slot, or whose host went into maintenance
  meanwhile, ends without starting (checked after the host answered).

The jobs on a target alone (delete, read back, check) hold its computes
too, shared: the worker counts a job's hosts by these, so a hung host
takes no more than its share of the slots.
2026-11-17 11:38:31 +03:00
..
migrations feat(vmbackups): backup schedules' records; the worker runs the apps' periodic tasks 2026-11-17 10:18:04 +03:00
templates/vmbackups feat(vmbackups): read the backups of a target into the panel 2026-11-17 09:14:11 +03:00
tests feat(vmbackups): schedules back VMs up daily, keep the newest, check targets 2026-11-17 11:38:31 +03:00
__init__.py feat(vmbackups): the backups app and its records 2026-11-17 07:32:35 +03:00
api.py feat(vmbackups): restore a backup as a new VM 2026-11-17 09:14:09 +03:00
apps.py feat(vmbackups): the backups app and its records 2026-11-17 07:32:35 +03:00
forms.py feat(vmbackups): restore a backup as a new VM 2026-11-17 09:14:09 +03:00
jobs.py feat(vmbackups): schedules back VMs up daily, keep the newest, check targets 2026-11-17 11:38:31 +03:00
models.py feat(vmbackups): backup schedules' records; the worker runs the apps' periodic tasks 2026-11-17 10:18:04 +03:00
schedule.py feat(vmbackups): schedules back VMs up daily, keep the newest, check targets 2026-11-17 11:38:31 +03:00
serializers.py feat(vmbackups): restore a backup as a new VM 2026-11-17 09:14:09 +03:00
urls.py feat(vmbackups): restore a backup as a new VM 2026-11-17 09:14:09 +03:00
utils.py feat(vmbackups): back up a running or shut-off VM into a target 2026-11-17 09:13:59 +03:00
views.py feat(vmbackups): read the backups of a target into the panel 2026-11-17 09:14:11 +03:00