Creating, cloning, migrating and deleting VMs are jobs: with the dev
server alone they stay queued. The step starts run_worker with the dev
settings in another terminal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The datasource names the VM by the reverse DNS name of the request's
address and sends keys only when its first label is one VM's name. On
the console settings, the listen address and removing the password of
a console listening beyond localhost are a superuser's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
An API request with invalid fields answers DRF's field errors, not
{"detail": ...}. The new VM's machine is chosen on a page before the
details form. The Logs page records 401 and 403 answers; a VM hidden
from a user answers 404 and is not logged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
webvirt-backup.timer has RandomizedDelaySec=10min and Persistent=true:
it runs up to 10 minutes after 03:15, and at the next boot when the
server was off then.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The serial console refuses a request without a signed-in session before
it reads the token, and noVNC accepts a token only in its user's
session: the token alone does not open a console.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Only the Users page's new-user form ticks it; the signal for new users
grants change_password alone, and the grant to every user ran once, in
the migration that added the permission.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Only a queued job or a running clone, migration, disk move or ISO upload
can be cancelled (the other kinds are not cancellable once running).
Freezing the guest's file systems is an option of a snapshot without
memory. instances.view_instances shows every VM read-only, besides the
VMs assigned to a user.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
CI runs Python 3.10 to 3.14. The API's list of one compute's VMs calls
refresh_instance_database before reading, as the VM list page does; only
the list of all VMs reads the rows as they are.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The RHEL family 10 computes run libvirt's modular daemons (the bootstrap
enables virtqemud.socket), where no libvirtd is there to restart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
docker stop -t 95 without a container fails with "requires at least 1
argument"; compose names it webvirtcloud.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Both blocks of Moving to a new machine restore $b/db.sqlite3, which a
backup of a PostgreSQL panel does not have, so the chain stopped there.
The section says to restore PostgreSQL by hand and leave that line out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The installer block copied the backup's SSH keys with cp "$b"/ssh/*:
a backup of a panel without keys has an empty ssh/ directory, the glob
stays unexpanded, cp fails and the rest of the && chain is skipped. It
copies the directory's contents as the pki line does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The password reset and the behaviour changes' session and lockout
commands ran a bare python3 manage.py, which on an installer host fails
with "Couldn't import Django" (the packages are in the venv) and had no
Docker form. They name the venv's python as the web service user, and
the Docker exec form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Each run built the image from nothing, compiling libvirt-python and
python-ldap again. Buildx keeps the layers in GitHub's cache, so a run
that changes only code rebuilds only the last stage.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
build named the default Dockerfile and each volume the default local
driver. The resolved config is the same; the volumes keep their names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The image took .github, doc, dev, the installer scripts, the Vagrantfile
and the ruff cache, and a rotated log (*.log.1) of a used checkout. The
list is now grouped by why a file stays out, without the entries for
tools this repository does not use.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
gunicorn.conf.py starts 2 x CPUs + 1 workers, at most 8, about 140 MB
each: 1.1 GB on the deployed host for a panel. The image now runs 4,
which still sends up to 8 requests at a time to one compute and leaves
threads for the others when one hangs. GUNICORN_CMD_ARGS in
docker-compose.override.yml sets another number; installs outside
Docker keep their default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
phusion/baseimage brought sshd, syslog-ng, my_init and runit's per
service scripts, and an nginx log forwarder tailing a file. The image
is now ubuntu:26.04 with Ubuntu's supervisor: conf/docker holds the
start script (settings, secret key, ownership, migrations as www-data),
one supervisord.conf for the six processes, nginx's config with errors
to docker logs, the backup's cron line and the health check. A stop
signals every process at once, so the worker keeps its 60 s drain
within the 95 s grace. The same volumes and container name work as
before; README runs commands with exec -u www-data in place of
/sbin/setuser. The image goes from 805 MB to 642 MB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
chown -R www-data on /srv/webvirtcloud after collectstatic copied the
venv and the code into a layer of their own. The code now stays root's:
the panel writes only to its data and backup directories, which the
start script gives it. pip is removed from the runtime venv and its
cache is a build cache mount, so a requirement change downloads only
what changed. The image goes from 1.17 GB to 805 MB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The 223-line read-write lock guarded only the dict of connections, a
lookup of a few entries: readers never waited on a long writer, as the
connection is opened outside the lock. One reentrant lock does the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
create_instance put an existing volume's path and the network and
filter names into the domain XML unescaped, so a quote or ampersand,
which libvirt allows in them, broke the VM's XML. They are escaped as
attach_disk does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
QEMU no longer creates images of the first qcow format: qemu-img stops
with "Unknown file format 'qcow'", so converting a copy to it always
failed. The choice is gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The copy of a template for a new VM always got qcow2's compat and
lazy_refcounts, which libvirt refuses for a qcow template, and only a
dir pool named it as a file. Every pool of files now does, and only a
qcow2 copy gets those options. The pool types of files are one list,
which the cloud-init seed check also reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
A new VM's disk and a disk added to a VM were built by a copy of the
volume XML of the Storage page that kept the format in dir pools only:
in an fs or netfs pool a qcow2 disk became a raw one allocated whole,
and a qcow disk got qcow2's compat and lazy_refcounts, which libvirt
refuses. Both now use the Storage page's builder, where every pool of
files keeps the format and the other pools make a raw volume without
metadata preallocation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The create job looked volumes up by name in every active pool and took
the first match, so a volume of the same name in another pool could be
attached or copied in place of the chosen one. The form now sends each
existing volume as pool/volume and the template's pool, and the job
looks each up in its own pool.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
randomUUID() built a version 4 UUID from 16 random bytes by hand; the clone and create jobs now take str(uuid4()) from the standard library, and the function and its format test go.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
get_new_disk_dev() mapped virtio to vd, ide to hd, fdc to fd and other buses to sd itself; vrtManager.util.vol_dev_type() has that mapping, and the bus change in vrtManager uses it with the same sd fallback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
record_migration() repeated computes.utils._move_ownership() line by line: owners move to the record the destination already has, a user's rights are merged and the template mark is kept. It now calls that function, renamed move_ownership as it is used from both apps; the owners left on the source record go with it, by cascade.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Its body was a pass: connections are kept by the connection manager, not closed per object. The calls to it, and the finally blocks and None guards that only called it, are removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Old redirects, sample return values and test fragments that were commented out and never came back: storages/views.py, vrtManager/connection.py and instances/tests/test_live_views.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Nothing calls wvmStorage.get_allocation(), get_available() or get_capacity(); the pages read a pool's space with get_size(), one info call.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Both views render locals(), and kept settings no template reads: keymaps, the console listener addresses and the disk io, discard and detect-zeroes defaults on the VM page; the AppSettings rows, an empty hypervisor list and seven disk defaults on the new VM page, the create job reads its own. Commented-out assignments next to them go too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
get_dom_capabilities() parsed the same domain capabilities XML for each of its 14 reads, and the pool list parsed each pool's XML for its type, its path and its source name. Each is now parsed once and read with get_xpath().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The page listed the host's filters twice: once for their names and once for the filters with their references. The names now come from the second listing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
get_size() called pool.info() twice for its capacity and free space, two libvirt calls on every pool page and API read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The page computed storages = conn.get_storages(), two libvirt listings on every load and POST, and never used it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The page never showed either: get_instances() looked up every running domain and get_capabilities() parsed the host capabilities on each load, and both results were thrown away.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The addresses were checked for their form only: a clone could keep the
VM's address, or give two NICs one, and the NICs on a network then take
each other's traffic. Such an address is refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The name's length was not checked: libvirt defined a clone of a name
longer than the panel's records hold (120), and the job failed to record
it, leaving a VM the panel did not list. The form and the job take 64,
as for a new VM.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea