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

3 commits

Author SHA1 Message Date
catborise
a145c07601 feat(vmbackups): the Schedules pages
Backups -> Schedules lists the backup schedules and adds one: a name, a
target, every VM of a compute or chosen VMs (a searchable list), a
daily time in the panel's time zone (the form names it), how many
backups of each VM to keep, Require frozen file systems, Enabled. The
VMs' hosts must have a pool of the target. The superuser who saves a
schedule is its owner, whom its jobs run as. A schedule's page edits or
deletes it (its backups are kept) and lists its runs: the backup job,
or why the day's backup was skipped or failed.

The Backups page has a Schedule column (or By hand) and a Missing state;
a missing backup offers no Restore. A VM's Backups tab names the
schedules that cover it. README: a paragraph on schedules.

A target with schedules is not deleted: its page says to delete them
first.
2026-11-17 11:38:35 +03:00
catborise
823d34cc18 feat(vmbackups): restore a backup as a new VM
A ready backup has a Restore button (Backups page and the VM's tab) and
POST /api/v1/backups/<uuid>/restore/. The form takes the new VM's name
(default <vm>-restored), a compute that has the target's pool, the pool
for its disks, Connect the network (off by default: the restored guest
keeps the VM's addresses and host name) and Start after restore. The job
page follows the restore.

The backup.restore job holds what a new VM's job holds, the backup
(shared) and the target. Before anything is made it checks again: the
host is not in maintenance; the name is free in the panel and on the
host (a VM made with virsh too); the backup's files are in the target,
the disks at their size and the small files with their SHA-256; the
host offers the definition's emulator, machine type and firmware, its
networks, bridges and network filters; the destination pool has room
and none of the copies' names. The new VM's UUID, MACs, volume names and
NVRAM path are recorded first. Then the disks are copied from the
target, the NVRAM file uploaded, maintenance checked once more, and the
VM defined last and given to the superuser who restored it.

The definition is the kept one rewritten as a clone's (rewrite_for_new_vm,
taken out of _clone_definition for both): new name, UUID and SMBIOS
UUID, MACs and filter parameters, a VNC password, no cloud-init seed of
the VM's; with a new generation ID, each disk's source the restored file
without the old chain, the NVRAM path, and links down unless connected.

Recovery records a VM defined by the recorded UUID; otherwise it removes
the copies and the NVRAM file by their recorded names.
2026-11-17 09:14:09 +03:00
catborise
022737f143 feat(vmbackups): backup targets: a storage pool per host, checked to be one directory
A backup target is a dir or NFS storage pool the administrator makes on
the hosts and registers on the new Backup targets page (Backups in the
menu, superusers only). Each compute's pool is kept with its UUID, so a
pool replaced by another of the same name is refused. A second compute's
pool is accepted only when it is the same directory as the target's
first (the exclusive-create check migrations use). The target page shows
each pool's space and warns when the target is inside another pool's
directory, as its backups would share that storage's failures.

The storage pages refuse to delete a target's pool, and a volume of a
backup (page and API): backups are deleted from the Backups pages.
2026-11-17 07:40:08 +03:00