Skip to content

Feature/test restores - #19

Merged
wvcollenburg merged 7 commits into
masterfrom
feature/test-restores
Nov 22, 2026
Merged

wvcollenburg merged 7 commits into
masterfrom
feature/test-restores

Conversation

@wvcollenburg

Copy link
Copy Markdown
Owner

Summary

A backup that verifies proves the bytes are intact. A test restore proves the VM actually boots. This release adds planned test restores per folder, plus progress bars for all running work.

Test restores

  • Test plan per folder (Backup → Schedules → Test restores):
    • A round runs every N days and covers the fixed VMs plus N VMs picked at random. The longest-untested VMs go first, and a VM that was tested rests for N weeks.
    • Tests run on the folder's DR cluster at any hour, and pause while the folder's backups run.
    • Without a DR cluster, they run on the VM's own cluster, only inside the plan's hours, outside backups and when they fit before the next backups.
    • There is one test per target cluster at a time, and only when a node has room under the balancer's RAM ceiling.
  • Boot test: the NICs are disconnected. A pass is the guest agent answering, or a login, lock or sign-in screen on the console. Stop screens, BitLocker recovery, "no bootable device", GRUB rescue and emergency mode count as failures. The last screenshot is kept.
  • Network test:
    • The NICs go on an isolated test VLAN. The test is refused if another VM on the target cluster uses that VLAN.
    • The proxy serves static DHCP leases on the test VLAN, for the test VM's MACs only, then runs ping and TCP port checks. These are bound to the proxy's test NIC, so the restored VM's production IP never reaches the production VM.
  • Options, off by default: keep a failed test VM for N hours; a byte budget per round.
  • Results:
    • The results appear under Runs → Test restores, and the restore points get a Tested column.
    • A failed test, or a fixed VM without a passed test for twice the interval, raises a badge on the cluster card and sends a mail to the closest administrator.
  • Proxy deploy: a new optional Test VLAN adds a second NIC. Proxies deployed from now on use host networking.

Progress bars

  • Backup: green while copying (GiB, device n of m), then purple while the proxy checks the image and reads it back for its checksum.
  • Restore: purple while verifying the chain, then preparing, importing and writing the disks in green.
  • Test restore: shows its step (restoring, booting against the timeout, network checks, removing the test VM).
  • Runs tab: it now also refreshes every 20 s when nothing is running.

Fixes

  • A large full backup no longer looks stuck at its last MiB during the proxy's check and checksum phases.
  • The clean-up of disk clones after a restart no longer deletes the clones of a backup that is running.
  • A full backup that fails no longer leaves its partial data on the share.
  • A Windows lock screen showing only the clock is recognised as booted.

Upgrade notes

  • Migrations 053 (test restores) and 054 (progress) run automatically.
  • Proxy image 0.6.2: proxies update automatically when the backup service starts.
  • Network tests need a proxy deployed with a Test VLAN. Existing proxies show network tests: redeploy. Boot tests work on any proxy.
  • Test plans are not created automatically, so nothing starts until an admin creates one.

Testing

  • Unit tests: 701 pass.
  • Live test, WDvCN11 as the target, VLAN 201 isolated with no DHCP, full backups from scratch:
Test Result
W11Btest (BitLocker, 28 GB) backup 16½ min
btest01 backup 80 s
W11Btest boot test Passed by screen (lock screen, 53 s)
btest01 boot test Passed by guest agent (15 s)
btest01 network test Passed (DHCP lease, ping, port 22)

No test VMs were left behind. The progress bars were checked with screenshots of every phase except the image check and the network checks, which finished too quickly to capture.

William David van Collenburg added 7 commits November 21, 2026 22:04
A test plan per folder restores the newest backup of its VMs as temporary VMs, starts them,
checks they come up and deletes them again (plans/PLAN-test-restores.md, T1 + T2).

- Rounds every N days: fixed VMs plus N at random from the folder's backed-up VMs, longest
  untested first, a tested VM rests N weeks; never-test exclusions.
- Target: the folder's DR cluster (any hour, paused during the folder's backups), else the VM's
  own cluster inside the plan's hours, outside backups, only when it fits before the next
  backups. One test per target cluster; a node must take the VM under the RAM ceiling.
- Boot test: NICs disconnected; pass = guest agent answering, else a login/lock/sign-in screen
  via the console service (new POST /api/v1/bootcheck, classify.boot_verdict recognising stop
  screens, BitLocker recovery, no bootable device, GRUB rescue, emergency mode as failures).
  Screenshot kept; agentless VMs marked.
- Network test: NICs on an isolated test VLAN (refused when another VM uses it), then ping/TCP
  checks from a proxy NIC on that VLAN (proxy 0.6.0 job netcheck, bound to that NIC; host routes
  for the check only; infrastructure addresses never probed).
- Proxy deploy: optional test-VLAN NIC; proxies now run with --network host.
- Keep-failed and byte budget per round: options, off by default.
- Results on Runs (verdict, target, point age, times, checks, screenshot), Tested column on
  restore points, alerts (test_failed, test_overdue) on the cluster card and mailed to the
  closest admin. Sweep removes leftover test VMs (tag and name mark both required).
- Migration 053. Texts in en/nl/de/fr. Manual, administration guide, CHANGELOG.
…-restart sweep no longer eat backups

- Test restores, network level: the proxy serves the test VM its source addresses by DHCP on the
  test VLAN (dnsmasq, static leases for the test VM's MACs only, no pool/router/DNS) and probes
  until the VM answers or the timeout; the test VM is started once the leases are served.
  Proxy 0.6.1: netcheck no longer rejected for lacking a backup target; dnsmasq-base in the image.
- A failed run that had started a new chain removes its partial files from the share and the
  empty chain (two failed fulls of a 28 GB VM filled the lab share).
- The clone sweep shortly after a restart skips chains whose backup is running (it deleted the
  clones of a backup that had just started).
… and checksum phases

- Console boot verdict: a second OCR pass for white text (near-white pixels only, sparse mode)
  when the first decides nothing; a clock line plus a weekday counts as a lock screen. Live: a
  restored Windows 11 VM's lock screen read '-' before, now passes; also catches white-on-blue
  stop and BitLocker recovery screens.
- Proxy 0.6.2 reports the phases after a disk's copy (image check, checksum read-back with bytes);
  the run's message shows them instead of sitting at the last MiB.
- "guest agent unknown (source VM is off)" instead of "agent unknown (VM is off)", en/nl/de/fr.
Green while copying or writing, purple while verifying (image check and checksum read-back),
sliding when the amount is unknown; a running test restore shows its step (restore, boot against
its timeout, network checks, clean-up). Runs, restores and test runs store structured progress
(migration 054). Texts in en/nl/de/fr.
@wvcollenburg
wvcollenburg merged commit 2f4f5d7 into master Nov 22, 2026
2 checks passed
@wvcollenburg
wvcollenburg deleted the feature/test-restores branch November 22, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant