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

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.
This commit is contained in:
catborise 2026-11-20 10:33:49 +03:00
parent 79f3b906dd
commit 2b60b79a5f
11 changed files with 1016 additions and 620 deletions

View file

@ -195,6 +195,12 @@ class Instance(models.Model):
edit does not post the live value back over it."""
return self.proxy.get_disk_devices(config=True)
@cached_property
def live_custom_iotune(self) -> set:
"""The disks whose running definition has I/O tuning set in the XML (custom_iotune): the
Disks tab shows the next start's, and set_disk_limit refuses these too."""
return {disk["dev"] for disk in self.disks if disk.get("iotune_custom")}
@cached_property
def config_vcpu(self) -> int:
"""vCPUs of the persistent definition, which the CPU form changes."""