1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 08:56:07 +00:00
Commit graph

260 commits

Author SHA1 Message Date
catborise
84d633af08 fix: a downloading volume is not put in a new VM or a CD-ROM; slow downloads read as bytes come
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).
2026-11-20 16:59:01 +03:00
catborise
e802fa07e2 feat(instances): snapshot the VMs chosen on the VM list
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.
2026-11-20 14:24:46 +03:00
catborise
640511cfd4 feat(computes): the Computes page tells what a host lacks for another host's VMs
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).
2026-11-20 13:00:15 +03:00
catborise
b36f674542 fix: power jobs name their action, refuse what does not apply and recover by the VM's state
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.
2026-11-20 12:10:06 +03:00
catborise
2b60b79a5f feat(instances): a superuser limits a disk's I/O
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.
2026-11-20 11:10:55 +03:00
catborise
79f3b906dd fix(instances): Guest Info fits the tab, reads odd agent answers and says when usage is unknown
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.
2026-11-20 10:28:35 +03:00
catborise
3da55342da feat(migrations): a migration's bandwidth can be capped
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.
2026-11-20 09:44:17 +03:00
catborise
46931bdbdb feat(instances): the Guest Info tab shows how full the guest's file systems are
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.
2026-11-20 09:30:15 +03:00
catborise
eeae606d08 feat(migration): encrypt migrations over TLS between hosts that have it
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.
2026-11-19 15:45:32 +03:00
catborise
72e270a87e feat(vmbackups): incremental scheduled backups of running VMs
A schedule with 'a full backup every N backups' above one makes a
checkpoint with each running VM's backup. The next builds on the
schedule's newest ready backup: the changed blocks are pushed into qcow2
volumes made with the base's file as backing file, by its name, as the
target pool's directory differs per host. The base is used only when its
chain is shorter than N, its disks are the VM's, every file of the chain
is in the target, and its checkpoint has a sized bitmap for every disk;
otherwise the backup is full and starts a chain.

Before each scheduled backup of a running VM, the VM's backup
checkpoints are pruned to each schedule's newest base. A checkpoint
libvirt no longer lists, as after a migration, is redefined first so
that its bitmap goes too.

A shut-off VM's backup checkpoints are forgotten before its external
snapshot: libvirt 11.10 makes no offline external snapshot while a
checkpoint exists. The next scheduled backup is then full.
2026-11-17 17:12:05 +03:00
catborise
5f7555f348 fix(instances): a VM with backup checkpoints is deleted and moved offline
libvirt refuses to undefine a domain that has checkpoints unless asked to
drop their metadata. The VM delete job and the shut-off migration's
removal of the source definition now pass CHECKPOINTS_METADATA; a backup
chain ends with them, and the next backup is full.
2026-11-17 16:55:26 +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
f4559acbc7 feat(vmbackups): back up a running or shut-off VM into a target
A superuser backs a VM up from its new Backups tab, or with POST
/api/v1/backups/ (202 with the job); GET lists and reads backups. The
backup.create job holds the VM, its compute (shared) and the target, so
migrations, snapshots and power changes of the VM wait meanwhile.

- A shut-off VM's disks are copied one at a time into the target pool,
  flat, in their format (createXMLFrom); a cancel stops before the next.
- A running or paused VM's disks go by libvirt's push backup into
  volumes made first, as the live clone: the file systems frozen for its
  start when the guest agent answers (frozen), crash-consistent
  otherwise, or refused when frozen file systems are required. A guest
  that shuts down meanwhile does not end the backup.
- A running VM's NVRAM file is kept only when it reads the same after
  the copy as before it (three reads), so it is the capture point's.
- Then the NVRAM file, the definition and the manifest (written last)
  are uploaded and read back, and the row becomes ready with its files.
- Recovery thaws a frozen guest first, watches a push backup still
  running, finishes a copied backup, removes the files of a failed or
  cancelled one, and leaves a copy whose end libvirt cannot tell
  uncertain with its files named. The target pool is checked by UUID and
  its free space before anything is made.
2026-11-17 09:13:59 +03:00
catborise
89835f2b06 feat(vmbackups): what a VM's backup holds and the target files
wvmBackup.backup_plan reads a VM's persistent definition and says what a
backup copies: each file disk (qcow2 or raw) with its pool and virtual
size, the NVRAM file, and what is left out (CD-ROMs, floppies). It
refuses, naming the reason, what a backup could not restore as it is:
encrypted, block, network, volume, directory and shareable disks, other
disk formats, a disk in no storage pool, shared host directories, a
kernel file boot, host devices, a saved state, TPM state (a later
layer), an NVRAM file outside libvirt's directory, and a running VM
whose disks change at its next start.

The target side: the files' names from the backup's UUID only, the free
space check (virtual size plus the snapshots' margin), small files
written and read back with their SHA-256, read, removed and the
manifests listed. download_volume is taken out of copy_nvram for both.
Every user of the NVRAM pool runs in the worker, so its process lock
holds.

A push backup target of a raw disk (live backup or live clone) is made
without qcow2's compat and features, which libvirt refuses for raw.
2026-11-17 08:40:06 +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
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
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
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
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
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
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
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
catborise
3412c63417 fix(instances): a Windows VM's root password and SSH key are refused in words
On a running Windows VM with its guest agent connected, the Access tab's
root password and SSH key were sent to the agent, which has no root
account, takes no crypt(3) hash and has no SSH key command: the owner got
the agent's raw error. The guest's OS is now asked first, and a Windows
guest is refused with a message.
2026-11-13 08:43:50 +03:00
catborise
edc165cfc4 fix(instances): a VM is not migrated to a host without its secrets
A shut-off VM whose disk, host device or vTPM names a secret was moved
to a host that does not have that secret: libvirt defines the VM there,
the source definition was removed, and the VM then did not start. A
migration now names the secrets the destination lacks, by UUID or by
usage, and is refused before anything changes, as it is for networks.
2026-11-12 16:17:21 +03:00
catborise
3308a75557 fix(instances): a VM's network cards name networks and filters its host has
libvirt saves a network card whose network or filter the host does not
have, and the VM then does not start: a card added or changed with an
unknown network (net:missing) or filter was saved and the page said the
card was changed. Adding or changing a card now refuses a network or
filter the host does not have; a stopped network is still the host's.

A migration defines the VM on the destination the same way: a shut-off
VM moved to a host without one of its networks or filters stayed there
unable to start. The migration now refuses such a destination before
anything changes.
2026-11-12 13:25:30 +03:00
catborise
2db25314ea fix(instances): USB device changes as PCI ones; device refusals name no VM to owners
- A USB device added to or removed from a VM with a saved state applied
  only at the next cold boot: refused now, as for PCI devices, and the
  form says so.
- A USB hot plug or removal that failed half way said only libvirt's
  error: it now says where the device is, as for PCI devices
  (_hostdev_outcome, shared).
- A host device refusal (check_hostdevs) names the other VMs that have
  the device; users who do not see the hosts, such as an owner whose
  snapshot revert is refused, now read that a device is not free and that
  an administrator can see why.
- The host's USB devices named among a PCI device's host resources were
  English in every language.
2026-11-11 22:58:40 +03:00
catborise
a36ffcd3ba fix(instances): a VM starts only with host devices the host can give now
A device is checked when it is given to a VM, but a start later did not
check it again: a PCI device bound back to a host driver for the host's
own network or disks, or a USB device the host no longer has as named,
was taken from the host or failed in libvirt. Power On and Power Cycle now
check the definition the VM starts from (its saved state's when restored)
as a snapshot revert does, and refuse with the reasons; Power Cycle checks
before it stops the VM.
2026-11-11 22:58:34 +03:00
catborise
f0a9d2cf82 fix(vrtManager): a disk in an inactive pool keeps the files it may be made from
Only a running disk's definition has its backing chain; for the others the
in-use check reads it from the volumes of active pools. With such a disk's
overlay in an inactive pool (a stopped VM's, the next start's, a saved
state's or a snapshot's), its backing file counted as unused, so deleting
another VM with its disks, or the volume itself, could delete it. The check
now refuses (InUse) while a disk that is not running and not raw has its
file in an inactive pool, and says to start the pool. A snapshot delete
that is done reports no left-behind files then, rather than failing.
2026-11-11 15:21:49 +03:00
catborise
1957a5a85a fix(instances): memory, boot order and QoS edits check what they change first
Three edits went wrong on input or a state made outside the panel:

- A running VM's memory was set live, then for its next start. When the
  next start had a lower maximum (virsh --config), the live change was
  made and the second one failed. The maximum of the next start is now
  checked first.
- A boot order entry without its device type ("disk") raised an error
  page. It is now refused with a message.
- A QoS form of a NIC whose MAC changed since redefined the VM unchanged
  and said the QoS was set or deleted. It now says the NIC is not in the
  definition.

Turkish and Chinese texts included.
2026-11-11 12:55:34 +03:00
catborise
fce63996ba fix(instances): a refused vCPU resize keeps the VM's vCPU hotplug
With vCPU hotplug on, a resize defined the VM three times: without its
hotplug settings, with the new counts, with hotplug settings again. When
libvirt refused the new counts (a maximum over the machine type's limit),
the VM was left with hotplug switched off and an error.

The counts and the hotplug settings for them now go in one definition.
2026-11-11 12:55:34 +03:00
catborise
84866cdf0d fix: backups and snapshots keep their order when the clock goes back
Backup retention kept the last --keep backups by name, and a name is the
panel's local time. Where the clock goes back an hour in autumn
(TIME_ZONE=Europe/Berlin), a backup at 02:10 CET forty minutes after one
at 02:50 CEST sorted first, and --keep 1 deleted the new one. Retention
now keeps the newest by when they were made (the directory's mtime);
the names stay as they were.

Snapshot times from libvirt (epoch seconds) became naive local times,
which the snapshot list sorts newest first: in the same hour the older
snapshot came first. They are now aware UTC times; the page still shows
them in the panel's time zone.
2026-11-10 12:21:36 +03:00
catborise
24ed1c8065 test(snapshots): check the call that creates a snapshot, not a wrapper of it
_snapshotCreateXML only forwarded to the domain's snapshotCreateXML, and
every snapshot test replaced it with a mock: a wrapper that called nothing
passed all of them. The wrapper is gone and the tests assert on the
domain's call, which the code makes directly.
2026-11-08 20:50:05 +03:00
catborise
d19151b88e refactor(vrtManager): instance.py imports libvirt's names without a fallback
When the import of libvirt's names failed, the except branch imported
four of them and left the module to fail later on any other one with a
NameError. libvirt-python always has them; the import is a plain one.
2026-11-08 14:44:09 +03:00
catborise
021d75102e fix(vrtManager): an RBD disk takes its pool's auth and monitors as they are
A disk of an RBD pool, at VM creation or added later, had the pool's
user, secret uuid and monitors put into its XML as strings: a user with
a quote or ampersand broke the XML, and a secret named by usage gave
IndexError on attach and uuid='None' at creation. One function now
copies the pool's auth (uuid or usage) and host elements into the
disk's source with lxml, replacing the two string builders.
2026-11-08 14:42:20 +03:00
catborise
38b5306fee fix(vrtManager): an ISO put in a host CD-ROM drive is read
A CD-ROM of type block (a host drive) kept its type when an ISO was
inserted, and libvirt reads only source/@dev for that type, so the drive
stayed empty. Inserting an ISO now makes it a file drive.
2026-11-08 14:40:26 +03:00
catborise
d567bbf687 fix(vrtManager): a vCPU maximum the CPU topology does not make is refused first
A VM with a CPU topology takes only the maximum it makes; libvirt
refused another one after the vCPU hotplug list had been removed, so a
failed resize left hotplug off. The maximum is now checked against the
topology before anything changes, with tr and zh translations.
2026-11-08 14:40:06 +03:00
catborise
b90b632a09 fix(vrtManager): a NIC's edit keeps the parameters of its filter
Saving a NIC's settings replaced its filterref even when the filter
stayed the same, so its parameters were lost: clean-traffic with a
fixed IP went back to learning the address at the next start. The same
filter now keeps its element; another filter replaces it.
2026-11-08 14:38:53 +03:00
catborise
32e8ff3c11 fix(instances): recovery removes the UEFI variables copy of a clone that was not defined
A shut-off clone copies the VM's NVRAM file just before it defines the
clone; a worker that stopped between the two left the copy, unnamed by
the job, which recovery then reported as leaving nothing. The job
records the copy's path once libvirt made it, and recovery deletes that
file when the clone was not defined, in whichever pool it is.
2026-11-07 23:58:50 +03:00
catborise
e2b038f3fa fix(instances): a VM with an SMBIOS UUID can be cloned
The clone took a new UUID but kept the VM's in its SMBIOS system
information, and libvirt refused the definition (UUID mismatch between
<uuid> and <sysinfo>). The SMBIOS entry takes the clone's UUID.
2026-11-07 23:56:04 +03:00
catborise
ae5fe5216c fix(instances): a clone's TPM is a new one, never the VM's state
A shut-off clone kept the VM's TPM element as it was: an emulated TPM
with a state path of its own, a host's TPM or an external one would be
shared with the VM, not the new, empty TPM the clone form promises. An
emulated TPM loses its state path, and the others are refused.
2026-11-07 23:56:04 +03:00
catborise
b1c6281af9 fix(instances): a shut-off clone into a volume name its pool has is refused before it begins
libvirt refused the copy only after the job had begun; recovery then
found a volume of the planned name and ended the job uncertain, holding
the VM. The names are checked when the job is queued and before it runs,
as a live clone did; that check now refreshes the pool first, so a live
clone's free space is read current too.
2026-11-07 23:56:04 +03:00
catborise
3c5aac2911 fix(migrate): a shut-off VM whose NVRAM file is outside libvirt's directory is refused
Only a file in libvirt's NVRAM directory was copied; one elsewhere was
skipped without a word, and the VM started on the destination from the
firmware's template, its saved boot entries lost. Such a VM is now
refused before anything changes.
2026-11-07 23:10:19 +03:00
catborise
7566ecf81a fix(migrate): recovery removes the disk copies of a migration whose worker stopped
A worker that stopped during the copy left the partial files on the
destination: libvirt ends the migration and the VM stays, but the files
took the space and refused the next try, as a copy never replaces a
file. The job records the copies before libvirt makes them, and
recovery deletes them while the destination has no VM of it.
2026-11-07 23:10:19 +03:00
catborise
cf0c586572 fix(migrate): the next start's definition names a copied disk under its new path
A copied disk was found by its target as well as its path: after a bus
change waiting for the next start (vda to sda), the next start's
definition kept the source path, which the destination does not have,
and the VM would not start again there. The path alone finds it, so two
disks of one file can no longer be copied to two places.
2026-11-07 23:10:19 +03:00
catborise
0eb8e8282e fix(migrate): a copied disk's source file is deleted only when no compute may use it
The source host alone was asked: a file on storage the computes share,
used by a VM or volume of another compute, was deleted under it. The
check the disk move makes, every compute and a host that cannot tell
counting as using it, moves to instances.utils and serves both. The
destination is not asked when its copy has the source's path: its VM
uses that copy, another file.
2026-11-07 22:51:25 +03:00
catborise
d90a967ba6 fix(migrate): a disk of an LVM or disk pool does not count as shared with the destination
Each host's logical volumes are its own: a VM whose disk is /dev/vg/x
migrated, uncopied, onto the destination's volume of the same name and
kept running on other data. Such a volume now counts as missing there.
2026-11-07 22:39:26 +03:00
catborise
897bcba66f fix(quota): a disk whose size is unknown is not counted as 0 GiB
A disk of the user's VMs whose size could not be read (its volume not in a
pool, the pool stopped) counted as 0 GiB, so a disk-limited user's increase
could pass over the limit. A disk no pool holds now has the size libvirt
reads from the file or device (blockInfo, also for a shut-off VM); one whose
size is still unknown makes the usage unverified and the increase is
refused, as when a host cannot be reached. Users without a disk limit are
not affected.
2026-11-07 16:19:12 +03:00