A review of every Markdown file against the code found steps that would
fail and statements that are no longer true:
- RHEL computes set up by hand enabled only virtqemud: the storage,
network and other host pages need their daemons' sockets too;
- moving to a new machine migrated without /etc/default/webvirtcloud
(a PostgreSQL panel would migrate the wrong database), and needed a
node_id an older backup may lack;
- a rollback left update.sh's marker of a stopped update, which the
next update would have gone on with;
- the manual installs' group and mode lines failed on hosts without one
of the groups or without sqlite; RHEL's CodeReady Builder repository;
- the NFS backup target was defined on the user's libvirt connection;
- the off-site restore picked a backup by name, not time;
- the features, the jobs list, the console token, the alert webhook
(ntfy does not take it), the API's submission_key, WS_* in the update,
the update's last failure, the doc/ API and app tables, permissions
of templates, protected VMs, backups and the .vv file.
An installer rerun kept WS_PORT in data/local_settings.py but pointed
nginx at that run's answer: it now takes the kept port.
Updating took four steps of commands copied from the README, with a
diff to read for settings.py and the nginx config. update.sh does them:
run from the repository (git show origin/master:update.sh | bash), it is
always the newest one, also on an installation that has none yet.
Nothing changes before its checks pass: root, an installation, with
PostgreSQL --database-backed-up, and an older version's own settings.py
moved into data/local_settings.py first (it stops and shows how that
settings.py differs from its version's template). Then it stops the
panel, backs it up into /root/webvirtcloud-backup-<date>, pulls master,
installs the requirements (LDAP's too when installed), migrates,
collects the static files, gives the files to the panel's user,
installs the units and starts the panel. It does not replace the nginx
config, which holds the installation's own lines: it prints what the
new version changes in it. The whole script is one function, so the
pull cannot change what runs.
dev/test-installer.sh IMAGE FROM installs FROM and updates it to HEAD;
the Installer workflow runs it from v4.3.0 on Debian 13 and AlmaLinux
10. The README's update section is the command and what it does.
Every update rebuilt settings.py from the template, and the operator put
back their own values by reading a diff: a forgotten DATABASES started
the panel on a new, empty sqlite database. Docker users who needed an
option only settings.py has (LDAP, OTP_ENABLED, LOGIN_TRUSTED_PROXIES)
mounted their own copy and kept it up to date by hand.
webvirtcloud/settings.py is now the tracked file (no template, no copy
in the installer, the image, the container's start or CI), and it runs
data/local_settings.py last: the installation's own values, which an
update does not touch, kept in Docker's data volume, in the panel's
backups and readable by the panel's user only. The installer writes the
time zone, the noVNC port (now checked to be a number), ALLOWED_HOSTS
and CSRF_TRUSTED_ORIGINS there instead of editing settings.py with sed.
LDAP is set up there too; settings.py keeps only python-ldap's
timeouts. The README's update steps move an older version's own
settings.py into the backup before git pull and have its values moved
into the local file once.
A stylesheet the login page links is fetched through nginx (a broken
static alias passed), the panel's units are checked after the page
loads (a daemon that died while it was waited for passed), a page
without the login form is retried with a pause, and the temporary clone
is no longer made readable by every local user.
Leap 16 builds the libvirt and lxml bindings for Python 3.13
(python313-*); the installer asked for python3-libvirt, which it does
not have, and stopped. On openSUSE it now installs the Python stack the
distribution builds the libvirt binding for: 3.11 on Leap 15 and SLES
15, 3.13 on Leap 16 and Tumbleweed. The installer workflow tests Leap
16.0 too, and the README says which installs CI tests.
A download writes its volume under its final name, so the volume was
offered while half written. #685 kept a copy and an attach away from
it; a new VM and a CD-ROM still took it. The VM create job now claims
the volumes it is made from (a writable one exclusive, a template or a
CD-ROM image shared), and adding a CD-ROM or inserting media holds the
ISO's volume shared and reads the ISO again in that pool under the
claim (iso_location, iso_path_in). Each is refused with the download
named.
A claim's key holds a pool's and a volume's names: longer than 255
characters on PostgreSQL it failed the request; Claim.resource is text.
A pool that belongs to more than one backup target is not stopped while
a backup to any of them runs (it took the first target only).
The download read 1 MiB at a time: on a slow server a cancel and the
progress waited for a whole MiB. It reads what has come (read1).
The installer was tested by hand in containers before a release; a
change to it, to what it installs or a distribution's packages could
break a fresh install unseen. dev/test-installer.sh installs the
committed HEAD with install.sh in a systemd container of one
distribution and checks that the panel's services run, it has a secret
key and an admin password, and the login page loads. The Installer
workflow runs it on Ubuntu 22.04/24.04/26.04, Debian 12/13, AlmaLinux
10, openSUSE Leap 15.6 and openEuler 24.03 when the installer or conf/
changes, and weekly.
A download into a pool listed its volume while it was written. The page
let a superuser copy it (the copy got a half-written file, live), attach
it to a VM, or stop the pool under it. Now:
- the copy job claims its source volume shared, and the worker refuses
a copy whose name the source's format changed before the claim;
- attaching an existing volume holds it exclusive from its first read,
so neither a download nor a copy is under way, and its format is read
after the download ended;
- stopping or deleting a pool (page and API) holds the pool exclusive,
and its backup target's claim if it is one; restores claim the pools
they write into shared.
Each is refused with the job in the way named, as a volume delete
already was.
The download recorded its progress every 16 MiB, so a slow server's
bar stayed empty for a long time; it records it each second, with the
cancel check. The worker checks the name is still free before it
starts. A snapshot name or tag typed in the VM list's bulk form keeps
the list from reloading, as a chosen VM did.
An ISO or a disk image on a web server had to be downloaded by hand and
uploaded, or copied onto the host. A pool of files (dir, fs, netfs) now has
"Download from a URL" for superusers: a volume.fetch job streams the file
(http or https, its size told by the server and within the pool's free
space) into a new volume through libvirt, as an upload is written, on any
connection type; the job panel shows its progress and it can be cancelled.
libvirt reads the file's format (qcow2, raw) when the pool is refreshed. A
cancel, a failure or a crash deletes what it wrote; an address that fails
says why.
Taking the same snapshot of many VMs, before an update say, took each one's
Snapshots tab. The VM list's bulk form now has a snapshot name with Take
snapshots: an external snapshot, without memory and without freezing file
systems (the tab has those choices), queued as a snapshot.create job for
each chosen VM, with the tab's rules (change rights and the snapshot
permission). A VM refused or held is named and the others are queued; the
Jobs page follows them. Enter in any text box of the form sends nothing.
The power and snapshot views share one queuing helper.
Audit and review (Codex, agy) of the host comparison and the bulk tag:
- a read of what a host's VMs need was used again for 5 minutes without a
new one, so a network added to fix a line was still reported: each load
reads again, the last read standing in only when the new one is late;
- a host that stopped answering kept what it said before, and was reported
both as not answering and as a destination lacking things: only hosts that
answer are compared;
- one listing of a host that could not be read (its secrets, say) dropped the
whole host: each listing is read on its own and only those read compared;
- the kept reads no longer keep whole VM definitions (plain strings);
- choosing more VMs than the bulk form takes made Django refuse the form:
past 500 the buttons are off and the count says so; the tag view refuses
them as the power view does.
Tagging many VMs took each one's Settings tab. The VM list's bulk form now
has, for a superuser, a tag box (every tag offered) with Add tag and Remove
tag: under the ownership lock the tag is checked as on the Settings tab,
made if new, and added to (or removed from) the chosen VMs that lack (or
have) it, each with its own log row. Enter in the tag box sends nothing (it
would press Start, the form's first button); only the two tag actions are
taken, and none of the chosen VMs left makes no tag.
A VM migrated to a host without its network, network filter or secret was
refused only when the migration was asked for. The box above the hosts now
names, for each pair of hosts it has read, what the VMs of one use (their
running definition and the one for the next start) that the other lacks: an
active network, a network filter or one of other rules, a secret by UUID or
usage; the migration check refuses moving those VMs there. A host in
maintenance is no destination. What a host's VMs need is read on its own
thread, apart from the pools and snapshots, and used again for 5 minutes, so
a host of many VMs is compared too. The rules of two hosts' filters are
compared as the migration check does (filter_rules, shared).
Audit and review (Codex) of the bulk power and disk I/O limit:
- the Jobs page showed "Power" for a start, a shut down and a force off
alike: each is a job kind of its own (instance.start, .shutdown,
.force_off) named by its action;
- forcing off a VM already shut off made libvirt refuse after the job had
recorded its intent: it ended uncertain and kept the VM locked. Each job now
refuses a VM its action does not apply to before anything changes, and
recovery reads the VM's state (running after a start, shut off after a
shut down or force off) instead of ending uncertain;
- the Jobs page left out its kind and state filters for owners, whom the VM
list sends there: they apply to every user;
- a running NBD disk's tls, which libvirt fills in, no longer makes it
another disk than the next start's;
- a disk whose running limit differs from the next start's shows both.
Powering many VMs took a click each. On the VM list each VM its user may
power (theirs, or every one for a superuser) has a box; "Choose the VMs
shown" chooses those on screen. Start, Shut down and Force off queue an
instance.power job for each chosen VM: each holds its VM and shares its host,
checks its user and the VM again when it runs, and has the checks of the
page's buttons (a template is not started, a host in maintenance starts none,
a VM an administrator paused is not an owner's to power), its own recovery
and its own log row. A VM the user may not power, or that another job holds,
is named and the others are queued; the Jobs page follows them. A VM a filter
or a collapsed host hides is neither counted nor sent, and the list does not
reload while VMs on screen are chosen.
One VM's busy disk could take its storage from all the others. Under a
disk's Device details on the Disks tab a superuser sets an I/O limit, IOPS
and MiB/s for reads and writes together (0: none). libvirt applies it to each
definition that has the disk: the running VM's at once, and the one for its
next start; a transient VM's live only. A disk whose tuning is more than this
(a throttle group, a burst, read and write apart, bytes not whole MiB/s)
shows "Set in the VM's XML" and is changed there; a disk the next start
replaces is refused until then.
Audit and review (Codex, agy) of the file system list:
- the table had a side margin on a full-width table and ran past the tab's
edge (on a phone its Used column was cut off); it now sits in a box that
scrolls a long mount point, and on a phone the labels above it wrap by word;
- an agent answer that is not a list, an entry that is not an object, a
negative, boolean or oversized size, or a null mount point or type no longer
fails the tab or shows "None"; a "filesystems" key of another command is not
taken for the list; the total is the whole file system's when the agent
tells it (total-bytes-privileged), so used no longer passes it;
- when the agent does not give the file systems, a note says so;
- Turkish labels: "Kernel Version" was "Çekirdek Sürümü" like "Kernel Release",
"OS Pretty-Name" read as a short name, "Timezone / Offset" as a location;
- the bulk migration live test's name no longer claims two at once, which its
unit test checks.
Since Bulk Migrate spreads VMs over hosts (#601) the job takes moves, each
VM with its destination, not a target and instances: the live test still
sent the old form and failed with KeyError 'moves'. Live suite on the
Vagrant computes: 3017 OK, 7 skipped.
A migration took all the network it could, its disk copies too, and the VMs
on both hosts felt it. Settings has a Migrations group with "Migration
bandwidth" (MiB/s, 0: libvirt's default, the default); every migration, by
hand, in bulk or for maintenance, passes it to libvirt, and its log line
names it. libvirt applies it to the memory until the final switchover and to
each copied disk on its own; the help and README say so. A refused setting
is now named in the page's language.
A disk filling up inside a guest was seen only from the guest. The Guest Info
tab now lists, from the guest agent, each mounted file system with its type
and used / total size, a bar turning amber from 85 %. File systems the agent
gives no size of (pseudo ones, Windows' System Reserved) are left out; an
agent without the command still shows the rest of the tab.
On a backup target's pool every backup file was "Not used on this host" and
listed with the unused volumes, though its deletion there is refused: it is
deleted with its backup. The column now says "Backup of <VM>" and counts it
as in use. A VM kept on the Removed VMs page for its schedules or backups
alone showed no owner and no reason; its row now names its schedules and
counts its backups.
A volume left behind (a disk kept when its VM was deleted, an old image) was
not told apart from one a VM needs until its deletion was refused. The pool
page now has a "Used by" column: the VMs of this host whose disks, UEFI
variables, saved state or snapshots are the volume or are built on it, "In
use" for one only another volume is built on, else "Not used on this host";
buttons list each kind, and a VM's name finds its volumes. Its deletion still
asks the other hosts, as one sharing the storage may use it. When the host's
VMs cannot be read the page lists the volumes without the column.
The scan that refuses deleting a used volume now also counts a VM's UEFI
variables file and a snapshot's block device, and reads each VM once.
A VM that vanished from its compute, or whose compute was deleted and added
again, came back with its owners and tags only: it was no longer protected,
its schedules no longer backed it up, and its backups stayed unlinked, so its
Backups tab no longer listed them and retention left them for good. The
Removed VMs record now keeps its protection, its schedules and its own
backups (not those of a copy under the same UUID), and gives them back.
Turning protection on or off waits for the ownership step, so a VM dropped
from its host's list meanwhile is not told protected.
Above the hosts, linked to where each is handled: hosts not answering,
pools filled to 85% (as last measured), VMs with snapshots older than 30
days, backup jobs failed and backups a schedule did not take in the last 7
days (per schedule; not for a host in maintenance), backups missing or
damaged (a new Damaged filter on the Backups page), and jobs that ended
uncertain or wait for over an hour. Nothing to look at: no box. The pools
and snapshots are read on threads of their own, waited for 2 seconds at
most: one slow host leaves out its lines, not the page.
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.
A superuser turns a VM's protection on or off on its Settings tab, not while
a job holds the VM (a deletion or a restore over it that runs would not
stop). While it is on, its deletion (page, API, a queued job at its start)
and a restore of a backup over it are refused; the Destroy tab, the destroy
page and the restore page say so. A VM moved outside the panel keeps it.
The API shows the flag read-only.
A verification of a chain's base refused a verification of its incremental
with "Verify backup is running on this resource": which backup held it was
not said. The job's resource label now follows its name for who may see
the job, as on the Jobs page; not in an audit row or a bulk migration's
error, which others read.
The backups API had every backup action but Verify, and did not show a
backup's verified_at and damage: a script restoring through it got no sign
of a damaged chain. Docker's health check asked for the login page, so a
hung job worker left the container healthy; it now reads /healthz.
Verifying an incremental backup put what it found only on that backup: a
base whose file was changed or missing stayed unmarked, so restoring it
gave no warning and no badge showed it. Each backup of the chain is now
verified with it and holds the damage of its files and of those it builds
on. Verifications of backups of one chain run one at a time, so an older
read never writes over a newer finding; the rows and the job's own result
are written together, and recovery reads that result, also when a cancel
came after the reads.
A job whose recovery found the error it had raised stored it twice (the
verify job's damage, in its page and its alert).
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.
A failed backup, a scheduled backup not taken, backups the daily check
finds missing and a job that ends uncertain could only be seen on the
pages. They are now queued as alerts in the transaction of the change
they tell of (never stopping it) and sent by the worker's periodic pass
to the Settings page's alert e-mail addresses (the server's SMTP
settings) and alert webhook (a JSON POST), each tried again for ten
passes on its own. A skip for a host in maintenance is no alert.
Setting values take 255 characters. /healthz answers 200 while the
database answers and the job worker runs, 503 otherwise, without a
login.
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.
QEMU sends a migrating VM's memory and copied disks in the clear. A
compute gets "Encrypt migrations (TLS)" (edit page, Advanced; API
field migration_tls); a migration between two hosts that both have it
passes VIR_MIGRATE_TLS whenever data moves (not for a shut-off VM's
definition alone), and the log says TLS. The hosts need QEMU's
certificates in /etc/pki/qemu; a host without them refuses before
anything moves. Tried on two AlmaLinux 10 hosts: the TLS stream starts
with a TLS record, the plain one with QEMU's QEVM header.
The schedule took a compute's VMs from the database, which learns of a
VM made with virsh only when a page reads the host. When its time comes,
the compute's own schedule task reads the host first, once a day per
compute and day; the new VM is backed up a pass later.
refresh_instance_database now says whether it synchronized: a host that
did not answer, was busy or failed is read again at the next pass, and
the known VMs are backed up meanwhile. A host in maintenance is not read.
The user list counts API tokens, and a query with a count has no order
of its own: PostgreSQL lists the users in any order. A user's page
listed the VMs and the SSH keys as stored, so did the profile and the
VM page's key choice.
The list counts each tag's VMs and hosts; a query with a count leaves
the model's ordering out, so the tags came in the order they were made.
With dozens of tags the page also gets the search box the other
administration lists have.
With dozens of tags the pills took rows of the list's top (six rows for
forty tags, the table below a phone's screen). The pills are now by how many
rows have the tag, the eight most used shown and the others behind "… More
tags N", which shows them as a row's "…" does; its count follows the
search and the state, and it hides when none is left behind it. A pill
behind it chosen (remembered, or by a row's badge) shows them.
A tag pill's count was the page's; the state pills' follow the search and
the tag. Now a tag pill counts the rows with its tag the search and the
state find, and one with none is hidden unless chosen, as a state pill.
- A name typed or pasted into the tag box that cannot be a tag shows the
rule (letters a-z, digits, dots, dashes, underscores; at most 12
characters) instead of nothing; the spaces a paste brings are dropped;
"constructor" is no longer taken for a tag there is.
- "Clear the filters" hides with the message it is in: the search box takes
the focus.
- A new or renamed tag has at most 12 characters (computes.models.TAG_LENGTH,
a validator: the column keeps 32, so names made before the limit stay
usable until renamed and the migration changes no SQL); the tag box
offers no longer name.
- The tags "…" shows in a table's cell go below the others within the
cell's width as it is, so the list's columns no longer move.
The tag filter was a select beside the search box. It is now a row of
pills as the VM states' are, below them on the VM list and above the table
on the hosts list: All tags, No tag and each tag with how many have it.
The state and tag pills share one helper in table_filter.js; a badge
chooses its tag's pill, the choice is remembered as before.
The host's VM list showed every tag of a VM, widening its Name column as
the VM list did before; it now shows three and the others behind "…".
There its tags are not buttons: the tags "…" shows take the focus, so a
keyboard user is not sent back to the top of the page.
- A tags form carries the names it showed (show_hidden_initial): sent back
unchanged, the VM's or host's tags are left as they are, so a form shown
before a tag was renamed or deleted does not bring the old name back.
- A rename whose tag is deleted while it waits answers 404, not 500.
- A removed VM kept only for a deleted tag leaves the Removed VMs page.
- A kept tag filter the list no longer offers is forgotten, so a name made
again later is not chosen by itself.
- A host's form saves the host and its tags in one transaction under the
ownership lock: a tag the Tags page deletes meanwhile is made again,
instead of a 500 after the host's other changes were saved.
- The hosts list shows three tags and "…" for the others, as the VM list.
- "…" shows the other tags on any page, the tag filter or not.
Tag badges are smaller than other badges everywhere, and the VM list
shows a VM's first three tags and "…" for the others: it names them in
its tooltip and shows them when pressed, by mouse or keyboard. A VM with
many tags no longer widens the name column and the table with it; the
tag list still filters by any of them.
- Saving a VM's tags unchanged writes no audit row.
- The VM report has a Tags column.
- A host's VM list and a user's VMs (account page) show the VMs' tags.
- The hosts list says "No host matches the filters." with Clear the
filters, as the VM list does; the tag list keeps to a phone's width
with a long tag.
- A removed VM's delete page says its owners and tags no longer come
back; the VM history rows say "owners and tags kept/restored".
- The API's ?tag= is trimmed; Tom Select's "Add tag" line shows the name
in lower case as it is made; Bulk Migrate's tag list goes back to its
title after a choice, so the same tag can be chosen again.
- A VM's tags set while its host's list drops it: the VM is checked
again under the ownership lock and the page says it was moved, instead
of a 500 or a success that kept the old tags in its removed record.
- A tag deleted right after another rename cleans the removed VMs' kept
name it has now; a delete sent while a backup schedule uses the tag
(saved after the page was shown) is refused with the schedules' names.
- A rename to a name another tag took meanwhile is a form error, not a
500; "There is a tag with this name already" is translated.
- Tom Select makes a typed name lower case and offers no new tag for one
that is there in another case; the API's ?tag= is lower-cased too.