[Kimchi-devel] [RFC V2] Allow user to specify max virtual cpus in template and guest
Lucio Correia
luciojhc at linux.vnet.ibm.com
Tue Jan 19 19:52:56 UTC 2016
Proposal
--------
Allow user to specify the maximum number of virtual cpus for a template
or guest (when this one is offline - not running).
Changes required
----------------
1) Backend
A) Add "maxvcpus" optional field to both template and guest APIs
Restrictions to be implemented on this value:
- must be a positive integer
- must be equal to sockets * cores * threads
- must be less than or equal the maximum number of virtual cpus
supported by hypervisor
If not specified, the default value for maxvcpus will be the equivalent
to cpus.
B) Change the way number of sockets is calculated:
topology: cores=2 , threads=2 (specified by user)
maximum number of virtual cpus guest can use = 100 (specified by user)
cpus assigned to guest = 4 (specified by user)
number of virtual cpus per socket: cores * threads = 4 (from topology)
maximum number of sockets guest can have = int(100/4) = 25
maximum number of virtual cpus guest can use = 4 * 25 = 100
That would result in:
<vcpu placement='static' current='4'>100</vcpu>
<cpu>
<topology sockets='25' cores='2' threads='2'/>
</cpu>
C) Update/Add unit tests
2) Frontend
A) Edit Template, at "Processor" tab:
- change the current "CPU number" field to a -[]+ input field
(increase/decrease)
- add a new -[]+ input field "Max CPU number" (increase/decrease) for
user input of "max virtual CPUs". Restrictions from 1.A) apply here.
Despite it's in a different place, we may use a "More Options" artifact
similar to the one proposed by Rodrigo Trujillo at "[RFC][Kimchi] Guest
Max memory setup and update", to keep the same format.
B) Edit Guest, at "General" tab:
- add a new -[]+ input field "Max CPUs" (increase/decrease in terms of
core * threads) for user input of "max virtual CPUs". This new field is
only enabled if guest is not running. Restrictions from 1.A) apply here.
Let me know if any questions/doubts.
Thanks,
--
Lucio Correia
Software Engineer
IBM LTC Brazil
More information about the Kimchi-devel
mailing list