[RFC] Guest/Template CPU setup with topology

Hi there, At this moment Kimchi support for guest and template CPU setup is underwhelming. Here's what I've found that needs improving: - edit template: * calculation of max CPUs is wrong when considering a topology. Max CPU is the value of sockets * cores * threads. At this moment it is considering only cores * threads, defaulting sockets to 1. * There is no way to set or even see the value of sockets. Given that this value is used in the calculation of the max CPUs, it should be at least visible and, in my opinion, editable - edit guest (not running): * If the guest was created with a CPU topology, there is no way to edit it. The only way to edit a topology at this moment is on the template level. My proposal is: edit template: - fix the max CPU calculation to consider the sockets. - add a field to allow the 'sockets' to be set at will. Default value will be retrieved by the kimchi/host/cpuinfo API as a reference (same think as with cores and threads today). edit guest: - if the guest was created with a CPU topology, allow the topology to be edited when the guest is turned OFF. Thoughts? ps: this RFC is also related to the feedback of "Bug fix #1072 - changing vpus verification". Daniel

Hi Daniel, On 11/08/2016 05:14 PM, Daniel Henrique Barboza wrote:
Hi there,
At this moment Kimchi support for guest and template CPU setup is underwhelming. Here's what I've found that needs improving:
- edit template:
* calculation of max CPUs is wrong when considering a topology. Max CPU is the value of sockets * cores * threads. At this moment it is considering only cores * threads, defaulting sockets to 1.
It is working as designed. When we started discussing about that, we agreed to ask minimal information from user and after some investigation, we decided the sockets value would be set as 1. The most important value IMO is the number of threads (X) that corresponds to the SMT X value and can not be freely inputed as it depends on CPU support. If you are proposing to add sockets there too, I am OK with that. Just want to understand the limitations we are adding while assuming sockets = 1.
* There is no way to set or even see the value of sockets. Given that this value is used in the calculation of the max CPUs, it should be at least visible and, in my opinion, editable
Same I commented above.
- edit guest (not running): * If the guest was created with a CPU topology, there is no way to edit it. The only way to edit a topology at this moment is on the template level.
And it is also impacting user to update max vcpus and vcpus value. =/
My proposal is:
edit template: - fix the max CPU calculation to consider the sockets. - add a field to allow the 'sockets' to be set at will. Default value will be retrieved by the kimchi/host/cpuinfo API as a reference (same think as with cores and threads today).
OK for me. Just want to understand the limitations we are adding while assuming sockets = 1.
edit guest: - if the guest was created with a CPU topology, allow the topology to be edited when the guest is turned OFF.
ACK.
Thoughts?
ps: this RFC is also related to the feedback of "Bug fix #1072 - changing vpus verification".
Daniel
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 11/9/16 12:44 AM, Daniel Henrique Barboza wrote:
Hi there,
At this moment Kimchi support for guest and template CPU setup is underwhelming. Here's what I've found that needs improving:
- edit template:
* calculation of max CPUs is wrong when considering a topology. Max CPU is the value of sockets * cores * threads. At this moment it is considering only cores * threads, defaulting sockets to 1.
* There is no way to set or even see the value of sockets. Given that this value is used in the calculation of the max CPUs, it should be at least visible and, in my opinion, editable
I like the idea. One thing to consider here is these calculations might be different based on platforms (x86/ppc/s390x). Make sure we have to address these aspects.
- edit guest (not running): * If the guest was created with a CPU topology, there is no way to edit it. The only way to edit a topology at this moment is on the template level.
My proposal is:
edit template: - fix the max CPU calculation to consider the sockets. - add a field to allow the 'sockets' to be set at will. Default value will be retrieved by the kimchi/host/cpuinfo API as a reference (same think as with cores and threads today).
edit guest: - if the guest was created with a CPU topology, allow the topology to be edited when the guest is turned OFF.
Thoughts?
Looks good
ps: this RFC is also related to the feedback of "Bug fix #1072 - changing vpus verification".
Also in any means max number of vcpu that can be created based on the CPU capacity available to the host to be addressed ? May be this is some thing we can attempt if it helps admin. Just a thought !!!
Daniel
+1 for the proposal
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 11/10/2016 11:12 AM, Chandra Shekhar Reddy Potula wrote:
On 11/9/16 12:44 AM, Daniel Henrique Barboza wrote:
Hi there,
At this moment Kimchi support for guest and template CPU setup is underwhelming. Here's what I've found that needs improving:
- edit template:
* calculation of max CPUs is wrong when considering a topology. Max CPU is the value of sockets * cores * threads. At this moment it is considering only cores * threads, defaulting sockets to 1.
* There is no way to set or even see the value of sockets. Given that this value is used in the calculation of the max CPUs, it should be at least visible and, in my opinion, editable
I like the idea. One thing to consider here is these calculations might be different based on platforms (x86/ppc/s390x). Make sure we have to address these aspects.
The calculation is the same for Intel and Power archs. I am assuming that it is the same for s390x. If it's not we can make exceptions in this case.
- edit guest (not running): * If the guest was created with a CPU topology, there is no way to edit it. The only way to edit a topology at this moment is on the template level.
My proposal is:
edit template: - fix the max CPU calculation to consider the sockets. - add a field to allow the 'sockets' to be set at will. Default value will be retrieved by the kimchi/host/cpuinfo API as a reference (same think as with cores and threads today).
edit guest: - if the guest was created with a CPU topology, allow the topology to be edited when the guest is turned OFF.
Thoughts?
Looks good
ps: this RFC is also related to the feedback of "Bug fix #1072 - changing vpus verification".
Also in any means max number of vcpu that can be created based on the CPU capacity available to the host to be addressed ? May be this is some thing we can attempt if it helps admin. Just a thought !!!
The limitation is given by libvirt. Not sure if it takes the host capabilities into account. This laptop I use has 4 CPUs but libvirt allows me to create KVM guests with far more CPU than that: [danielhb@arthas ginger]$ sudo python Python 2.7.12 (default, Sep 29 2016, 13:30:34) [GCC 6.2.1 20160916 (Red Hat 6.2.1-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import libvirt conn = libvirt.open('qemu:///system') conn.getMaxVcpus('kvm') 288
So, for my current setup, I can have a KVM guest with up to 288 CPUs (of course that the host performance will go to drain if I do that hehehe). Daniel
Daniel
+1 for the proposal
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
participants (3)
-
Aline Manera
-
Chandra Shekhar Reddy Potula
-
Daniel Henrique Barboza