Greg Padgett has uploaded a new change for review.
Change subject: [WIP] api: Report hyperthreading info in getVdsCapabilities
......................................................................
[WIP] api: Report hyperthreading info in getVdsCapabilities
Report hyperthreading info in getVdsCapabilities:
cpuHtEnabled - Whether hyperthreading is enabled
reportHostThreadsAsCores - Whether vdsm is reporting threads as cores,
determined by vdsm.conf configuration setting
This information is used by ovirt-engine to help determine CPU topology
and provide support for cluster-based CPU overcommitment.
Change-Id: If6868f3947ade62dda7cb6265b0c9e50c2face94
Signed-off-by: Greg Padgett <[email protected]>
---
M vdsm/caps.py
M vdsm_api/vdsmapi-schema.json
2 files changed, 11 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/10144/1
diff --git a/vdsm/caps.py b/vdsm/caps.py
index d1297c9..07bfc28 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -253,10 +253,15 @@
cpuInfo = CpuInfo()
cpuTopology = CpuTopology()
+ caps['cpuHtEnabled'] = \
+ str(cpuTopology.threads() != cpuTopology.cores()).lower()
+
if config.getboolean('vars', 'report_host_threads_as_cores'):
caps['cpuCores'] = str(cpuTopology.threads())
+ caps['reportHostThreadsAsCores'] = 'true'
else:
caps['cpuCores'] = str(cpuTopology.cores())
+ caps['reportHostThreadsAsCores'] = 'false'
caps['cpuSockets'] = str(cpuTopology.sockets())
caps['cpuSpeed'] = cpuInfo.mhz()
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 1b1c075..30a8b8a 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -848,6 +848,8 @@
#
# @kvmEnabled: KVM is enabled on the host
#
+# @cpuHtEnabled: CPU hyperthreading is enabled on this host
+#
# @cpuCores: The number of CPU cores present
#
# @cpuSockets: The numbet of CPU sockets
@@ -857,6 +859,8 @@
# @cpuModel: The CPU model
#
# @cpuFlags: CPU feature flags (a comma-separated string)
+#
+# @reportHostThreadsAsCores: Vdsm is reporting threads as cores on this host
#
# @version_name: The name given to this version of VDSM
#
@@ -909,7 +913,8 @@
# the current API truncates @software_version to 'x.y'.
##
{'type': 'VdsmCapabilities',
- 'data': {'kvmEnabled': 'bool', 'cpuCores': 'uint',
+ 'data': {'kvmEnabled': 'bool', 'cpuHtEnabled': 'bool', 'cpuCores': 'uint',
+ 'reportHostThreadsAsCores': 'bool',
'cpuSockets': 'uint', 'cpuSpeed': 'float', 'cpuModel': 'str',
'cpuFlags': 'str', 'version_name': 'str', 'software_version': 'str',
'software_revision': 'str', 'supportedENGINEs': ['str'],
--
To view, visit http://gerrit.ovirt.org/10144
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If6868f3947ade62dda7cb6265b0c9e50c2face94
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches