Change in vdsm[master]: periodic: make ttl factors tunable
by fromani@redhat.com
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>
8 years, 7 months
Change in vdsm[master]: lib: utils: consolidate Error class in one place
by fromani@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>
8 years, 7 months
Change in vdsm[master]: lib: sparsify: use common Error class
by fromani@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>
8 years, 7 months
Change in vdsm[master]: Introduce VolumeArtifacts
by Nir Soffer
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
8 years, 7 months
Change in vdsm[master]: janitorial: sslutils, kaxmlrpclib: drop python-2.6-specific ...
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: janitorial: sslutils, kaxmlrpclib: drop python-2.6-specific code
......................................................................
janitorial: sslutils, kaxmlrpclib: drop python-2.6-specific code
Change-Id: Icdb4ba3a52a144d7d28d9d8adf36e8b0621f10dd
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/sslutils.py
M vdsm/kaxmlrpclib.py
2 files changed, 12 insertions(+), 64 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/64/40964/1
diff --git a/lib/vdsm/sslutils.py b/lib/vdsm/sslutils.py
index 4b863a7..7e9319a 100644
--- a/lib/vdsm/sslutils.py
+++ b/lib/vdsm/sslutils.py
@@ -112,52 +112,13 @@
self._timeout = timeout
def make_connection(self, host):
- """Return VerifyingHTTPS object that is aware of ca_certs, and will
- create VerifyingHTTPSConnection.
- In Python 2.7, return VerifyingHTTPSConnection object
- """
+ """Return a VerifyingHTTPSConnection object"""
chost, self._extra_headers, x509 = self.get_host_info(host)
- if hasattr(xmlrpclib.SafeTransport, "single_request"): # Python 2.7
- return VerifyingHTTPSConnection(
- chost, None, key_file=self.key_file, strict=None,
- cert_file=self.cert_file, timeout=self._timeout,
- ca_certs=self.ca_certs,
- cert_reqs=self.cert_reqs)
- else:
- return VerifyingHTTPS(
- chost, None, key_file=self.key_file,
- cert_file=self.cert_file, timeout=self._timeout,
- ca_certs=self.ca_certs,
- cert_reqs=self.cert_reqs)
-
-
-class VerifyingHTTPS(httplib.HTTPS):
- _connection_class = VerifyingHTTPSConnection
-
- def __init__(self, host='', port=None, key_file=None, cert_file=None,
- strict=None, timeout=SOCKET_DEFAULT_TIMEOUT,
- ca_certs=None, cert_reqs=ssl.CERT_REQUIRED):
- """A ca_cert-aware HTTPS object,
- that creates a VerifyingHTTPSConnection
- """
- # provide a default host, pass the X509 cert info
-
- # urf. compensate for bad input.
- if port == 0:
- port = None
- self._setup(self._connection_class(host=host,
- port=port,
- key_file=key_file,
- cert_file=cert_file,
- strict=strict,
- timeout=timeout,
- ca_certs=ca_certs,
- cert_reqs=cert_reqs))
-
- # we never actually use these for anything, but we keep them
- # here for compatibility with post-1.5.2 CVS.
- self.key_file = key_file
- self.cert_file = cert_file
+ return VerifyingHTTPSConnection(
+ chost, None, key_file=self.key_file, strict=None,
+ cert_file=self.cert_file, timeout=self._timeout,
+ ca_certs=self.ca_certs,
+ cert_reqs=self.cert_reqs)
class SSLHandshakeDispatcher(object):
diff --git a/vdsm/kaxmlrpclib.py b/vdsm/kaxmlrpclib.py
index 6374726..e5ff677 100644
--- a/vdsm/kaxmlrpclib.py
+++ b/vdsm/kaxmlrpclib.py
@@ -57,10 +57,7 @@
class TcpkeepTransport(xmlrpclib.Transport):
def make_connection(self, host):
- if hasattr(xmlrpclib.Transport, "single_request"): # Python 2.7
- return TcpkeepHTTPConnection(host)
- else:
- return TcpkeepHTTP(host)
+ return TcpkeepHTTPConnection(host)
class TcpkeepHTTPConnection(httplib.HTTPConnection):
@@ -126,17 +123,11 @@
def make_connection(self, host):
chost, self._extra_headers, x509 = self.get_host_info(host)
- if hasattr(xmlrpclib.SafeTransport, "single_request"): # Python 2.7
- return TcpkeepHTTPSConnection(
- chost, None, key_file=self.key_file, strict=None,
- timeout=CONNECTTIMEOUT,
- cert_file=self.cert_file, ca_certs=self.ca_certs,
- cert_reqs=self.cert_reqs)
- else:
- return TcpkeepHTTPS(
- chost, None, key_file=self.key_file,
- cert_file=self.cert_file, ca_certs=self.ca_certs,
- cert_reqs=self.cert_reqs)
+ return TcpkeepHTTPSConnection(
+ chost, None, key_file=self.key_file, strict=None,
+ timeout=CONNECTTIMEOUT,
+ cert_file=self.cert_file, ca_certs=self.ca_certs,
+ cert_reqs=self.cert_reqs)
class TcpkeepHTTPSConnection(sslutils.VerifyingHTTPSConnection):
@@ -158,7 +149,3 @@
self.sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPIDLE, KEEPIDLE)
self.sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPINTVL, KEEPINTVL)
self.sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPCNT, KEEPCNT)
-
-
-class TcpkeepHTTPS(sslutils.VerifyingHTTPS):
- _connection_class = TcpkeepHTTPSConnection
--
To view, visit https://gerrit.ovirt.org/40964
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icdb4ba3a52a144d7d28d9d8adf36e8b0621f10dd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
8 years, 7 months
Change in vdsm[master]: tests: functional - convert to run over jsonrpc
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: tests: functional - convert to run over jsonrpc
......................................................................
tests: functional - convert to run over jsonrpc
will run functional tests by default over jsonrpc
Change-Id: Iaba1e2811f010e4509a658acef8040ad8f39cece
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/jsonrpcvdscli.py
M lib/vdsm/response.py
M tests/functional/utils.py
3 files changed, 58 insertions(+), 16 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/45789/1
diff --git a/lib/vdsm/jsonrpcvdscli.py b/lib/vdsm/jsonrpcvdscli.py
index 21e135c..606bbef 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -33,17 +33,34 @@
_COMMAND_CONVERTER = {
- 'ping': 'Host.ping',
+ 'addNetwork': 'Host.addNetwork',
+ 'create': 'VM.create',
+ 'delNetwork': 'Host.delNetwork',
'destroy': 'VM.destroy',
+ 'editNetwork': 'Host.editNetwork',
+ 'fullList': 'Host.getVMFullList',
+ 'getAllVmStats': 'Host.getAllVmStats',
+ 'getVdsCapabilities': 'Host.getCapabilities',
+ 'getVdsStats': 'Host.getStats',
'getVmStats': 'VM.getStats',
+ 'list': 'Host.getVMList',
'migrationCreate': 'VM.migrationCreate',
+ 'ping': 'Host.ping',
+ 'setBalloonTarget': 'VM.setBalloonTarget',
+ 'setCpuTunePeriod': 'VM.setCpuTunePeriod',
+ 'setCpuTuneQuota': 'VM.setCpuTuneQuota',
+ 'setMOMPolicy': 'Host.setMOMPolicy',
+ 'setSafeNetworkConfig': 'Host.setSafeNetworkConfig',
+ 'setupNetworks': 'Host.setupNetworks',
+ 'updateVmPolicy': 'VM.updateVmPolicy',
}
class _Server(object):
- def __init__(self, client):
+ def __init__(self, client, compat):
self._client = client
+ self._compat = compat
def _callMethod(self, methodName, *args):
try:
@@ -64,6 +81,9 @@
return response.error_raw(resp.error["code"],
resp.error["message"])
+ if not self._compat:
+ return response.success_raw(resp.result)
+
if resp.result and resp.result is not True:
# None is translated to True inside our JSONRPC implementation
return response.success(**resp.result)
@@ -72,6 +92,11 @@
def migrationCreate(self, params):
return self._callMethod('migrationCreate',
+ params['vmId'],
+ params)
+
+ def create(self, params):
+ return self._callMethod('create',
params['vmId'],
params)
@@ -107,7 +132,7 @@
def connect(requestQueue, stompClient=None,
host=None, port=None,
useSSL=None,
- responseQueue=None):
+ responseQueue=None, compat=True):
if not stompClient:
client = _create(requestQueue,
host, port, useSSL,
@@ -119,4 +144,4 @@
str(uuid4())
)
- return _Server(client)
+ return _Server(client, compat)
diff --git a/lib/vdsm/response.py b/lib/vdsm/response.py
index 62ed49e..160898f 100644
--- a/lib/vdsm/response.py
+++ b/lib/vdsm/response.py
@@ -41,6 +41,21 @@
return kwargs
+def success_raw(result=None, message=None):
+ ret = {
+ 'status':
+ {
+ "code": doneCode["code"],
+ "message": message or doneCode["message"],
+ }
+ }
+
+ if result:
+ ret['result'] = result
+
+ return ret
+
+
def error(name, message=None):
status = errCode[name]["status"]
return {
diff --git a/tests/functional/utils.py b/tests/functional/utils.py
index 6bd8dd9..b8bdce6 100644
--- a/tests/functional/utils.py
+++ b/tests/functional/utils.py
@@ -26,9 +26,9 @@
from vdsm.config import config
from vdsm.utils import retry
from vdsm import ipwrapper
+from vdsm import jsonrpcvdscli
from vdsm import netinfo
from vdsm import supervdsm
-from vdsm import vdscli
from vdsm.netconfpersistence import RunningConfig
@@ -71,7 +71,9 @@
retry(self.start, (socket.error, KeyError), tries=30)
def start(self):
- self.vdscli = vdscli.connect()
+ requestQueues = config.get('addresses', 'request_queues')
+ requestQueue = requestQueues.split(",")[0]
+ self.vdscli = jsonrpcvdscli.connect(requestQueue, compat=False)
self.netinfo = self._get_netinfo()
if config.get('vars', 'net_persistence') == 'unified':
self.config = RunningConfig()
@@ -204,40 +206,40 @@
def getVdsStats(self):
result = self.vdscli.getVdsStats()
- return _parse_result(result, 'info')
+ return _parse_result(result, True)
def getAllVmStats(self):
result = self.vdscli.getAllVmStats()
- return _parse_result(result, 'statsList')
+ return _parse_result(result, True)
def getVmStats(self, vmId):
result = self.vdscli.getVmStats(vmId)
- if 'statsList' in result:
- code, msg, stats = _parse_result(result, 'statsList')
+ if 'result' in result:
+ code, msg, stats = _parse_result(result, True)
return code, msg, stats[0]
else:
return _parse_result(result)
def getVmList(self, vmId):
- result = self.vdscli.list('true', [vmId])
- code, msg, vm_list = _parse_result(result, 'vmList')
+ result = self.vdscli.fullList([vmId])
+ code, msg, vm_list = _parse_result(result, True)
return code, msg, vm_list[0]
def getVdsCapabilities(self):
result = self.vdscli.getVdsCapabilities()
- return _parse_result(result, 'info')
+ return _parse_result(result, True)
def updateVmPolicy(self, vmId, vcpuLimit):
result = self.vdscli.updateVmPolicy([vmId, vcpuLimit])
return _parse_result(result)
-def _parse_result(result, return_value=None):
+def _parse_result(result, return_value=False):
status = result['status']
code = status['code']
msg = status['message']
- if code == SUCCESS and return_value is not None:
- return code, msg, result[return_value]
+ if code == SUCCESS and return_value:
+ return code, msg, result['result']
else:
return code, msg
--
To view, visit https://gerrit.ovirt.org/45789
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaba1e2811f010e4509a658acef8040ad8f39cece
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
8 years, 7 months
Change in vdsm[master]: WIP: DON'T MERGE
by automation@ovirt.org
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
8 years, 7 months
Change in vdsm[master]: v2v: janitorial: use the response module
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: v2v: janitorial: use the response module
......................................................................
v2v: janitorial: use the response module
This patch makes v2v.py use the response module.
Change-Id: I678e764a2895e7c34df6852759b1d43baeb687a1
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/v2v.py
1 file changed, 4 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/38447/1
diff --git a/vdsm/v2v.py b/vdsm/v2v.py
index 4fbecf0..18f59d9 100644
--- a/vdsm/v2v.py
+++ b/vdsm/v2v.py
@@ -22,8 +22,8 @@
import libvirt
-from vdsm.define import errCode, doneCode
from vdsm import libvirtconnection
+from vdsm import response
import caps
@@ -39,7 +39,7 @@
def get_external_vms(uri, username, password):
if not supported():
- return errCode["noimpl"]
+ return response.error("noimpl")
try:
conn = libvirtconnection.open_connection(uri=uri,
@@ -47,8 +47,7 @@
passwd=password)
except libvirt.libvirtError as e:
logging.error('error connection to hypervisor: %r', e.message)
- return {'status': {'code': errCode['V2VConnection']['status']['code'],
- 'message': e.message}}
+ return response.error('V2VConnection', e.message)
with closing(conn):
vms = []
@@ -67,7 +66,7 @@
for disk in params['disks']:
_add_disk_info(conn, disk)
vms.append(params)
- return {'status': doneCode, 'vmList': vms}
+ return response.success(vmList=vms)
def _mem_to_mib(size, unit):
--
To view, visit https://gerrit.ovirt.org/38447
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I678e764a2895e7c34df6852759b1d43baeb687a1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
8 years, 7 months
Change in vdsm[master]: daemon: tracemalloc: LD_PRELOAD support
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: daemon: tracemalloc: LD_PRELOAD support
......................................................................
daemon: tracemalloc: LD_PRELOAD support
In order to integrate tracemalloc, we may need a special-purpose
libpython. This change makes it easy to use it into VDSM.
Change-Id: I3b26a4d156394631345b0a60f212effdaef48503
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M .gitignore
M debian/vdsm.install
M init/Makefile.am
M init/systemd/vdsmd.service.in
A init/vdsmd.in
M vdsm.spec.in
6 files changed, 18 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/47623/1
diff --git a/.gitignore b/.gitignore
index 3c6c9e8..8c4afda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,7 @@
init/systemd/vdsm-network.service
init/systemd/mom-vdsm.service
init/vdsmd_init_common.sh
+init/vdsmd
lib/vdsm/config.py
lib/vdsm/constants.py
lib/vdsm/tool/validate_ovirt_certs.py
diff --git a/debian/vdsm.install b/debian/vdsm.install
index c9666f5..117b867 100644
--- a/debian/vdsm.install
+++ b/debian/vdsm.install
@@ -31,6 +31,7 @@
./usr/libexec/vdsm/unpersist-vdsm-hook
./usr/libexec/vdsm/vdsm-gencerts.sh
./usr/libexec/vdsm/vdsmd_init_common.sh
+./usr/bin/vdsmd
./usr/share/man/man8/vdsmd.8
./usr/share/vdsm/API.py
./usr/share/vdsm/alignmentScan.py
diff --git a/init/Makefile.am b/init/Makefile.am
index 62a226b..69e2e2a 100644
--- a/init/Makefile.am
+++ b/init/Makefile.am
@@ -22,6 +22,10 @@
include $(top_srcdir)/build-aux/Makefile.subs
+bin_SCRIPTS = \
+ vdsmd \
+ $(NULL)
+
nodist_vdsmexec_SCRIPTS = \
vdsmd_init_common.sh \
$(NULL)
@@ -36,6 +40,7 @@
$(NULL)
EXTRA_DIST = \
+ vdsmd.in \
vdsmd_init_common.sh.in \
$(NULL)
diff --git a/init/systemd/vdsmd.service.in b/init/systemd/vdsmd.service.in
index d7d025f..1627af6 100644
--- a/init/systemd/vdsmd.service.in
+++ b/init/systemd/vdsmd.service.in
@@ -13,7 +13,7 @@
LimitCORE=infinity
EnvironmentFile=-/etc/sysconfig/vdsm
ExecStartPre=@LIBEXECDIR(a)/vdsmd_init_common.sh --pre-start
-ExecStart=@VDSMDIR@/daemonAdapter -0 /dev/null -1 /dev/null -2 /dev/null "@VDSMDIR@/vdsm"
+ExecStart=@BINDIR@/vdsmd
ExecStopPost=@LIBEXECDIR(a)/vdsmd_init_common.sh --post-stop
Restart=always
Nice=-20
diff --git a/init/vdsmd.in b/init/vdsmd.in
new file mode 100644
index 0000000..075fb79
--- /dev/null
+++ b/init/vdsmd.in
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+. /etc/sysconfig/vdsm
+
+if [ "$TRACEMALLOC" == "yes" ]; then
+ export LD_PRELOAD=@LIBDIR(a)/libpython2.7_tm.so
+fi
+
+exec @VDSMDIR@/daemonAdapter -0 /dev/null -1 /dev/null -2 /dev/null "@VDSMDIR@/vdsm"
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 32a1e38..d4b4d0f 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -862,6 +862,7 @@
%{_libexecdir}/%{vdsm_name}/ovirt_functions.sh
%{_libexecdir}/%{vdsm_name}/vdsm-gencerts.sh
%{_libexecdir}/%{vdsm_name}/vdsmd_init_common.sh
+%{_bindir}/vdsmd
%{_datadir}/%{vdsm_name}/network/__init__.py*
%{_datadir}/%{vdsm_name}/network/api.py*
%{_datadir}/%{vdsm_name}/network/configurators/__init__.py*
--
To view, visit https://gerrit.ovirt.org/47623
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b26a4d156394631345b0a60f212effdaef48503
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
8 years, 7 months
Change in vdsm[master]: migration: make stop() update internal status
by fromani@redhat.com
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>
8 years, 7 months