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

86 commits

Author SHA1 Message Date
catborise
1c3993133e fix: the host comparison reads afresh, skips silent hosts and unread listings; bulk form limit
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.
2026-11-20 13:58:48 +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
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
dc5b1dbb2a fix(computes): a VM that returns gets its protection, schedules and backups back
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.
2026-11-20 08:17:23 +03:00
catborise
5c7687c60d feat(computes): a box on the Computes page tells what wants a look
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.
2026-11-19 23:22:35 +03:00
catborise
adb4231db7 feat(instances): a protected VM is not deleted nor restored over
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.
2026-11-19 22:00:25 +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
2e3ffba851 fix(backups): a schedule of every VM of a compute reads the host's VMs
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.
2026-11-19 15:15:11 +03:00
catborise
7018f57477 fix(tags): the tag pills count as the state pills do
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.
2026-11-19 10:49:45 +03:00
catborise
f6b1ee8985 fix(tags): sixth audit: the tag box tells its rule, trims a paste; clear keeps the focus
- 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.
2026-11-19 10:03:50 +03:00
catborise
bc1894e4d8 fix(tags): at most 12 characters; "…" does not move the columns
- 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.
2026-11-19 09:34:07 +03:00
catborise
0e711ec058 feat(tags): the tag filter as pills, below the state pills
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.
2026-11-19 08:40:36 +03:00
catborise
65b8110464 fix(tags): fourth audit: stale tag forms, rename after delete, stale filter
- 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.
2026-11-19 07:53:14 +03:00
catborise
6cdaa2affd fix(tags): third audit: host form and tag delete, hosts list badges
- 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.
2026-11-18 23:50:43 +03:00
catborise
b74e798e70 fix(tags): second audit: unchanged saves, report, other lists, hosts list
- 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.
2026-11-18 23:15:34 +03:00
catborise
904dd860d0 feat: tag badges choose the tag, untagged rows, counts in the tag list
On the VM and host lists a tag's badge chooses it in the tag list, the
tag list offers "No tag" for the rows without one, and each choice says
how many of the listed rows it shows ("prod (42)"); an owner counts only
their own VMs.
2026-11-18 22:08:02 +03:00
catborise
a492031d12 feat(bulk migrate): choose the VMs by tag
The Bulk Migrate page gets a "Choose by tag" list of its VMs' tags:
choosing one ticks the VMs with it that can migrate and unticks the
others, as a choice to review before Migrate; spread over the hosts, the
list is placed again as for any other tick. The job still gets the VMs
ticked, never the tag.
2026-11-18 21:20:19 +03:00
catborise
11b447f681 feat: filter the VM and host lists by tag
The VM list and the hosts list get a tag list next to their search: the
rows with the tag chosen show, together with the search and the state.
It offers the tags of the rows listed only, so an owner sees the tags of
their own VMs, not the panel's. The state counts follow the tag, and the
chosen tag is remembered as the search and state are; Clear the filters
clears it too.
2026-11-18 20:34:01 +03:00
catborise
149530f8df feat: tags for VMs and hosts
One list of tag names (lower case letters, digits, dot, dash, underscore;
up to 32) given to VMs and hosts. A superuser sets a VM's tags on its
Options tab and a host's on its form; Tom Select suggests the tags there
are and makes a new one typed. The VM list, the VM page and the hosts list
show them as badges, to everyone who sees the VM or host.

A VM's tags stay with it: an out-of-band move adds them to those on the
new host's record, and a VM that leaves its host keeps them on the Removed
VMs page (a VM with only tags too) and gets them back when it returns.
Setting them is audited and held against the VM's move.
2026-11-18 20:20:52 +03:00
catborise
012eba0c80 fix(instances): a host in maintenance offers no new VM from its VM list
The host's VM list offered New Instance while the host was in
maintenance; the create pages then refused it and sent the user to every
VM's list. The button is disabled there, saying why, and a refused create
page goes back to the page it was asked from, else the host's VM list.
2026-11-17 23:07:45 +03:00
catborise
a03f12aa5b fix(computes): maintenance read at the moment of the action; autostart named and refused
An audit of host maintenance found:
- refuse_start and refuse_new_vms trusted the compute as the page or job had
  read it: a clone started after its host went in maintenance during the disk
  copy, and a power-on raced the switch while host devices were checked. They
  now read the state from the database, and power-on checks right before the
  start; a VM defined from XML is refused as well.
- libvirt starts autostart VMs itself when the host boots. Autostart cannot
  be turned on for a VM of a host in maintenance, and the host page names the
  VMs that would start, so that their autostart is turned off before a reboot.
- The New VM dialog said "In maintenance" for a host whose maintenance was
  only requested: it now says "Maintenance".
- Tests now cover the owner's power-on, the revert job and a stale compute.
2026-11-16 22:53:42 +03:00
catborise
80e68d0628 fix(computes): a host's maintenance shows only its own bulk migration; the panel's refusals are not libvirt errors
The host page in maintenance showed the host's latest bulk migration even
when it was from before the maintenance, as a job of the morning that
"succeeded" while a VM still ran. The host now keeps when it went in
maintenance (maintenance_since; a job that puts it there sets it to the
job's own time), and the page shows a bulk migration from then on, or one
still running.

A refusal of the panel's own (OperationError), such as a VM start on a
host in maintenance, was shown as "libvirt Error - ...": it is shown as is.
2026-11-16 20:30:54 +03:00
catborise
d96fe940e9 feat(computes): putting a host in maintenance migrates its VMs; ready once none runs
A host was put in maintenance with its VMs still on it, and emptying it was
a separate step. "Put in maintenance" on a host with VMs that run now opens
Bulk Migrate, whose button migrates the chosen VMs and puts the host in
maintenance in one transaction: with the job admitted, or not at all; a
form sent again finds its job and does not put back a host taken out of
maintenance since. The page also puts it in maintenance without migrating,
for VMs that cannot move or when no host can take them.

Maintenance is not refused while VMs run: it must be on before they move,
or a new VM or Balance could take their place. The host shows instead
whether it is ready: "Maintenance requested" while VMs other than shut-off
ones remain on it (or it cannot be read), with its bulk migration's state;
"In maintenance" once none does. None of its VMs starts or resumes there
meanwhile. Ending maintenance during the bulk migration lets it go on.
2026-11-16 17:04:06 +03:00
catborise
22362de068 feat(computes): a host in maintenance takes no new VM or migration
After a host was emptied with Bulk Migrate for its maintenance, Balance
proposed moving VMs back onto it, and new VMs and migrations could still be
sent there. A superuser now puts a host in maintenance on its page (and
takes it out), each change audited; the form names the state it sets, so a
second page sent meanwhile does not turn it back.

A host in maintenance (Compute.maintenance, refuse_new_vms):
- takes no migration: migration_target refuses it, so the Migrate tab,
  Bulk Migrate, Balance and queued migrate jobs follow one rule; Bulk
  Migrate leaves it out of its destinations and its spread;
- takes no new VM: the create and clone jobs refuse it when asked for and
  again before they start (the REST API submits the same jobs); the create
  pages and the XML define send the user back to the VM list, and the New VM
  dialog lists it without a link;
- is left out of Balance: its VMs neither count nor move, and the Balance
  job refuses a move from it too, before each migration starts.
Its VMs run on; a migration already started finishes. The Computes page and
the host's page show that it is in maintenance.
2026-11-16 15:56:01 +03:00
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
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
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
e264104e85 fix(computes): the Computes page reads its hosts side by side, within one wait
The page connected to its hosts one after another: each host that did not
answer added its connect timeout, so a few such hosts made the page take
half a minute, and a host that hung while answering held it until the
worker was killed. The hosts are now read on their own threads, and a host
not read within ten seconds is shown as not answering.
2026-11-12 09:19:23 +03:00
catborise
eb3bc69754 fix(computes): the compute forms save their own kind, a password as typed, and say when the host is not reached
The kind of a compute came from a hidden form field: posted as another
number it was saved, and the edit page of that compute failed. Each form
now saves its own kind. Passwords lost their leading and trailing spaces
on the forms and the API, so a SASL password with one never worked. A
host name whose last label is all digits, such as an IPv4 address with a
trailing dot, was taken and libvirt could not resolve it. A host saved with
a wrong password or not answering was saved silently; the page now says
why the panel cannot connect to it.
2026-11-12 09:19:15 +03:00
catborise
d682c4bc82 fix(computes): a changed compute does not use or list its old host
A compute saved with another address, login or password, or deleted, left
its connection open in the panel: saved back to the old credentials, the
panel used it again although the host no longer took them. A VM list that
read the host before such a change could then save that listing over the
VMs of the new one.

The old connection is retired when a compute's connection changes or the
compute is deleted, and a listing is saved only when the compute's
connection is still the one it was read with.
2026-11-12 09:19:03 +03:00
catborise
29ec20682b fix(computes): a libvirt host is one compute, and a compute's VMs stay on their host
One host could be added twice, under another name, as TCP and SSH, or by
another address: its VMs were listed once per record, each with its own
owners, and counted twice in the capacity totals. A compute with VMs could
also be pointed at another host: the owners of a VM then reached the
VM with the same UUID there, a restored or copied one.

A compute now keeps its libvirt host UUID. Adding a compute or changing
its connection, on the web or the API, connects and reads it: a host that
is already a compute is refused, and a compute with VMs moves only to an
address of the same host, which must answer. Computes added before are
read when another one is checked.
2026-11-12 09:19:03 +03:00
catborise
4cd4af30ee fix(computes): a VM gone from its compute gives no copy its owners
When a VM left its compute and its UUID was listed on another, its owners
moved there: an out-of-band move. With the UUID on two other computes,
the first record found got them, which may be an independent copy, giving
its owners another VM and charging their quota for it. The owners now
move only when one other compute lists the UUID; otherwise they are kept
on the Removed VMs page.
2026-11-10 13:19:39 +03:00
catborise
2c48e93780 fix(computes): a compute is not edited while a job on it is admitted
A job resolves its compute's connection when it runs. Changing the
compute's hostname meanwhile sent the job to another host, where a VM
with the same UUID (a copy) could be deleted or changed instead. An edit
now holds the compute as a delete does, and is refused while a job or VM
operation on it is admitted.
2026-11-10 13:19:39 +03:00
catborise
57c380542c fix(instances): a VM name of any length libvirt takes is kept
libvirt names a VM by its <name>.xml file, so a name can have up to 251
bytes. The panel's VM, removed-VM and log records held 120 characters:
on PostgreSQL one longer name made the host's sync fail and the VM list
answer with an error. They now hold 255.
2026-11-10 13:11:22 +03:00
catborise
d06d4f90bb fix(ui): host and VM charts give their points the panel's time
A host's charts and their "Updated at" line took their times from
timezone.now(), which is UTC, while a VM's charts took time.strftime(),
the panel's time zone. With TIME_ZONE=Europe/Istanbul the same moment
read 09:00 on the host page and 12:00 on the VM page. Both now give the
panel's time.
2026-11-10 11:57:43 +03:00
catborise
1056f40ff6 test: no test connects to a real host
Tests of eight files patched a host's status but not what the page also read, its
connection, connection_error or proxy, and so connected for real: over
ssh to 10.0.0.9 or over TCP to unroutable addresses (5 to 10 s each until
the connect timeout), and to the machine's own libvirt (qemu:///system).
A failed host is not tried again for a while, so only the first such test
of a process connected, and which one depended on the order. They now
patch the connection itself, or what the page reads, and use RFC 5737
addresses.
2026-11-08 22:22:16 +03:00
catborise
13107deecc refactor(instances): the VM list calls refresh_instance_database itself
instances.utils.refr() only imported and called computes.utils.refresh_instance_database(); the views import it directly, as they import its siblings from computes.utils.
2026-11-08 12:15:33 +03:00
catborise
7c408673a1 perf(computes): a host's CPU count and memory come from its cached info
cpu_count and ram_size each called get_node_info(), which also reads the hostname, the sysinfo XML and the URI, for one value. Both now take it from host_info, the getInfo() read the proxy keeps.
2026-11-08 12:05:19 +03:00
catborise
e9e514a7e9 fix(logs): a row says what happened: a recovered migration, a failed clone step, a device not there
- A migration whose libvirt call failed but which recovery finds moved (or
  cannot tell) gets a row of that end; only a failure already logged by
  migrate_instance is not logged twice.
- A clone made with its resize or start failed, and a recovered migration
  whose autostart or NVRAM step failed, write a failed row of that step, as
  migrate_instance does for its later steps.
- Setting the link state of an interface or the video model of a VM that
  has none is refused: it changed nothing and was logged as done.
- The rows of a removed VM record (deleted or expired) name its host, VM
  and UUID, so the VM's history has them.
2026-11-07 14:36:34 +03:00
catborise
bf6a0c0a29 fix(logs): failures name their job, VM and user; the new VM form shows a list it could not load
- A failed cancel hook logged "worker task cancel failed": it now names
  the job, its kind, resource and user, with the traceback for a fault
  of the panel.
- novncd logged "Console connection failed" without the VM or the user.
- django-axes wrote four INFO lines a login ("Reset 0 access
  attempts"...); logins are on the Logs page, so it logs warnings only.
- The new VM form's machine types and disk buses answered 200 with an
  empty object when libvirt failed, and nothing was logged: the list
  stayed empty, the form could not go on and said nothing. They answer
  400 with the error, as the pool's volume list does, the warning is
  logged with the compute, and the form's lists show an error they get
  with the page's messages.
2026-11-06 23:48:44 +03:00