Dan Kenigsberg 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 <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/46269
Reviewed-by: Nir Soffer <[email protected]>
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <[email protected]>
Reviewed-by: Milan Zamazal <[email protected]>
Reviewed-by: Martin Polednik <[email protected]>
---
M tests/hoststatsTests.py
M tests/vmfakelib.py
M vdsm/virt/hoststats.py
M vdsm/virt/sampling.py
4 files changed, 73 insertions(+), 30 deletions(-)

Approvals:
  Nir Soffer: Looks good to me, but someone else must approve
  Roman Mohr: Verified
  Jenkins CI: Passed CI tests
  Francesco Romani: Looks good to me, approved
  Martin Polednik: Looks good to me, but someone else must approve
  Milan Zamazal: Looks good to me, but someone else must approve



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9c247f9138e02a9230a0849a04cb2e1705e7fac
Gerrit-PatchSet: 16
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Roman Mohr <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: Milan Zamazal <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roman Mohr <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: gerrit-hooks <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to