[Kimchi-devel] [PATCH v2] Auto Topology for Guest Templates

Christy Perez christy at linux.vnet.ibm.com
Tue Nov 11 05:59:24 UTC 2014


This patchset is a better functioning, but not final, version of the
topology logic. Aline asked that I send another version with details
for the UI will interact with the cpu_info API.

The flow will be:
- GET /host/cpu_info:
    Returns  {'threading_enabled': boolean
                'sockets': integer
                'cores_present': integer
                'cores_online': integer
                'threads_per_core': integer
             }

- Based on that information, plus the host arch, the UI can display
    - If host arch is Power:
        - Display a menu labled SMT, with up to four check-boxes.
          The check-boxes will be labeled SMT1, SMT2, SMT4, and SMT8.
          The max SMT value displayed will be dependant upon
          threads_per_core from above. The default checkbox should be the
          greatest SMT value (e.g. SMT8).
        - Display the same box for CPUs as before. I had initially thought
          about having a drop-down for CPUs instead of the empty field,
          (with only legal vCPU amounts, like 1,2,4,8, etc.), but that will
          get complicated with different types of processors, and also
          be too tedious to use. So, unless someone objects,
          I think the next best thing to do, is just slightly adjust the number
          of vCPUs the user asked for in order to make sure that the number
          is a legal number to use with a topology (since vCPUS must equal
          sockets * cores * threads).
    - Else:
        - Display a menu labeled Hyper-Threading, with only a checkbox labeled
            HT.

- The user's selections from those fields is sent to the get_rec_topology
    method, which will then return two values:
    {'topology': {'sockets': sockets, 'cores': cores, 'threads': threads},
                  'vcpus': best_vcpus}
    These values can then be used to create the template: 

curl -k -u user -X POST -H 'Content-Typ: application/json' -H 'Accept: application/json' \
 https://localhost:8001/templates -d'{"name": "test_topo", "cdrom": "/isos/DVD_name.iso", \
 "cpus":4, "cpu_info": {"topology": {"sockets": 1, "cores": 2, "threads":2}}}'

What doesn't work right now: 
    - The GET for cpu_info.
    - Some error messages still need to be created.
    - Some values of vCPUs will return an error that topology isn't supported.

Hopefully this description will help the UI developers while I finish.

Christy Perez (1):
  Parts to allow  Kimchi to configure the cpu topology.

 docs/API.md                   |   2 +
 src/kimchi/API.json           |   6 ++
 src/kimchi/control/cpuinfo.py |  35 ++++++++
 src/kimchi/i18n.py            |   2 +
 src/kimchi/model/cpuinfo.py   | 183 ++++++++++++++++++++++++++++++++++++++++++
 src/kimchi/model/host.py      |   1 +
 src/kimchi/model/templates.py |  15 +++-
 7 files changed, 243 insertions(+), 1 deletion(-)
 create mode 100644 src/kimchi/control/cpuinfo.py
 create mode 100644 src/kimchi/model/cpuinfo.py

-- 
1.9.3




More information about the Kimchi-devel mailing list