Francesco Romani has uploaded a new change for review.
Change subject: periodic: make ttl factors tunable
......................................................................
periodic: make ttl factors tunable
We don't know yet the right alchemy for the factors of the TTL formulas,
assuming one good universal formula ever exists.
So, to save some future headache, we expose them as tunable.
TODO: we should clearly mark those tunables as
- advanced/debugging, meaning "you don't usually need to change this"
- volatile, meaning "this may go away anytime once we figure this
out completely"
Change-Id: Id1e5448d244ab0411daf5155dce015b25c753978
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M lib/vdsm/config.py.in
M vdsm/virt/periodic.py
2 files changed, 21 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/47894/1
diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index 9ed11ff..079ef19 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -364,6 +364,11 @@
('periodic_task_per_worker', '100',
'Max number of tasks which can be queued on workers.'
' This is for internal usage and may change without warning'),
+
+ ('ttl_interval_pervm_mult', '4', ''),
+ ('ttl_interval_pervm_grace', '1', ''),
+ ('ttl_interval_bulk_mult', '2', ''),
+ ('ttl_interval_bulk_grace', '5', ''),
]),
# Section: [devel]
diff --git a/vdsm/virt/periodic.py b/vdsm/virt/periodic.py
index fd180c6..a1c4e7d 100644
--- a/vdsm/virt/periodic.py
+++ b/vdsm/virt/periodic.py
@@ -52,11 +52,21 @@
return interval / 2.
-def _ttl_from(interval):
+def _per_vm_ttl_from(interval):
"""
Estimate a sensible skip domain cache TTL given a periodic interval.
"""
- return interval * 4 + 1
+ return ((
+ config.getint('sampling', 'ttl_interval_per_vm_mult') * interval) +
+ config.getint('sampling', 'ttl_interval_per_vm_grace')
+ )
+
+
+def _bulk_ttl_from(interval):
+ return ((
+ config.getint('sampling', 'ttl_interval_bulk_mult') * interval) +
+ config.getint('sampling', 'ttl_interval_bulk_grace')
+ )
def start(cif, scheduler):
@@ -72,7 +82,7 @@
def per_vm_operation(func, period):
disp = VmDispatcher(
cif.getVMs, _executor, func,
- _timeout_from(period), _ttl_from(period))
+ _timeout_from(period), _per_vm_ttl_from(period))
return Operation(disp, period, scheduler)
_operations = [
@@ -99,7 +109,9 @@
sampling.VMBulkSampler(
libvirtconnection.get(cif),
cif.getVMs,
- sampling.stats_cache),
+ sampling.stats_cache,
+ ttl=_bulk_ttl_from(
+ config.getint('vars', 'vm_sample_interval'))),
config.getint('vars', 'vm_sample_interval'),
scheduler),
--
To view, visit https://gerrit.ovirt.org/47894
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id1e5448d244ab0411daf5155dce015b25c753978
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: lib: utils: consolidate Error class in one place
......................................................................
lib: utils: consolidate Error class in one place
Few utilities code have a duplicate Error exception, that
they raise when one command run through utils.execCmd fails.
Since this Error is closely related to utils.execCmd, we
remove the duplicate definition of Error and we move it
in one place, alogside execCmd itself.
Change-Id: Ia490c055e6e5c637eba82ccffb9d2dfc748db8f5
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M lib/vdsm/taskset.py
M lib/vdsm/udevadm.py
M lib/vdsm/utils.py
3 files changed, 16 insertions(+), 26 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/64/47964/1
diff --git a/lib/vdsm/taskset.py b/lib/vdsm/taskset.py
index 089d37b..2ec6a16 100644
--- a/lib/vdsm/taskset.py
+++ b/lib/vdsm/taskset.py
@@ -20,20 +20,9 @@
from __future__ import absolute_import
+from .utils import Error
from . import constants
from . import utils
-
-
-class Error(Exception):
-
- def __init__(self, rc, out, err):
- self.rc = rc
- self.out = out
- self.err = err
-
- def __str__(self):
- return "Process failed with rc=%d out=%r err=%r" % (
- self.rc, self.out, self.err)
def get(pid):
@@ -44,7 +33,7 @@
Return a frozenset of ints, each one being a cpu indices on which the
process can run.
Example: frozenset([0, 1, 2, 3])
- Raise taskset.Error on failure.
+ Raise Error on failure.
"""
command = [constants.EXT_TASKSET, '--pid', str(pid)]
@@ -64,7 +53,7 @@
<cpu_set> must be an iterable whose items are ints which represent
cpu indices, on which the process will be allowed to run; the format
is the same as what the get() function returns.
- Raise taskset.Error on failure.
+ Raise Error on failure.
"""
command = [constants.EXT_TASKSET]
if all_tasks:
diff --git a/lib/vdsm/udevadm.py b/lib/vdsm/udevadm.py
index 35970fe..e4e3a9c 100644
--- a/lib/vdsm/udevadm.py
+++ b/lib/vdsm/udevadm.py
@@ -20,21 +20,10 @@
from __future__ import absolute_import
import logging
+from .utils import Error
from . import utils
_UDEVADM = utils.CommandPath("udevadm", "/sbin/udevadm", "/usr/sbin/udevadm")
-
-
-class Error(Exception):
-
- def __init__(self, rc, out, err):
- self.rc = rc
- self.out = out
- self.err = err
-
- def __str__(self):
- return "Process failed with rc=%d out=%r err=%r" % (
- self.rc, self.out, self.err)
def settle(timeout, exit_if_exists=None):
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index 31d8529..d16f059 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -675,6 +675,18 @@
return p.returncode, out, err
+class Error(Exception):
+
+ def __init__(self, rc, out, err):
+ self.rc = rc
+ self.out = out
+ self.err = err
+
+ def __str__(self):
+ return "Process failed with rc=%d out=%r err=%r" % (
+ self.rc, self.out, self.err)
+
+
def stripNewLines(lines):
return [l[:-1] if l.endswith('\n') else l for l in lines]
--
To view, visit https://gerrit.ovirt.org/47964
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia490c055e6e5c637eba82ccffb9d2dfc748db8f5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: lib: sparsify: use common Error class
......................................................................
lib: sparsify: use common Error class
the virtsparsify module used a slightly variant
of the now-common Error class.
This patch makes it conform to the common API,
and use the common implementation, reducing duplication.
Change-Id: I1cd56e513d99c82f237fb53876b6ced8fbebfde4
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M lib/vdsm/virtsparsify.py
1 file changed, 3 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/65/47965/1
diff --git a/lib/vdsm/virtsparsify.py b/lib/vdsm/virtsparsify.py
index 1399167..187e3bd 100644
--- a/lib/vdsm/virtsparsify.py
+++ b/lib/vdsm/virtsparsify.py
@@ -21,20 +21,12 @@
from __future__ import absolute_import
import signal
+from .utils import Error
from . import utils
# Fedora, EL6
_VIRTSPARSIFY = utils.CommandPath("virt-sparsify",
"/usr/bin/virt-sparsify",)
-
-
-class Error(Exception):
- def __init__(self, ecode, stderr):
- self.ecode = ecode
- self.stderr = stderr
-
- def __str__(self):
- return "[Error %d] %s" % (self.ecode, self.stderr)
def sparsify(src_vol, tmp_vol, dst_vol, src_format=None, dst_format=None):
@@ -58,7 +50,7 @@
cmd.extend((src_vol, dst_vol))
- rc, _, err = utils.execCmd(cmd, deathSignal=signal.SIGKILL)
+ rc, out, err = utils.execCmd(cmd, deathSignal=signal.SIGKILL)
if rc != 0:
- raise Error(rc, err)
+ raise Error(rc, out, err)
--
To view, visit https://gerrit.ovirt.org/47965
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1cd56e513d99c82f237fb53876b6ced8fbebfde4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Nir Soffer has posted comments on this change.
Change subject: Introduce VolumeArtifacts
......................................................................
Patch Set 1: Code-Review-1
(4 comments)
I like this, needs more time to review properly.
https://gerrit.ovirt.org/#/c/48097/1/vdsm/storage/fileVolume.py
File vdsm/storage/fileVolume.py:
Line 54: class FileVolumeArtifacts(volume.VolumeArtifacts):
Line 55: def __init__(self, domain_manifest, img_id, vol_id):
Line 56: super(FileVolumeArtifacts, self).__init__(
Line 57: domain_manifest, img_id, vol_id)
Line 58: self._oop = domain_manifest.oop
Why do you want to copy the manifest oop here?
Define a property to access it instead. Otherwise we will have new entry in each instance dict for this.
Line 59: self._artifacts_path = None
Line 60:
Line 61: def create(self, size, vol_format, disk_type, desc, parent_vol_id=None):
Line 62: self._create_artifacts_path()
https://gerrit.ovirt.org/#/c/48097/1/vdsm/storage/volume.py
File vdsm/storage/volume.py:
Line 164: TYPE_PATH = "path"
Line 165: TYPE_NETWORK = "network"
Line 166:
Line 167:
Line 168: class VolumeArtifactsNotFound(Exception):
Can't we use existing exceptions in storage_exceptions?
Line 169: pass
Line 170:
Line 171:
Line 172: class CannotCreateVolumeArtifacts(Exception):
Line 172: class CannotCreateVolumeArtifacts(Exception):
Line 173: pass
Line 174:
Line 175:
Line 176: class VolumeArtifacts(object):
This looks like an interface - do we really want to keep instance variables here?
Line 177: def __init__(self, domain_manifest, img_id, vol_id):
Line 178: self.domain_manifest = domain_manifest
Line 179: self.img_id = img_id
Line 180: self.vol_id = vol_id
Line 177: def __init__(self, domain_manifest, img_id, vol_id):
Line 178: self.domain_manifest = domain_manifest
Line 179: self.img_id = img_id
Line 180: self.vol_id = vol_id
Line 181: self.log = logging.getLogger('Storage.VolumeArtifacts')
log must be class attribute, otherwise you are creating new logger for each instance - these loggers are *never* deleted from logging.
Line 182:
Line 183: def create(self, size, vol_format, disk_type, desc, parent_vol_id=None):
Line 184: raise NotImplementedError()
Line 185:
--
To view, visit https://gerrit.ovirt.org/48097
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I352423e39a899b9b83ccf3b8f6c17ec433e9c353
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
automation(a)ovirt.org has posted comments on this change.
Change subject: WIP: DON'T MERGE
......................................................................
Patch Set 3:
* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
--
To view, visit https://gerrit.ovirt.org/48151
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic14ae80c9752574d5895aae39b4809923ec8188f
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
Francesco Romani has uploaded a new change for review.
Change subject: migration: make stop() update internal status
......................................................................
migration: make stop() update internal status
The SourceThread.stop() operation should update
the internal status accordingly in case of success.
Previously, it was the caller that updated the status (!)
adding unneeded coupling.
Change-Id: I0ab50fc789dde969b2fb9ab969241ed4ad12545c
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/migration.py
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/40520/1
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index 1eaed05..61d5a7b 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -371,6 +371,10 @@
except libvirt.libvirtError:
if not self._preparingMigrationEvt:
raise
+ else:
+ self.status['status']['message'] = \
+ 'Migration process cancelled'
+ return self.status
def exponential_downtime(downtime, steps):
--
To view, visit https://gerrit.ovirt.org/40520
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ab50fc789dde969b2fb9ab969241ed4ad12545c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>