1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

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.
This commit is contained in:
catborise 2026-11-20 09:17:45 +03:00
parent 46931bdbdb
commit 3da55342da
14 changed files with 438 additions and 333 deletions

View file

@ -61,7 +61,8 @@ NOT_FOUND = gettext_noop("The virtual machine is no longer in the panel.")
DEVICES_REFUSED = gettext_noop("A host device of this virtual machine is not free on its host now; an administrator "
"can see why on its Host devices tab.")
BOUNDS = {"WORKER_CONCURRENCY": (1, 16, 4), "JOB_RETENTION_DAYS": (1, 3650, 30), "LOG_RETENTION_DAYS": (1, 3650, 365)}
BOUNDS = {"WORKER_CONCURRENCY": (1, 16, 4), "JOB_RETENTION_DAYS": (1, 3650, 30), "LOG_RETENTION_DAYS": (1, 3650, 365),
"MIGRATION_BANDWIDTH": (0, 100000, 0)}
def safe_text(text):
@ -225,3 +226,8 @@ def retention_days():
def log_retention_days():
return _value("LOG_RETENTION_DAYS")
def migration_bandwidth():
"""MiB/s a migration may take at most; 0: no limit."""
return _value("MIGRATION_BANDWIDTH")