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

2339 commits

Author SHA1 Message Date
catborise
070a4b99da feat(computes): Balance and the spread count each host's share of its size
Balance evened out the memory, then the vCPUs, the hosts give their running
VMs, and the Bulk Migrate spread sent a VM to the host with the least
memory: a host twice as large got the same as a small one. Both now count
each host's load against its memory and CPUs: propose lowers the sum of
each host's load squared over its size, least when every host has the same
share; spread sends a VM to the host with the least share after it. With
hosts of one size the proposal is the same as before.

The Balance page shows each host's memory, its CPUs next to the vCPUs, and
the bars as the share of the host's own memory.
2026-11-16 13:41:17 +03:00
catborise
ea20f12bc8 feat(computes): Bulk Migrate spreads a host's VMs over the others; host checks asked once
Bulk Migrate sent every chosen VM to one destination, without looking at
its memory. With several other hosts it now spreads them by default
(computes.balance.spread): the largest VMs first, each to the host that
has the least memory, then vCPUs, with it; a VM that holds its memory
(running or paused) only where it fits the memory the host's running and
paused VMs leave. The page shows where
each VM goes and makes the spread again when a VM is ticked or unticked;
a VM no host has room for says so. One destination stays a choice. The
host.bulk_migrate job takes a destination per VM ("moves").

The Balance and Bulk Migrate pages asked, for every VM and destination,
the host's identity and whether both hosts share each disk directory,
which writes a marker file on the shared storage: about 86 ms a pair,
sequential, so minutes with a few hundred VMs on ten hosts. A Reach
(computes/reach.py) asks each host pair and each directory once and
reads a VM's definitions once. vrtManager: wvmInstances.shares and
file_disks, also used by disk_plan.

read_fleet reads the hosts, their VMs and loads for both pages.
2026-11-16 10:29:07 +03:00
catborise
cf288a54cf fix(computes): the Bulk Migrate page keeps its list and button together
The page showed memory as MiB counts ("16768 MiB"), the destination and
the shut-off switch apart from the list, and a Migrate button below the
whole list that did not say how many VMs it would migrate. Now the list
is one card: "host -> destination" (a choice when there are several) and
the shut-off switch in its header, sizes as on the Computes and Balance
pages, and a footer that stays in sight below a long list with the
number at once and a "Migrate the chosen VMs" button that counts the
ticked VMs and is off while none is.
2026-11-16 09:20:16 +03:00
catborise
54487052e5 fix(computes): Balance moves small VMs rather than a large one for the same balance
The proposal took, step by step, the move that most lowered the sums of
squared loads, so a large VM went first. On a host with an 8 GiB VM and
two small ones it moved the large VM away and a small one back, where
moving the two small VMs evens the hosts out as well.

The proposal is now made twice: once taking the move that lowers the
sums most, once the move that lowers them most for the memory it moves.
The one that evens the hosts out more is taken, and of two that do it as
well, the one that moves less memory.
2026-11-16 09:02:30 +03:00
catborise
1259c11591 fix(computes): the Balance page shows each host's load as bars
The page was a bare table of rounded GiB totals, a footnote shown also
when nothing would move, three tables with their own columns and a
Migrate button far below the list. Now:

- a breadcrumb back to Computes and a one-line description;
- a card per host with its running VMs' memory and vCPUs now and after,
  as bars on one scale, so the imbalance and its fix show at a glance;
- the proposed migrations in one card, "host -> destination" in one
  column, sizes as on the Computes page, and the number at once with a
  "Migrate N VMs" button in its footer;
- the VMs that stay (kept by the user, or unable to move) in one table
  with the reason;
- a success message when the hosts are balanced.

The VM boxes join the proposal's form by their form attribute, so the
migrations' form holds the list.
2026-11-16 08:11:47 +03:00
catborise
4941a8a048 feat(computes): Balance proposes migrations that even out the hosts
A Balance button on the Computes page opens computes/balance/: the memory
and vCPUs each host gives its running VMs, before and after, and the
proposed migrations. The proposal (computes/balance.py) takes, step by
step, the one move that most lowers the sum of the squared memory loads,
then of the squared vCPU loads, and stops when none does; each VM moves
once, and the VMs moved to a host fit in the memory its running and
paused VMs leave without counting those moved away, so the moves may
run in any order. Only running VMs count and
move; one that cannot move (no destination shares its disks) still
counts on its host and is listed with the reason. Unticking a VM keeps
it where it is and makes the proposal again.

Migrate runs the moves shown in one host.balance job. It shares the bulk
migration's loop (computes.jobs.Migrations): migrate jobs, the chosen
number at once, one bulk job at a time. Its migrations take only a
running VM (moveto running_only): one stopped since stays where it is.

A job another one started now shows only on its own page: a host's page
no longer lists a bulk migration's or a balance's migrations, and the
Computes page shows the bulk jobs.
2026-11-16 07:37:10 +03:00
catborise
027896c3d4 fix(computes): a failed bulk migration does not also say it was stopped
The worker hands a failed job that made changes to recovery, whose
outcome joins the job's error. The bulk migration's recovery said "the
bulk migration stopped ... the other VMs stay" after its own "These VMs
did not migrate", as if the worker had left it. A job that ends itself
now records so, and recovery then adds nothing; it still says so for a
job the worker left.
2026-11-15 20:15:54 +03:00
catborise
25e3794cc9 fix(computes): a bulk migration shows as one job on the host's page
The host's VM list showed every migration of a bulk migration as a job
of its own (each holds the host), and kept a card for each when it
ended: 20 VMs, 20 cards down the page. The migrations a bulk migration
starts now name it as their parent, and a page leaves out a job whose
parent is that page's own: the host page shows the bulk migration, with
how many of its VMs are done as its progress; each migration still
shows on its VM's page and the Jobs page. A page also shows the jobs it
is the page of, not only those holding it: the bulk migration holds no
claim on the host.
2026-11-15 20:00:41 +03:00
catborise
60c581e5e1 fix(computes): Bulk Migrate replaces Evacuate, and its list has Select all
The owner found "Evacuate" ("Boşalt") a poor name: the button, page and
job are now Bulk Migrate ("Toplu Taşı"), as Proxmox calls it, and so
are the URL, view, template, script, job kind and claim. The VM list
gets a Select all box in its header, which ticks every VM that can
migrate. The unclear Check button goes: another destination reloads the
list itself, and a host with one destination names it instead of
offering a choice.
2026-11-15 19:43:51 +03:00
catborise
d20254f757 feat(computes): a host evacuates its chosen VMs to another host
The host's Instances page gets an Evacuate button. Its page lists the
host's VMs for a chosen destination: running ones ticked, shut-off ones
left to choose ("Also migrate the shut-off VMs"), and a VM with a disk
file the two hosts do not share refused with the reason, since it needs
a copy chosen on its own Migrate tab.

One "Evacuate host" job migrates them: a migrate job each (live with
auto converge; a shut-off VM offline), at most the chosen number at
once, so a VM that fails stays on the host and the rest go on. The
choice goes up to half the worker's slots, which a host's jobs may take,
less the evacuation's own. Cancelling it cancels the migrations that
run and starts no more. One evacuation runs at a time: it waits in a
worker slot, and several could leave none for their migrations. A VM
that left the host meanwhile is skipped (a migrate job takes the host it
is to leave from the evacuation and refuses another); a host whose record points
elsewhere since, or a worker lowered to one slot, stops it before the
next VM. A busy VM lets the others go first; one an uncertain job holds is
not waited for.

Migrations now hold the hosts' VM sets shared, so several migrate at
once; creates, clones, deletes and the VM list reconcile still wait for
them. A destination gone since the form was shown is refused, not
replaced by another. The uses of the NVRAM directory's pool take turns
(NVRAM_LOCK): two UEFI migrations at once would share a transient pool
that the first destroys under the second.
2026-11-15 18:04:00 +03:00
catborise
c9fef349d5 feat(storages): a volume downloads from its pool page
The volume menu of a pool page gets Download: the host reads the volume
with libvirt's download stream and the panel passes it on in chunks, so
a disk image never sits in the panel's memory. The file is the volume as
stored: a qcow2 volume comes as its qcow2 file. A volume a running VM
uses is refused, as for a copy; the refusal is a message on the pool
page. Each download is a row in the audit log.

gunicorn's worker exits when a request runs past its timeout (600 s), to
end requests stuck on a host. A download of a large disk runs longer, so
each chunk sent starts the request's timeout again: a download that stops
sending is still ended. nginx passes the chunks on as they come
(X-Accel-Buffering: no) instead of spooling them to a file.
2026-11-15 00:31:42 +03:00
catborise
44b6e42f8f fix(storages): a device that holds data says how to erase it
libvirt refuses to build an LVM pool on a device that has a partition
table, a file system or another volume group, with "forced overwrite is
necessary", which the panel cannot do. The refusal now names the device
and the host command that erases it, wipefs -a, after checking that it
is the right device.

The panel does not overwrite the device itself: with an overwrite,
libvirt clears the partition table before it tries the volume group,
even on a disk whose partitions are mounted, so a mistyped device would
lose its partition table.
2026-11-14 23:21:52 +03:00
catborise
690275adb7 refactor(vrtManager): a shut-off VM clone copies its disks with clone_volume
clone_instance built its own volume XML for file disks and for RBD
images, and called clone_volume only for block disks. Each disk now goes
through wvmStorage.clone_volume, in the pool of its source volume.

clone_volume makes the volume under the exact name it is given and
returns its path; clone_name, as before, gives a dir pool's name its
suffix, and the template copy and the storage clone job use it. Metadata
preallocation is asked only for qcow2, the one format libvirt
preallocates. A raw file copy no longer gets qcow2's compat options, and
an RBD copy no longer passes the preallocation flag, which the RBD
backend refuses.
2026-11-14 19:43:11 +03:00
catborise
4aa78b6f1c fix(vrtManager): a copy into an LVM or RBD pool is raw and allocated whole
A new VM from a qcow2 template in an LVM pool failed: the copy asked for
qcow2 with qcow2's options, which libvirt refuses there ("compatibility
option only available with qcow2"). Made raw, it still failed: with no
allocation an LVM volume is a sparse snapshot, which qemu-img's copy
filled and the kernel invalidated (I/O error). A copy into a pool of no
files is now raw, as big as its source and allocated whole, as a new
empty volume there already is. Checked live: a qcow2 template copied
into an LVM pool.
2026-11-14 15:28:56 +03:00
catborise
dd258888d2 refactor(vrtManager): a new VM's copy of a template is made by clone_volume
clone_from_template wrote its own copy XML next to wvmStorage.clone_volume,
which the volume and VM clones use. clone_volume now takes the volume to
copy, of its pool or another, so the template's copy goes through it too;
it leaves metadata unallocated in a pool of no files, as the template copy
did. A qcow2 template's copy in a file pool is now named <vm>.qcow2, like
a new empty disk, not <vm>.img.
2026-11-14 15:23:26 +03:00
catborise
0d68888510 test(instances): live disk and NIC posts send what their forms send
Since ad9c3ad9 a disk's detach and delete forms post the disk's path, and
since b664e341 a NIC's form posts net-seen, its saved definition as the
page read it; a post without them is refused as made from a stale page.
Four live tests still posted the old fields, were refused and failed;
test_clone then failed too, on the extra disk the refused delete left.
They now post the same values as the forms.
2026-11-14 14:38:25 +03:00
catborise
ee662618b2 refactor(instances): the VM page and new VM steps name what their templates get
The VM page and the two new VM steps rendered locals(): every local of
the view reached the template, so which values a page uses could not be
read from the view, and a renamed variable left part of a page blank
without an error. Each view now passes a dict of the names its template
reads. The assignments that only existed for locals() (conn = None,
empty storage and network lists, meta_prealloc, unused defaults) are
gone. A new VM step whose host could not be read shows what it showed
before.
2026-11-14 14:14:23 +03:00
catborise
d68e22878a refactor(storages): the storage pages name what their templates get
The pool list and pool pages rendered locals(); they now pass a dict of
the names their templates read. A list whose host could not be read
keeps the new pool dialog, as before.
2026-11-14 13:36:06 +03:00
catborise
c64dd8fb3c refactor(networks): the network pages name what their templates get
The network list and network pages rendered locals(); they now pass a
dict of the names their templates read. A list whose host could not be
read keeps the new network dialog, as before.
2026-11-14 13:36:06 +03:00
catborise
e4c8e4e0eb refactor(interfaces): the interface pages name what their templates get
The interface list and interface pages rendered locals(); they now pass
a dict of the names their templates read. A page whose host could not be
read shows the host only, as before.
2026-11-14 13:36:06 +03:00
catborise
3c9b34ae48 refactor(datasource): user data names what its template gets
The cloud-init user data rendered locals(); it now passes the one value
its template reads, the VM's keys, as the job that writes a seed does.
2026-11-14 13:36:06 +03:00
catborise
3dbd4c0316 refactor(nwfilters): the filter page names what its template gets
The filter page rendered locals(): every local of the view reached the
template, so which values the page uses could not be read from the view,
and a renamed variable left the page blank without an error. The view
now passes a dict of the names the template reads; a filter that could
not be read shows the host only, as before.
2026-11-14 13:36:06 +03:00
catborise
d6df6b1df4 fix(instances): console changes that cannot be made are refused, not reported as done
A switch to the serial console removed the graphics device but kept a
serial console of another type, a TCP one say, which the browser does
not open; the audit log said the console type was set. The switch is now
refused, with nothing changed, unless the serial console is a pty one.

A listen address change of a console that listens on a network, a socket
or nowhere did nothing without a word. It is refused with the reason.

The .vv file pointed virt-viewer at "::" for a console on all IPv6
addresses; such a console is reached through the host, as one on
0.0.0.0.
2026-11-13 22:49:28 +03:00
catborise
88e7e0fa90 fix(instances): a console settings page opened before another change does not undo it
The console form compared what was posted with the settings saved at the
time of the save, so every field of a page opened earlier counted as a
change: an administrator who moved a console to localhost had it opened
to all interfaces again when another one, on an older page, only
generated a new password. The form now sends back a fingerprint of the
type, listen address and keymap it showed, and a save made after these
changed is refused with a message to check them and save again.

A refused save names the reasons without the field names.
2026-11-13 22:49:23 +03:00
catborise
7fe79463fc fix(instances): saving a SPICE console's settings keeps it SPICE
The console type list offers VNC and Serial only, so the page of a SPICE
VM showed VNC and any save, of the keymap alone, switched the console:
libvirt refused the definition when the VM had a SPICE channel, and
without one the VM silently got a new VNC console. A console type the
panel does not create is now offered as it is, and kept on save.

A switch from SPICE that is chosen removes the SPICE channels, USB
redirection and smartcards libvirt refuses without SPICE graphics and
mutes SPICE audio. A new VNC console keeps the keymap and a password VNC
can take; a longer one is replaced by a generated password.

The console settings were read from the first graphics device that had
each attribute: with VNC and SPICE devices the page showed VNC's port
with SPICE's password. All are read from the first device, the one the
settings change.
2026-11-13 22:49:21 +03:00
catborise
cd3edf4dff fix(instances): a VNC password the browser console can send, kept as set
The console settings accepted any password of at most 8 bytes, so "éééé"
was saved, but noVNC derives its key from the characters while QEMU
compares the UTF-8 bytes: the browser console could not log in. A new
password now takes up to 8 printable ASCII characters, which also keeps
control characters out of the definition.

The .vv file wrote the password and the VM name as they are; virt-viewer
reads it as a GLib key file, so a backslash or a leading space changed
the password. Both are escaped as a key file expects.

A new or removed password also drops a passwdValidTo set elsewhere: an
expired one left the new password unusable.
2026-11-13 22:49:12 +03:00
catborise
275bf11aed fix(computes): a chart places each reading at the time it came
The CPU, memory, disk and network charts of a host and of a VM put their
readings at equal steps: a reading that took 20 s looked like one 5 s
after the one before. The x axis now counts seconds, a reading standing
at the time it came; each tick is at a reading and named with the
panel's time of it, as before. Checked with Chart.js in a browser: a
20 s step is four times as wide as a 5 s one.
2026-11-13 16:38:42 +03:00
catborise
be4616ee85 fix(computes): a VM that cannot be read leaves a host's capacity unknown
A host's capacity sums its VMs' vCPUs and memory; a VM busy with a job
is read from its XML. A VM whose XML could not be read for any reason
was skipped as if gone, so a refused read or a dropped connection made
the host look as if it had given less than it had, even nothing. Only a
VM gone meanwhile is skipped now; another error leaves the capacity
unknown, which the pages show as not read.
2026-11-13 16:38:42 +03:00
catborise
81d183f802 fix(computes): a host's CPU chart counts I/O wait as idle, and its memory in GiB
The CPU in use was the share of time not idle, with I/O wait counted as
busy: a host that only waited for its disks showed 100% CPU in use. Time
waiting for I/O is idle now: no CPU runs then.

The memory chart divided by 1024³ and labelled the values GB; it says
GiB now.
2026-11-13 16:38:42 +03:00
catborise
1f6cc15ddf fix(computes): hosts that do not answer no longer keep the Computes page from the others
The Computes page read its hosts on a pool of eight threads shared by
the process: eight hosts that hang held all of them for as long as they
hung, and every other host was then shown not connected. Each host is
now read on a thread of its own (a daemon thread, which does not keep
the process from exiting), one at a time per host as before. The UUID
of a host added before host UUIDs were kept is read on that thread too,
within the page's wait, instead of after it.

A host's charts asked for each reading without a time limit: a reading
the host kept waiting left the charts saying "Updated" and stopped the
polling. A reading now ends after 30 s; the charts then say since when
they are not updated, and the next reading goes out.
2026-11-13 16:38:42 +03:00
catborise
a998e68757 fix(instances): one guest's bad address no longer ends a search or the VM report
The IP search and the VM report parse each address a guest agent
reports. An agent answer that was no address ("invalid-address") raised
a ValueError that only libvirt errors were caught around: the search or
the report ended in a 500 and lost every other guest's addresses. Such
an answer is now skipped, and the guest's other addresses still count.

The VM report was in English in every language but for the VM states:
its headings, sheet names, coverage notes and yes/no now follow the
reader's language.
2026-11-13 16:07:12 +03:00
catborise
3dfdd529b2 fix(instances): the REST API's list of all VMs reads the hosts first
/api/v1/instances/ listed the panel's VM records without asking the
hosts: a VM undefined or renamed with virsh stayed there as it was, and
one defined outside never appeared, until someone opened a web VM list
(the per-host API list already read its host). It now reads the hosts
it lists first, as the VM list does: all at once, one that does not
answer left as last read. Seen live: a VM defined with virsh appears,
and is gone once undefined.
2026-11-13 16:07:01 +03:00
catborise
cdc7468af3 fix(instances): the VM list keeps its state filter and finds names in any case
The VM list reloads when its poll finds a VM added or gone. The search
was kept through the reload, but the chosen state pill (Off, say) went
back to All: on a busy host the filter kept undoing itself. The state is
now remembered with the search, for the tab.

The search compared lower-cased text, which differs in Turkish:
"istanbul" did not find "İSTANBUL". Both sides are now compared without
case and accents (and dotless ı as i).
2026-11-13 16:07:01 +03:00
catborise
cf1f7ad055 fix(instances): a host that does not answer no longer holds the VM lists
The VM list and its poll read each host in turn. A host that is up but
stuck (a daemon or an NFS mount that does not answer) kept the call
waiting: the list did not open in 200 s (seen live with compute1's
virtqemud stopped), and the per-host limit freed it only when gunicorn
ended the request after 600 s. The list and the poll now ask all hosts
at once, each in a thread counted on its host like a request, and wait
10 s at most: a host that has not answered is shown as not answering,
and the VMs of the others are listed. Live: the list opens in 10 s,
then in 5 s while the host stays stuck.
2026-11-13 16:07:01 +03:00
catborise
b65d2abaf6 fix(admin): two administrators at once leave a superuser and one user per address
An administrator cannot block, delete or demote their own account, but
with two superusers each could block the other at the same moment, and
none was left. Changes of the panel's users (create, edit, block,
unblock, delete, group edits, and a user's own profile) now run one at
a time, under a claim every worker sees, and a block, delete or edit
that would leave no active superuser is refused.

Under that claim each change reads the user or group as saved now: the
edit forms' fingerprint is compared there, a block writes only the
account's Active flag, and a profile saved while an administrator
blocks the account keeps the block.

