Change in vdsm[master]: config: warn about meaningless sampling windows

fromani at redhat.com fromani at redhat.com
Fri Oct 3 16:02:29 UTC 2014


Francesco Romani has uploaded a new change for review.

Change subject: config: warn about meaningless sampling windows
......................................................................

config: warn about meaningless sampling windows

For some samplings, a window size different from
one was never supported, and exposed to configuration
by accident. Any value was silently ignored.

This patch adds a one-time warning if an user
change the default values, to avoid surprising
behaviour and to increase a little bit
the user friendliness of VDSM.

Once we are allowed to break compatibility,
we can get rid of these settings as well as
this patch.

Change-Id: I1a5a33da4194ff600824434d319c91b9dacc9f8c
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/vdsm
M vdsm/virt/sampling.py
2 files changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/84/33784/1

diff --git a/vdsm/vdsm b/vdsm/vdsm
index e575295..cd5eea7 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -34,6 +34,7 @@
 from vdsm.config import config
 from vdsm import libvirtconnection
 from vdsm import profile
+from vdsm.virt import sampling
 
 from storage.dispatcher import Dispatcher
 from storage.hsm import HSM
@@ -68,6 +69,8 @@
     signal.signal(signal.SIGUSR1, sigusr1Handler)
     zombiereaper.registerSignalHandler()
 
+    sampling.validate(config)
+
     profile.start()
 
     libvirtconnection.start_event_loop()
diff --git a/vdsm/virt/sampling.py b/vdsm/virt/sampling.py
index 4038de1..127000f 100644
--- a/vdsm/virt/sampling.py
+++ b/vdsm/virt/sampling.py
@@ -685,6 +685,15 @@
         return stats
 
 
+def validate(conf):
+    for setting in ('balloon', 'jobs', 'vcpu_pin', 'cpu_tune'):
+        name = 'vm_sample_%s_window' % setting
+        window_size = conf.getint('vars', name)
+        if window_size != 1:
+            logging.warn("value of %d for setting '%s' is unsupported "
+                         "forced to 1")
+
+
 def _getLinkSpeed(dev):
     if dev.isNIC():
         speed = netinfo.nicSpeed(dev.name)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a5a33da4194ff600824434d319c91b9dacc9f8c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list