mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 12:16:49 +00:00
feat(instances): a VM's resize tab as a ledger, its vCPU changes kept
The Resize tab's CPU, Memory and Disk panes were horizontal forms with bold host figures. The owner chose the ledger layout from three rendered options: each section with its heading, the VM's figures and the host's on the left, its fields on the right, and one line on what applies now and what at the next start. Codex reviewed resizing end to end; these are fixed: - A vCPU turned on or off while the VM runs is kept at its next start: libvirt was asked without flags, which changes the running VM only. - A paused VM offers to turn vCPUs on only: turning one off needs the guest, which does not run. - A smaller disk size is refused, and so is the rest of the form, before anything grows; it was skipped without a word. - vCPUs and memory below 1 are refused. - The memory fields are numbers filled with the VM's values: the "Custom value" box, its script and the preset list are gone; an empty custom field silently used the preset. - Units and words: MiB, not MB; a disk's field is its new size, with its size now above it; the messages say what the VM gets.
This commit is contained in:
parent
3d632f1592
commit
f8e30d7668
11 changed files with 214 additions and 193 deletions
|
|
@ -1307,7 +1307,8 @@ class wvmInstance(wvmConnect):
|
|||
self._defineXML(etree.tostring(tree).decode())
|
||||
|
||||
def set_vcpu(self, cpu_id, enabled):
|
||||
self.instance.setVcpu(str(cpu_id), enabled)
|
||||
"""Turns a hotpluggable vCPU of the active VM on or off, now and for its next start."""
|
||||
self.instance.setVcpu(str(cpu_id), enabled, VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)
|
||||
|
||||
def set_vcpu_hotplug(self, status, vcpus_hotplug=0):
|
||||
"""vcpus_hotplug: the vCPUs enabled at boot, 0 keeps the current ones;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue