1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 11:16:47 +00:00
webvirtcloud/vrtManager
catborise 7f8e5cd618 feat(instances): move a VM's disk to another storage pool of its host
The Disks tab has a Move button for each disk: it opens a dialog to
choose another storage pool of the same host, and the move runs as a job.

- Running or paused VM: libvirt copies the disk with a block job
  (TRANSIENT_JOB, as the VM is persistent) into a file it creates in the
  pool, then pivots. The pivot names the copy in both the running and
  the next start's definition.
- Shut-off VM: the volume is copied into the pool and the copy named in
  the definition.

The source file goes then, unless a VM or volume of any compute uses it
(shared storage holds it for every host that mounts it), a compute
cannot be read, or the delete fails: the job lists such a file under
"Left behind", and the move stands.

A disk moves when:
- the VM is defined and running, paused or shut off, without snapshots,
  a saved state or a block job;
- the disk is a writable, unshared, unencrypted raw or qcow2 file of a
  storage pool, without a backing file, and the same file in both
  definitions;
- the pool keeps disk files, is another directory, and has no file of
  that name (libvirt would write into it).
Otherwise it is refused with the reason before anything changes.

The job claims the VM and the file's name in both pools. A cancel aborts
the block copy, and ends the job cancelled once the VM is back on its
file. A failed move deletes the copy it made, unless a definition names
it (a lost reply after the pivot); a file there before the copy began is
never deleted. Recovery after a stopped worker
ends a copy left mirroring, matched by its destination, and reads the
outcome from the definitions.

Superusers only, like the other disk edits.
2026-10-29 21:30:26 +03:00
..
tests feat(instances): move a VM's disk to another storage pool of its host 2026-10-29 21:30:26 +03:00
__init__.py Initial commit 2015-02-27 10:53:51 +02:00
connection.py feat(instances): move a VM's disk to another storage pool of its host 2026-10-29 21:30:26 +03:00
create.py fix(instances): a new VM's CPU is a mode or a model the host offers, checked by libvirt 2026-10-29 11:17:38 +03:00
hostdetails.py feat(computes): the host overview shows its VMs, capacity and load, also when it cannot be reached 2026-10-27 14:51:18 +03:00
instance.py feat(instances): move a VM's disk to another storage pool of its host 2026-10-29 21:30:26 +03:00
interface.py feat(interfaces): the interface pages on Bootstrap's cards, tables and dialogs 2026-10-29 10:09:52 +03:00
libvirt-ssh fix(vrtManager): libvirt connections open within a time limit 2026-10-05 09:06:52 +03:00
network.py feat(networks): a network's DHCP leases on its page 2026-10-29 11:41:39 +03:00
nodedevs.py fix(nodedevs): the Devices page works on Python 3.12.3 2026-10-29 15:50:16 +03:00
nwfilters.py fix(virtsecrets): a secret in use is not deleted, and a password is stored as typed 2026-10-29 10:10:43 +03:00
rwlock.py fix(vrtManager): modernize rwlock for Python 3.12 compatibility and add tests 2026-09-24 21:49:52 +03:00
storage.py perf(storages): a pool's volumes are read with one libvirt call each 2026-10-28 19:34:34 +03:00
util.py fix(nwfilters): a filter in use is not deleted, and a change replaces no other filter 2026-10-29 10:10:17 +03:00
virtsecrets.py fix(virtsecrets): a secret in use is not deleted, and a password is stored as typed 2026-10-29 10:10:43 +03:00