Hello Nir Soffer, Dan Kenigsberg, Francesco Romani, Michal Skrivanek,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/30175

to review the following change.

Change subject: Collect current QoS settings for IO devices and report through 
RunningVmStats
......................................................................

Collect current QoS settings for IO devices and report through RunningVmStats

This info will be used by mom when updating the IO limits and by engine
to report the current QoS settings to the user.

Change-Id: Ie4fab132b60ce6ae2285115034f3d1ffcdca9e9d
Signed-off-by: Martin Sivak <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/28712
Reviewed-by: Michal Skrivanek <[email protected]>
Reviewed-by: Nir Soffer <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
Reviewed-by: Francesco Romani <[email protected]>
---
M vdsm/rpc/vdsmapi-schema.json
M vdsm/virt/vm.py
2 files changed, 47 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/30175/1

diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json
index 7cd8753..61f340d 100644
--- a/vdsm/rpc/vdsmapi-schema.json
+++ b/vdsm/rpc/vdsmapi-schema.json
@@ -2310,6 +2310,24 @@
           '*ioTune': 'VmDiskDeviceIoTuneParams'}}
 
 ##
+# @VmDiskDeviceTuneParams:
+#
+# Extra parameters for VM disk devices. At least one
+# device identifier (name/path) is needed.
+#
+# @name:    #optional The name of the taget device
+#
+# @path:    #optional The path of the taget device
+#
+# @ioTune:  IO tune parameters
+#
+# Since: 4.15.0
+##
+{'type': 'VmDiskDeviceTuneParams',
+ 'data': {'*name': 'str', '*path': 'str',
+          'ioTune': 'VmDiskDeviceIoTuneParams'}}
+
+##
 # @VmDiskDeviceVolumeChainEntry:
 #
 # Identifies one volume in a VM disk device volume chain.
@@ -6286,6 +6304,9 @@
 # @vcpuUserLimit:      #optional Cpu usage hard limit in percents.
 #                      (new in version 4.15.0)
 #
+# @ioTune:             #optional Current QoS settings for IO devices
+#                      (new in version 4.15.0)
+#
 # Since: 4.10.0
 ##
 {'type': 'RunningVmStats',
@@ -6309,7 +6330,8 @@
           'displayInfo': ['VmDisplayInfo'], '*vmJobs': 'VmJobsMap',
           '*vNodeRuntimeInfo': 'VmNumaNodeRuntimeInfoMap',
           'displayInfo': ['VmDisplayInfo'], '*vcpuQuota': 'int',
-          '*vcpuPeriod': 'int', '*vcpuCount': 'int', '*vcpuUserLimit': 'int'}}
+          '*vcpuPeriod': 'int', '*vcpuCount': 'int', '*vcpuUserLimit': 'int',
+          '*ioTune': ['VmDiskDeviceTuneParams']}}
 
 ##
 # @VmStats:
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index d117479..ac61cf6 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -347,6 +347,29 @@
 
         return infos
 
+    def _getIoTuneStats(self, stats):
+        """
+        Collect the current ioTune settings for all disks VDSM knows about.
+
+        This assumes VDSM always has the correct info and nobody else is
+        touching the device without telling VDSM about it.
+
+        TODO: We might want to move to XML parsing (first update) and events
+        once libvirt supports them:
+        https://bugzilla.redhat.com/show_bug.cgi?id=1114492
+        """
+        ioTuneInfo = []
+
+        for disk in self._vm._devices[DISK_DEVICES]:
+            if "ioTune" in disk.specParams:
+                ioTuneInfo.append({
+                    "name": disk.name,
+                    "path": disk.path,
+                    "ioTune": disk.specParams["ioTune"]
+                })
+
+        stats['ioTune'] = ioTuneInfo
+
     def _diff(self, prev, curr, val):
         return prev[val] - curr[val]
 
@@ -588,6 +611,7 @@
         self._getCpuTuneInfo(stats)
         self._getCpuCount(stats)
         self._getUserCpuTuneInfo(stats)
+        self._getIoTuneStats(stats)
 
         return stats
 


-- 
To view, visit http://gerrit.ovirt.org/30175
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4fab132b60ce6ae2285115034f3d1ffcdca9e9d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Martin Sivák <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to