A user's e-mail address is one user's, case aside, so that "Lost OTP?"
can mail it; two users created or edited at once each passed that check.
The form checks the address again under the same claim, with the save.
2026-11-13 14:54:51 +03:00
catborise
ab77b198f2 fix(admin): a user or group form opened before another change does not undo it
The user and group edit forms send back every field they show. A form
opened before another administrator blocked the user, took away a group
or a permission, or changed a group's members, put those back when it
was saved for another change. The forms now send a fingerprint of what
they showed, and a user or group changed meanwhile is shown again as it
is now, with nothing saved. The user's password and last login are no
change of the form.
2026-11-13 14:29:50 +03:00
catborise
35a5bbdb62 fix(accounts): owners given before one owner was the rule keep editable rights
With "Multiple Owner for VM" turned off after a VM was given two owners,
changing either owner's rights (Delete the VM, say) was refused: the
form's one-owner check counted the other owner. The check now applies to
a new owner only, as its message says.

The user and group forms showed the permissions by the English names the
database keeps (Can clone instances, ...), in every language; they are
named in the user's language now.
2026-11-13 14:27:32 +03:00
catborise
dde7672375 fix(admin): a new user is not given a VM that has its one owner
NEW_USER_DEFAULT_INSTANCES gives each new user the VMs it names. With
"Multiple Owner for VM" off, an owned VM named there was given the new
user as a second owner anyway, with its power and console. Creating the
user is now refused, as adding a second owner on the VM's Users tab is;
the check runs again with the inserts, under the ownership lock.
2026-11-13 14:26:24 +03:00
catborise
8263680c48 fix(appsettings): a number an older version saved no longer breaks its page
The Settings page refuses a whole-number setting outside its range, but
a value an older version saved stays: LOGS_PER_PAGE "abc" made the Logs
page fail with a 500 (seen live). Migration 0026 puts every
whole-number setting outside its range, or not a number, back to its
default.

With VM DRBD Status on, the VM list showed each VM's state as its VM
page last read it, and "None" for a VM never opened. The list now reads
each SSH host's drbdadm status once, all hosts at once, and updates its
VMs from it: a host that does not answer delays the list by one
timeout, not one per host.
2026-11-13 13:58:57 +03:00
catborise
f47b79b0ed fix(appsettings): the console and NIC settings say what they do
The four console settings (scale, view-only, resize session, clip
viewport) said "The console starts ...", but they set how a VNC console
starts; a serial console has none of them, and typed into a view-only
one. The NIC model setting said "default" was libvirt's choice, while
a new VM with "default" gets a VirtIO card. Their descriptions now say
so (migration 0025).
2026-11-13 13:58:46 +03:00
catborise
5a52bcf43e fix(instances): a new VM's disk cache goes with the disk I/O of Settings
Settings refuse disk I/O native with a cache other than none or
directsync, which libvirt refuses. A new VM took the I/O from Settings
and its cache from the create form, unchecked: native I/O with a
writeback cache was queued, the disks were made, and libvirt then
refused the VM. The create job now refuses such a pair when it is asked
for, and again when it runs, before it makes a disk: Settings may have
changed meanwhile.

Two administrators saving the I/O and the cache at once each checked
the pair as their page read it, and both saves made one libvirt refuses.
The pair is now checked again as saved, with its rows locked, when a
change of it is saved; the log row keeps the reason in English.
2026-11-13 13:58:46 +03:00
catborise
7bbc951082 fix(instances): a clone's NIC filter keeps no address of its source's
A NIC filter such as clean-traffic can name the VM's own MAC and IP as
parameters. A clone kept the source's, so the filter dropped the clone's
traffic from its new MAC. A clone's MAC parameter is now its own MAC,
and its IP parameter is left out for the filter to learn the clone's
address, as clean-traffic does by default; with learning turned off
(CTRL_IP_LEARNING none) the filter needs it, and it stays, as an IPV6
parameter does (libvirt learns no IPv6 address).

A filter page showed the actions drop, reject, return and continue in
English in every language; they are translated now.
2026-11-13 11:46:12 +03:00
catborise
b1c6184931 fix(instances): a VM is not migrated to a host whose filters of its names differ
A migration checked only that the destination had network filters of
the names the VM's NICs use. A VM runs with its host's filter of a name,
whatever its rules: a destination whose filter of that name was empty,
or lacked a filter it references, left the VM unfiltered there. The
filters the VM names and those they reference are now compared rule by
rule (each host's UUID aside), and one missing or different on the
destination refuses the migration.

A filter created or edited with a reference to a filter the host does
not have, which libvirt accepts, is refused too: a VM using it would not
start.
2026-11-13 11:46:01 +03:00
catborise
b664e34161 fix(nwfilters): two changes at once do not undo each other
A rule or reference change reads a filter and defines it again whole:
two admins changing one filter at once each defined their copy, and the
second removed the first's rule. Changes to a host's filters (create,
clone, delete, rules, references, XML) now run one at a time; one that
finds another running is told to try again.

A VM's NIC form sends back its source, model, filter and MAC whole: a
form opened before another admin changed the NIC's filter put the old
filter back. The form now sends a fingerprint of the NIC as it showed
it, and a NIC changed meanwhile is refused.
2026-11-13 11:46:01 +03:00
catborise
2f7516b7f9 fix(nwfilters): a filter is checked against libvirt's schema before it is defined
libvirt drops the attributes and elements of a filter it does not know,
without an error. A rule accepting <tcp dstport='443'/> (dstportstart is
the attribute) became a rule accepting all TCP; a rule dropping
<tpc dstportstart='22'/> became one dropping all incoming traffic; a
priority of 5000 became 500 (all seen live). Creating, cloning and
editing a filter and adding or removing its rules and references now
define it with VIR_NWFILTER_DEFINE_VALIDATE, and libvirt's refusal names
what it did not accept.
2026-11-13 11:20:47 +03:00
catborise
143a74b145 fix(storages): a volume another compute's VM uses on shared storage is not deleted
A pool on shared storage (an NFS share, or a directory mounted from one)
holds the same file at the same path on every host that mounts it. A
VM's delete checks the panel's other computes before it deletes its disk
files, but the pool page, its API and a VM's disk delete checked only
their own host: a disk of a VM on another compute could be deleted. They
now ask the other computes too, and refuse while one uses the file or
cannot be reached. The other computes are asked before this host's lock
is taken, and before a VM's disk is detached.
2026-11-13 10:41:18 +03:00
catborise
fb3b2f479e fix(storages): a share or LVM pool a VM's disk path is in is not deleted
Deleting a pool was refused only while a VM's definition named the pool
for a disk; a disk given by its file path was taken not to need it. That
holds for a directory pool, but a share's or a file system's pool mounts
the path and an LVM pool activates it: with the pool deleted, the path is
gone at the next boot and the VM no longer starts (seen live with an NFS
pool). Such a disk now refuses the delete too: a path under the pool's
mount point, or an LVM volume by its /dev/<group> or /dev/mapper name.
iSCSI and disk pools share their device directories with other pools and
are left as they were.

A pool libvirt reports as inaccessible (state 4: running, its storage out
of reach) made the pool page fail with an IndexError; it now shows an
Inaccessible badge.
2026-11-13 10:41:03 +03:00
catborise
044945bd97 fix(storages): a pool is not made of a system directory or of another pool's
The new pool dialog took /, /etc, /var/lib/dpkg or /home as a directory
pool's path, or as a share's mount point, and a path inside or around
another pool's. A pool on /etc offers the host's own files as volumes,
which one Delete removes; a share mounted there hides them; and a file
under two pools is listed, and deleted, through both. These paths are
now refused: the system directories (/var only within /var/lib/libvirt,
outside libvirt's own state), /home, /mnt, /media, /opt and /srv
themselves (a directory in them is fine), and a path is compared once
"..", doubled and trailing slashes are resolved. A symbolic link on the
host is not resolved.
2026-11-13 10:41:03 +03:00
catborise
2c7d7e9c3b fix(instances): a clone's recovery tells how to thaw a guest paused meanwhile
A live clone freezes the guest's file systems through its agent. When
the worker stopped before the thaw and the VM was paused before the job
was recovered, recovery skipped the thaw without a word: resumed, the
guest stayed frozen. libvirt thaws no paused guest, so the job's warning
now says to resume the VM, then thaw it with virsh domfsthaw.
2026-11-13 08:44:05 +03:00
catborise
272a40f4e1 fix(instances): power off does not wait a minute for a guest agent that hangs
libvirt shuts a VM down through its guest agent when one is connected,
and waits 60 s for an agent that hangs before it presses the ACPI power
button. The Power Off request hung for that minute, holding the VM's
lock. A running VM's connected agent is now pinged first; one that does
not answer in 10 s is passed over and the power button is pressed.
2026-11-13 08:44:03 +03:00