<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I see. I thought the bug was about the UI failing to update the
vcpus even<br>
in a valid case because the topology verification in backend was
wrong.<br>
<br>
I believe we can make the Kimchi UI to show the topology attributes
instead of<br>
the maxvcpu values if the guest has a topology set.<br>
<br>
About the "Please, also check why Kimchi is not getting in count the
value<br>
on guest XML." , I'll look into it. <br>
<br>
<div class="moz-cite-prefix">On 11/04/2016 06:51 PM, Aline Manera
wrote:<br>
</div>
<blockquote
cite="mid:325ffaf1-4170-972b-c6ac-6d9f4fb9287b@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<br>
<br>
<div class="moz-cite-prefix">On 11/04/2016 06:36 PM, Aline Manera
wrote:<br>
</div>
<blockquote
cite="mid:27f33615-4142-b975-29e5-1e40bd8e1fb4@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<br>
Hi Daniel,<br>
<br>
I am not sure this is the root cause of the issue.<br>
I created a guest with topology and tried to change maxvcpus and
vcpus values on UI and I got the same error reported on github.<br>
<br>
The test I did:<br>
- create a new guest with topology set<br>
<pre role="list"><code class="wrappedText focusRow" role="listitem">"cpu_info":{
</code><code class="wrappedText focusRow" role="listitem"> "maxvcpus":4,
</code><code class="wrappedText focusRow" role="listitem"> "vcpus":4,
</code><code class="wrappedText focusRow" role="listitem"> "topology":{
</code><code class="wrappedText focusRow" role="listitem"> "cores":2,
</code><code class="wrappedText focusRow" role="listitem"> "threads":2,
</code><code class="wrappedText focusRow" role="listitem"> "sockets":1
</code><code class="wrappedText focusRow" role="listitem"> }
</code><code class="wrappedText focusRow" role="listitem"> }</code></pre>
<br>
- try to change maxvcpus to 8<br>
- try to change vcpus to 8<br>
<br>
<img src="cid:part1.4E7B10F1.10CED808@gmail.com" alt=""><br>
<br>
<div class="moz-cite-prefix"><br>
</div>
</blockquote>
<br>
<blockquote
cite="mid:27f33615-4142-b975-29e5-1e40bd8e1fb4@linux.vnet.ibm.com"
type="cite">
<div class="moz-cite-prefix"> I believe the problem is because,
on UI, there is no information about topology, only about
maxvcpus and vcpus.<br>
When user sets maxvcpus (and topology is set), the topology
must be changed according to the new maxvcpus value.<br>
We will need to update the UI to show and let the user change
the topology instead of maxvcpus (as maxvcpus must be cores *
threads * sockets).<br>
<br>
</div>
</blockquote>
<br>
Just to clarify, the exactly error described on #0172, happens
when trying to increase vCPUS and max vCPUS at the same time as
there is no other way (through kimchi) to change max vCPUS value
to be allowed to increate the vCPUS number.<br>
<br>
Also, when I tried to increase the max vCPUs for a given guest (by
manually editing the topology on guest XML), Kimchi keeps
displaying the older value.<br>
So I needed to edit it again on Kimchi UI and everything worked
fine.<br>
<br>
Please, also check why Kimchi is not getting in count the value on
guest XML.<br>
<br>
Steps to reproduce:<br>
<br>
- Create a guest with topology (cores: 2, thread: 2, sockets: 1)<br>
- Edit the guest XML and change cores to 4 (that way maxvcpus will
be 8)<br>
- Open guest edit dialog.<br>
- Max vCPUS shows 4 (instead of 8)<br>
<br>
<br>
<blockquote
cite="mid:27f33615-4142-b975-29e5-1e40bd8e1fb4@linux.vnet.ibm.com"
type="cite">
<div class="moz-cite-prefix"> On 11/04/2016 04:15 PM, <a
moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:dhbarboza82@gmail.com">dhbarboza82@gmail.com</a>
wrote:<br>
</div>
<blockquote
cite="mid:1478283348-1353-1-git-send-email-dhbarboza82@gmail.com"
type="cite">
<pre wrap="">From: Daniel Henrique Barboza <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:danielhb@linux.vnet.ibm.com"><danielhb@linux.vnet.ibm.com></a>
This patch changes the vcpu verification when
editing a turned off VM, if the VM has a topology
set, to comply with the current libvirt schema: vcpus
must be a multiple of the 'threads' value.
Unit tests were adapted to reflect these changes.
Signed-off-by: Daniel Henrique Barboza <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:danielhb@linux.vnet.ibm.com"><danielhb@linux.vnet.ibm.com></a>
---
i18n.py | 2 +-
model/cpuinfo.py | 2 +-
tests/test_model.py | 12 ++++++------
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/i18n.py b/i18n.py
index 03929e5..2ec0e78 100644
--- a/i18n.py
+++ b/i18n.py
@@ -357,7 +357,7 @@ messages = {
"KCHCPUINF0002E": _("When CPU topology is defined, maximum number of vCPUs must be a product of sockets, cores, and threads."),
"KCHCPUINF0003E": _("This host (or current configuration) does not allow CPU topology."),
"KCHCPUINF0004E": _("The maximum number of vCPUs is too large for this system."),
- "KCHCPUINF0005E": _("When CPU topology is defined, vCPUs must be a multiple of a product of cores and threads."),
+ "KCHCPUINF0005E": _("When CPU topology is defined, vCPUs must be a multiple of the 'threads' number defined."),
"KCHCPUINF0006E": _("The number of threads is too large for this system."),
"KCHCPUINF0007E": _("When CPU topology is specified, sockets, cores and threads are required paramaters."),
"KCHCPUINF0008E": _("Parameter 'cpu_info' expects an object with fields among: 'vcpus', 'maxvcpus', 'topology'."),
diff --git a/model/cpuinfo.py b/model/cpuinfo.py
index 3707a02..5f82320 100644
--- a/model/cpuinfo.py
+++ b/model/cpuinfo.py
@@ -138,7 +138,7 @@ class CPUInfoModel(object):
raise InvalidParameter("KCHCPUINF0006E")
if maxvcpus != sockets * cores * threads:
raise InvalidParameter("KCHCPUINF0002E")
- if vcpus % (cores * threads) != 0:
+ if vcpus % threads != 0:
raise InvalidParameter("KCHCPUINF0005E")
if maxvcpus > self.get_host_max_vcpus():
diff --git a/tests/test_model.py b/tests/test_model.py
index 05d7415..1246be6 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -1298,23 +1298,23 @@ class ModelTests(unittest.TestCase):
# define CPU topology
inst.vm_update(u'kimchi-vm1', {'cpu_info': {'topology': {
- 'sockets': 4, 'cores': 2, 'threads': 1}}})
+ 'sockets': 2, 'cores': 2, 'threads': 2}}})
vm_info = inst.vm_lookup(u'kimchi-vm1')
- self.assertEquals({'sockets': 4, 'cores': 2, 'threads': 1},
+ self.assertEquals({'sockets': 2, 'cores': 2, 'threads': 2},
vm_info['cpu_info']['topology'])
- # vcpus not a multiple of (cores * threads)
+ # vcpus not a multiple of threads
self.assertRaises(InvalidParameter, inst.vm_update, u'kimchi-vm1',
- {'cpu_info': {'vcpus': 1}})
+ {'cpu_info': {'vcpus': 5}})
# maxvcpus different of (sockets * cores * threads)
self.assertRaises(InvalidParameter, inst.vm_update, u'kimchi-vm1',
{'cpu_info': {'maxvcpus': 4}})
- # topology does not match maxvcpus (8 != 2 * 2 * 1)
+ # topology does not match maxvcpus (8 != 3 * 2 * 2)
self.assertRaises(InvalidParameter, inst.vm_update, u'kimchi-vm1',
{'cpu_info': {'topology': {
- 'sockets': 2, 'cores': 2, 'threads': 1}}})
+ 'sockets': 3, 'cores': 2, 'threads': 2}}})
# undefine CPU topology
inst.vm_update(u'kimchi-vm1', {'cpu_info': {'topology': {}}})
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>