Change in vdsm[master]: api: Make remove optional
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: api: Make remove optional
......................................................................
api: Make remove optional
According to the scheama, the "remove" argument in
StoragePool.disconnect is optional, but in API it is defined as
positional argument and requires a value.
This error was probbaly hidden by the fact that engine send False when
using xmlprc. But when using jsonrpc the this cause the method to call
to fail, which eventually cause host to be stuck in "Unassigned" state
in the engine side. This fix the error on the vdsm side.
Change-Id: Ia6948e4fd1ddefd7e33406a214f0cbfe301c958b
Bug-Url: https://bugzilla.redhat.com/1115033
Relates-to: https://bugzilla.redhat.com/1115044
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/API.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/65/29465/1
diff --git a/vdsm/API.py b/vdsm/API.py
index e739294..ace68d1 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1034,7 +1034,7 @@
def destroy(self, hostID, deprecatedSCSIKey):
return self._irs.destroyStoragePool(self._UUID, hostID)
- def disconnect(self, hostID, deprecatedSCSIKey, remove):
+ def disconnect(self, hostID, deprecatedSCSIKey, remove=False):
return self._irs.disconnectStoragePool(self._UUID, hostID, remove)
def disconnectStorageServer(self, domainType, connectionParams):
--
To view, visit http://gerrit.ovirt.org/29465
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6948e4fd1ddefd7e33406a214f0cbfe301c958b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
8 years, 9 months
Change in vdsm[master]: sd: fix volume path returned by linkBCImage
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: sd: fix volume path returned by linkBCImage
......................................................................
sd: fix volume path returned by linkBCImage
In a previous commit (c072945 One shot prepare) we involuntarily
changed the path used for virtual machine images from:
/rhev/data-center/<spUUID>/<sdUUID>/images/<imgUUID>/<volUUID>
to:
/rhev/data-center/mnt/blockSD/<sdUUID>/images/<imgUUID>/<volUUID>
This patch reverts to the previous path in order to minimize the
differences between different versions of vdsm that could lead to
live migration issues, e.g.
libvirtError: invalid argument: invalid path ... not assigned to
domain
Change-Id: Iea497b574d9a9a7e0e9b8e234e2bd9b9d983a60c
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1059482
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/blockSD.py
M vdsm/storage/fileSD.py
M vdsm/storage/sd.py
3 files changed, 8 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/24315/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 5179c5a..587e617 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -1053,8 +1053,7 @@
return rems
def linkBCImage(self, imgPath, imgUUID):
- dst = os.path.join(self.mountpoint, self.sdUUID, sd.DOMAIN_IMAGES,
- imgUUID)
+ dst = self.getLinkBCImagePath(imgUUID)
try:
os.symlink(imgPath, dst)
except OSError as e:
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index 180a43f..0f52718 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -422,8 +422,8 @@
for k, v in volumes.iteritems())
def linkBCImage(self, imgPath, imgUUID):
- return os.path.join(self.mountpoint, self.sdUUID, sd.DOMAIN_IMAGES,
- imgUUID)
+ # Nothing to do here other than returning the path
+ return self.getLinkBCImagePath(imgUUID)
def createImageLinks(self, srcImgPath, imgUUID):
"""
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index c9738e0..fd4c9db 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -25,6 +25,7 @@
from collections import namedtuple
import codecs
+import image
import storage_exception as se
import misc
import resourceFactories
@@ -643,6 +644,10 @@
# If it has a repo we don't have multiple domains. Assume single pool
return os.path.join(self.storage_repository, self.getPools()[0])
+ def getLinkBCImagePath(self, imgUUID):
+ return image.Image(self._getRepoPath()) \
+ .getImageDir(self.sdUUID, imgUUID)
+
def getIsoDomainImagesDir(self):
"""
Get 'images' directory from Iso domain
--
To view, visit http://gerrit.ovirt.org/24315
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea497b574d9a9a7e0e9b8e234e2bd9b9d983a60c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
8 years, 9 months
Change in vdsm[master]: ipwrapper: do not report devices that disappear
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: ipwrapper: do not report devices that disappear
......................................................................
ipwrapper: do not report devices that disappear
There was a race in getLinks that consisted on devices disappearing
between them being reported by netlink and information being
retrieved by the Link class (driver info).
This patch solves it by reporting just those links that suceed.
Change-Id: Ib41336f3ac2f2278db2706f7d4eb3a9b579f66d4
Bug-Url: https://bugzilla.redhat.com/1113948
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M lib/vdsm/ipwrapper.py
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/29442/1
diff --git a/lib/vdsm/ipwrapper.py b/lib/vdsm/ipwrapper.py
index b1dd83d..cd4b7d4 100644
--- a/lib/vdsm/ipwrapper.py
+++ b/lib/vdsm/ipwrapper.py
@@ -286,7 +286,13 @@
def getLinks():
"""Returns a list of Link objects for each link in the system."""
- return [Link.fromDict(data) for data in netlink.iter_links()]
+ links = []
+ for data in netlink.iter_links():
+ try:
+ links.append(Link.fromDict(data))
+ except IOError: # If a link goes missing we just don't report it
+ continue
+ return links
def getLink(dev):
--
To view, visit http://gerrit.ovirt.org/29442
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib41336f3ac2f2278db2706f7d4eb3a9b579f66d4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
8 years, 9 months
Change in vdsm[master]: bridge: Show more info when method call fail
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: bridge: Show more info when method call fail
......................................................................
bridge: Show more info when method call fail
When the bridge try to run a method dynamically and the number of
arguments does not match the function definition, we get an unhelpful
TypeError. Now a more specific and verbose error is raised:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/yajsonrpc/__init__.py", line 480, in _serveRequest
res = method(**params)
File "/usr/share/vdsm/rpc/Bridge.py", line 252, in _dynamicMethod
raise InvalidCall(fn, methodArgs, e)
InvalidCall: Attempt to call function <bound method StoragePool.disconnect
of <API.StoragePool object at 0x7ff6405a9c50>> with arguments (1,
u'2440ff3d-275f-42e6-b204-7d055b26b174'): disconnect() takes exactly 4
arguments (3 given)
(Traceback lines wrapped for the commit message)
Change-Id: I9ec0a745ec65d3994e06a0b72ded9b7bbe55b1ae
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/rpc/Bridge.py
1 file changed, 16 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/29457/1
diff --git a/vdsm/rpc/Bridge.py b/vdsm/rpc/Bridge.py
index 7e898de..9d37e3b 100644
--- a/vdsm/rpc/Bridge.py
+++ b/vdsm/rpc/Bridge.py
@@ -36,6 +36,18 @@
self.message = message
+class InvalidCall(Exception):
+
+ def __init__(self, function, kwargs, error):
+ self.function = function
+ self.kwargs = kwargs
+ self.error = error
+
+ def __str__(self):
+ return ("Attempt to call function %s with arguments %s: %s" %
+ (self.function, self.kwargs, self.error))
+
+
class DynamicBridge(object):
def __init__(self):
self.api = vdsmapi.get_api()
@@ -236,7 +248,10 @@
result = fn(api, argobj)
else:
fn = getattr(api, methodName)
- result = fn(*methodArgs)
+ try:
+ result = fn(*methodArgs)
+ except TypeError as e:
+ raise InvalidCall(fn, methodArgs, e)
if result['status']['code']:
code = result['status']['code']
--
To view, visit http://gerrit.ovirt.org/29457
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ec0a745ec65d3994e06a0b72ded9b7bbe55b1ae
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
8 years, 9 months
Change in vdsm[master]: vdsm: lastclient info in jsonrpc
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: vdsm: lastclient info in jsonrpc
......................................................................
Patch Set 9:
(1 comment)
http://gerrit.ovirt.org/#/c/28817/9/vdsm/rpc/Bridge.py
File vdsm/rpc/Bridge.py:
Line 253:
Line 254: retfield = command_info.get(cmd, {}).get('ret')
Line 255: if isinstance(retfield, types.FunctionType):
Line 256: if cmd == 'Host_getCapabilities':
Line 257: ret = retfield(self._threadLocal.ctx, result)
> Correct if the code is part of Bridge class which is not true for Host_getC
Right - I was fooled by gerrit. So this show that conversion functions need to be part of the bridge, or get some context.
Please do not add context for specific method, instead have a simple design that works for any case. So either all functions get the context, or they should be bridge methods, or all of them belong to some other object that have this context.
Line 258: else:
Line 259: ret = retfield(result)
Line 260: elif _glusterEnabled and className.startswith('Gluster'):
Line 261: ret = dict([(key, value) for key, value in result.items()
--
To view, visit http://gerrit.ovirt.org/28817
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I402e15cb05f89a98dab14491d9da5985335e095e
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
8 years, 9 months
Change in vdsm[ovirt-3.5]: Add missing validateQemuReadable to oop
by ykaplan@redhat.com
Hello Federico Simoncelli, Yedidyah Bar David, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/29425
to review the following change.
Change subject: Add missing validateQemuReadable to oop
......................................................................
Add missing validateQemuReadable to oop
Change-Id: I6598619c7acd18e41b51c15018627973f1eb263a
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1114499
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/29398
Reviewed-by: Federico Simoncelli <fsimonce(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
Tested-by: Yedidyah Bar David <didi(a)redhat.com>
---
M vdsm/storage/outOfProcess.py
1 file changed, 13 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/29425/1
diff --git a/vdsm/storage/outOfProcess.py b/vdsm/storage/outOfProcess.py
index 77f40aa..9003f40 100644
--- a/vdsm/storage/outOfProcess.py
+++ b/vdsm/storage/outOfProcess.py
@@ -18,12 +18,14 @@
# Refer to the README and COPYING files for full details of the license
#
import errno
+import grp
import logging
import os
import stat
import sys
import types
+from vdsm import constants
from vdsm.config import config
import threading
from functools import partial
@@ -176,6 +178,17 @@
def pathExists(self, filename, writable=False):
return self._iop.pathExists(filename, writable)
+ def validateQemuReadable(self, targetPath):
+ """
+ Validate that qemu process can read file
+ """
+ gids = (grp.getgrnam(constants.DISKIMAGE_GROUP).gr_gid,
+ grp.getgrnam(constants.METADATA_GROUP).gr_gid)
+ st = _IOProcessOs(self._iop).stat(targetPath)
+ if not (st.st_gid in gids and st.st_mode & stat.S_IRGRP or
+ st.st_mode & stat.S_IROTH):
+ raise OSError(errno.EACCES, os.strerror(errno.EACCES))
+
class _IOProcessOs(object):
def __init__(self, iop):
--
To view, visit http://gerrit.ovirt.org/29425
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6598619c7acd18e41b51c15018627973f1eb263a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Yedidyah Bar David <didi(a)redhat.com>
8 years, 9 months
Change in vdsm[master]: virt: move XML processing in a module
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: virt: move XML processing in a module
......................................................................
Patch Set 2: Code-Review-1
Ack from me for the general split; the module and class names are not very pretty, but I do not have any better suggestion... So just make it public.
--
To view, visit http://gerrit.ovirt.org/26855
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I77dd048067b8abcb77f4b9bf55fbfd0535672996
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpoledni(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
8 years, 9 months
Change in vdsm[master]: virt: move XML processing in a module
by fromani@redhat.com
Francesco Romani has posted comments on this change.
Change subject: virt: move XML processing in a module
......................................................................
Patch Set 2:
Just to explain my (bad) joke: 'notes to self' because I was reviewing a patch which I started - so I'm actually criticizing my own work :)
--
To view, visit http://gerrit.ovirt.org/26855
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I77dd048067b8abcb77f4b9bf55fbfd0535672996
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpoledni(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
8 years, 9 months
Change in vdsm[master]: vm: add direct import of advancedstats helpers
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vm: add direct import of advancedstats helpers
......................................................................
vm: add direct import of advancedstats helpers
This is purely a transitional patch towards
the move of VmStatsThread from vm.py to sampling.py.
This patch adds directly import of the VmStatsThread
dependencies, in order to make the move of such class
exactly a trivial matter of cut/paste plus fixing imports,
with exactly zero changes needed to VmStatsThread itself.
Thus the final patch will be more easily
verifiable.
Change-Id: I6b009f4a0cb0179fa1f1b74774ba61fd6638d8a9
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 10 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/80/28480/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 0e6f291..3b8a16b 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -45,6 +45,7 @@
from vdsm.config import config
from vdsm.define import ERROR, NORMAL, doneCode, errCode
from vdsm.netinfo import DUMMY_BRIDGE
+from vdsm.sampling import AdvancedStatsFunction, AdvancedStatsThread
from vdsm.utils import isVdsmImage
from storage import outOfProcess as oop
from storage import sd
@@ -147,44 +148,44 @@
pass
-class VmStatsThread(sampling.AdvancedStatsThread):
+class VmStatsThread(AdvancedStatsThread):
MBPS_TO_BPS = 10 ** 6 / 8
def __init__(self, vm):
- sampling.AdvancedStatsThread.__init__(self, log=vm.log, daemon=True)
+ AdvancedStatsThread.__init__(self, log=vm.log, daemon=True)
self._vm = vm
self.highWrite = (
- sampling.AdvancedStatsFunction(
+ AdvancedStatsFunction(
self._highWrite,
config.getint('vars', 'vm_watermark_interval')))
self.updateVolumes = (
- sampling.AdvancedStatsFunction(
+ AdvancedStatsFunction(
self._updateVolumes,
config.getint('irs', 'vol_size_sample_interval')))
self.sampleCpu = (
- sampling.AdvancedStatsFunction(
+ AdvancedStatsFunction(
self._sampleCpu,
config.getint('vars', 'vm_sample_cpu_interval'),
config.getint('vars', 'vm_sample_cpu_window')))
self.sampleDisk = (
- sampling.AdvancedStatsFunction(
+ AdvancedStatsFunction(
self._sampleDisk,
config.getint('vars', 'vm_sample_disk_interval'),
config.getint('vars', 'vm_sample_disk_window')))
self.sampleDiskLatency = (
- sampling.AdvancedStatsFunction(
+ AdvancedStatsFunction(
self._sampleDiskLatency,
config.getint('vars', 'vm_sample_disk_latency_interval'),
config.getint('vars', 'vm_sample_disk_latency_window')))
self.sampleNet = (
- sampling.AdvancedStatsFunction(
+ AdvancedStatsFunction(
self._sampleNet,
config.getint('vars', 'vm_sample_net_interval'),
config.getint('vars', 'vm_sample_net_window')))
self.sampleBalloon = (
- sampling.AdvancedStatsFunction(
+ AdvancedStatsFunction(
self._sampleBalloon,
config.getint('vars', 'vm_sample_balloon_interval'),
config.getint('vars', 'vm_sample_balloon_window')))
--
To view, visit http://gerrit.ovirt.org/28480
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b009f4a0cb0179fa1f1b74774ba61fd6638d8a9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
8 years, 9 months