mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
fix(instances): a new VM's CPU is a mode or a model the host offers, checked by libvirt
- A named CPU model is written without check='none' and with fallback='forbid': libvirt checks before the start that the host runs it, and it is not swapped for another model. - Mode maximum is written as that mode; it was written as a model named maximum. - Model names up to 64 characters: the -noTSX and -IBRS models, the ones a mixed set of hosts needs, were refused at 20. - The mode or model is checked against the host's capabilities when the VM is defined, from the page and the API alike; no CPU element (QEMU's oldest default CPU) is no longer offered. - The default CPU mode setting offers the modes the new VM dialog has; no-model and custom, which matched none of them, become host-model.
This commit is contained in:
parent
2a773f6ec0
commit
2e1f29961c
15 changed files with 139 additions and 19 deletions
|
|
@ -33,6 +33,7 @@ class CreateRollbackTestCase(TestCase):
|
|||
with patch("instances.jobs.wvmCreate") as wvm:
|
||||
conn = wvm.return_value
|
||||
conn.get_cache_modes.return_value = {"none": "Disable cache"}
|
||||
conn.get_dom_capabilities.return_value = {"cpu_modes": ["host-model"]}
|
||||
conn.get_instances.return_value = []
|
||||
conn.create_volume.return_value = "/pool/rb-vm.qcow2"
|
||||
op = jobs.submit("instance.create", self.admin, {**PARAMS, "compute": self.compute.pk}, "key-rollback1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue