Change in vdsm[ovirt-3.6]: host stats: Collect stats from online cpu cores only

fromani at redhat.com fromani at redhat.com
Thu Apr 21 07:54:36 UTC 2016


Francesco Romani has submitted this change and it was merged.

Change subject: host stats: Collect stats from online cpu cores only
......................................................................


host stats: Collect stats from online cpu cores only

When a cpu goes offline while libvirtd is running, the getVdsStats call
still tries to collect sampling data for this CPU and fails with an
exception.

When vdsm is already running, it is enough to do something like

  echo 0 > /sys/devices/system/cpu/cpu2/online

to break getVdsStats.

When libvirtd is running and both CPUs are online, vdsm reports
stats for two cores:

 $ vdsClient -s 0 getVdsStats
        [...]
        cpuStatistics = {
                         '0': {'cpuIdle': '90.74',
                               'cpuSys': '1.40',
                               'cpuUser': '7.86',
                               'nodeIndex': 0},
                         '1': {'cpuIdle': '96.07',
                               'cpuSys': '0.47',
                               'cpuUser': '3.46',
                               'nodeIndex': 0}
                        }
        [...]

When only one CPU out of two has been online before libvirtd was
started, vdsm reports stats for the one online core:

 $ vdsClient -s 0 getVdsStats
        [...]
        cpuStatistics = {
                         '0': {'cpuIdle': '90.74',
                               'cpuSys': '1.40',
                               'cpuUser': '7.86',
                               'nodeIndex': 0}
                        }
        [...]

When one CPU went offline after libvirtd has been started, vdsm threw
an exception. With this patch getVdsStats reports only stats from the
remaining online CPU:

 $ vdsClient -s 0 getVdsStats
        [...]
        cpuStatistics = {
                         '0': {'cpuIdle': '90.74',
                               'cpuSys': '1.40',
                               'cpuUser': '7.86',
                               'nodeIndex': 0}
                        }
        [...]

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1264003
Change-Id: Ia9c247f9138e02a9230a0849a04cb2e1705e7fac
Signed-off-by: Roman Mohr <rmohr at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/46269
Reviewed-by: Nir Soffer <nsoffer at redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <fromani at redhat.com>
Reviewed-by: Milan Zamazal <mzamazal at redhat.com>
Reviewed-by: Martin Polednik <mpolednik at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/56188
---
M tests/samplingTests.py
M tests/vmfakelib.py
M vdsm/virt/sampling.py
3 files changed, 88 insertions(+), 39 deletions(-)

Approvals:
  Roman Mohr: Verified
  Jenkins CI: Passed CI tests
  Francesco Romani: Looks good to me, approved



-- 
To view, visit https://gerrit.ovirt.org/56188
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9c247f9138e02a9230a0849a04cb2e1705e7fac
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Roman Mohr <rmohr at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak at redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Roman Mohr <rmohr at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the vdsm-patches mailing list