Francesco Romani has uploaded a new change for review.
Change subject: virt: periodic: avoid NotConnectedError spam
......................................................................
virt: periodic: avoid NotConnectedError spam
periodic operations have well known races on
VM startup and VM shutdown.
These races are well known, because periodic are
asynchronous with respect VM startup/shutdown,
and are benign because operations are just supposed
to be retried next cycle.
Under high load and/or unresponsive libvirt, we may
have log spam for Vm._dom being unconnected.
Let's avoid useless and scary stacktraces in the logs.
X-Backport-To: 3.6
Change-Id: I920e3b0b0e80e0a66ad199607068424986933d3a
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/periodic.py
1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/44813/1
diff --git a/vdsm/virt/periodic.py b/vdsm/virt/periodic.py
index a2ee8ba..6a2841b 100644
--- a/vdsm/virt/periodic.py
+++ b/vdsm/virt/periodic.py
@@ -32,6 +32,7 @@
from vdsm.utils import monotonic_time
from . import sampling
+from . import virdomain
# just a made up number. Maybe should be equal to number of cores?
@@ -268,7 +269,13 @@
return self._vm.isDomainReadyForCommands()
def __call__(self):
- self._execute()
+ try:
+ self._execute()
+ except virdomain.NotConnectedError:
+ # no worries, let's retry again next time.
+ # but let's not spam logs with useless stacktraces.
+ self._vm.log.warning('could not run on %s: domain not connected',
+ self._vm.id)
class UpdateVolumes(_RunnableVmOperation):
--
To view, visit https://gerrit.ovirt.org/44813
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I920e3b0b0e80e0a66ad199607068424986933d3a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/48003
to review the following change.
Change subject: Having logrotate configuration to rotate coredump directory as root user
......................................................................
Having logrotate configuration to rotate coredump directory as root user
As vdsm configures logrotate rule to rotate /var/log/core directory,
which output coredump files for all processes - such as once that runs
as root - it should perform the rotation as root user as well, otherwise
rotating libvirt coredump will be ignored with permission denied error.
This is an ancient regression introduced while fixing rhbz#772591 with
commit 951b41d.
Change-Id: Ib012f61a18c61bc0415be22f5b89ea25a58ef328
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1265547
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/47833
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/vdsm-logrotate.conf.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/03/48003/1
diff --git a/vdsm/vdsm-logrotate.conf.in b/vdsm/vdsm-logrotate.conf.in
index ce71015..af85330 100644
--- a/vdsm/vdsm-logrotate.conf.in
+++ b/vdsm/vdsm-logrotate.conf.in
@@ -15,5 +15,5 @@
compresscmd /usr/bin/xz
uncompresscmd /usr/bin/unxz
compressext .xz
- su @VDSMUSER@ @VDSMGROUP@
+ su root root
}
--
To view, visit https://gerrit.ovirt.org/48003
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib012f61a18c61bc0415be22f5b89ea25a58ef328
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Having logrotate configuration to rotate coredump directory as root user
......................................................................
Having logrotate configuration to rotate coredump directory as root user
As vdsm configures logrotate rule to rotate /var/log/core directory,
which output coredump files for all processes - such as once that runs
as root - it should perform the rotation as root user as well, otherwise
rotating libvirt coredump will be ignored with permission denied error.
Change-Id: Ib012f61a18c61bc0415be22f5b89ea25a58ef328
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1265547
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm/vdsm-logrotate.conf.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/47833/1
diff --git a/vdsm/vdsm-logrotate.conf.in b/vdsm/vdsm-logrotate.conf.in
index ce71015..af85330 100644
--- a/vdsm/vdsm-logrotate.conf.in
+++ b/vdsm/vdsm-logrotate.conf.in
@@ -15,5 +15,5 @@
compresscmd /usr/bin/xz
uncompresscmd /usr/bin/unxz
compressext .xz
- su @VDSMUSER@ @VDSMGROUP@
+ su root root
}
--
To view, visit https://gerrit.ovirt.org/47833
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib012f61a18c61bc0415be22f5b89ea25a58ef328
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Piotr Kliczewski has uploaded a new change for review.
Change subject: vdscli: map invocation params to dictionary
......................................................................
vdscli: map invocation params to dictionary
We need to be more flexible with parameters provided during execution of
vdscli methods. Now we use api schema to name all the params so we can
match them properly on the server side.
With this change we can call vdscli methods as regular method and do
mapping behind the scene.
Code used for xmlrpc looked like:
self.vdscli.addNetwork(bridge,
*self._get_net_args(vlan, bond, nics, opts))
In above case we are required to prepare named params as array.
Now we can call it:
self.vdscli.addNetwork(bridge,
vlan=vlan, bond=bond, nics=nics, opts=opts))
as well as we can provide only optional params as we want.
This is first step which enable us to provide client side schema
validation.
It is required to extract schema files from jsonrpc rpm due to
dependency needed for python rpm. Now we make schema rpm required for
jsonrpc and python rpm.
Change-Id: Ibac6eab3c519becb29d2b3551111d671bbb79df5
Signed-off-by: pkliczewski <piotr.kliczewski(a)gmail.com>
---
M lib/vdsm/jsonrpcvdscli.py
M tests/crossImportsTests.py.in
M vdsm.spec.in
3 files changed, 29 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/45429/1
diff --git a/lib/vdsm/jsonrpcvdscli.py b/lib/vdsm/jsonrpcvdscli.py
index 6e65e0d..e1efb3f 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -28,6 +28,7 @@
JsonRpcRequest, \
JsonRpcNoResponseError
+from rpc import vdsmapi
from vdsm import response
from .config import config
@@ -58,10 +59,19 @@
class _Server(object):
def __init__(self, client, compat):
+ self._vapi = vdsmapi.get_api()
self._client = client
self._compat = compat
- def _callMethod(self, methodName, *args):
+ def prepare_args(self, className, methodName, args, kwargs):
+ sym = self._vapi['commands'][className][methodName]
+ allargs = sym.get('data', {}).keys()
+ allargs = [arg[1:] if arg.startswith('*') else arg for arg in allargs]
+ params = dict(zip(allargs, args))
+ params.update(kwargs)
+ return params
+
+ def _callMethod(self, methodName, *args, **kwargs):
try:
method = _COMMAND_CONVERTER[methodName]
except KeyError as e:
@@ -69,7 +79,10 @@
"arguments: %s error: %s" %
(methodName, args, e))
- req = JsonRpcRequest(method, args, reqId=str(uuid4()))
+ class_name, method_name = method.split('.')
+ params = self.prepare_args(class_name, method_name, args, kwargs)
+
+ req = JsonRpcRequest(method, params, reqId=str(uuid4()))
responses = self._client.call(req)
if responses:
resp = responses[0]
diff --git a/tests/crossImportsTests.py.in b/tests/crossImportsTests.py.in
index a3e1d81..acb4ea3 100644
--- a/tests/crossImportsTests.py.in
+++ b/tests/crossImportsTests.py.in
@@ -51,4 +51,7 @@
else:
mods = get_mods(os.path.join(get_python_lib(), pkg_name))
+ # ignore schema dept for this module
+ mods.remove('jsonrpcvdscli')
+
__import__(pkg_name, fromlist=mods)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index d4c1198..729b322 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -260,9 +260,16 @@
An XMLRPC interface for interacting with vdsmd. Primary control interface for
ovirt-engine and vdsClient.
+%package schema
+Summary: VDSM schema
+
+%description schema
+Contains api schema file
+
%package jsonrpc
Summary: VDSM API Server
Requires: %{name}-python = %{version}-%{release}
+Requires: %{name}-schema = %{version}-%{release}
Requires: %{name}-yajsonrpc = %{version}-%{release}
Obsoletes: vdsm-api < 4.16
@@ -301,6 +308,7 @@
Requires: python-cpopen >= 1.2.3-5
Requires: m2crypto
Requires: python-ioprocess >= 0.14
+Requires: %{name}-schema = %{version}-%{release}
%description python
Shared libraries between the various VDSM packages.
@@ -1340,9 +1348,11 @@
%{_datadir}/%{vdsm_name}/rpc/__init__.py*
%{_datadir}/%{vdsm_name}/rpc/bindingjsonrpc.py*
%{_datadir}/%{vdsm_name}/rpc/Bridge.py*
+%{python_sitelib}/yajsonrpc/__init__.py*
+
+%files schema
%{_datadir}/%{vdsm_name}/rpc/vdsmapi-schema.json
%{python_sitelib}/vdsmapi.py*
-%{python_sitelib}/yajsonrpc/__init__.py*
%if ! 0%{?with_gluster}
%exclude %{_datadir}/%{vdsm_name}/rpc/vdsmapi-gluster-schema.json
%endif
--
To view, visit https://gerrit.ovirt.org/45429
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibac6eab3c519becb29d2b3551111d671bbb79df5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Ido Barkan has uploaded a new change for review.
Change subject: net: use libvirt to manage bridge mac learning
......................................................................
net: use libvirt to manage bridge mac learning
In late kernels, this can lead for performance boost, by eliminating
unneeded packet flooding in the LAN and also allow the kernel to shut
down promiscuous mode for bridge ports.
see: https://libvirt.org/formatnetwork.html#elementsConnect
Change-Id: I4d52d90587c79e992a6466f3f98ee9c877cc36f4
Signed-off-by: Ido Barkan <ibarkan(a)redhat.com>
---
M vdsm/network/configurators/libvirt.py
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/47935/1
diff --git a/vdsm/network/configurators/libvirt.py b/vdsm/network/configurators/libvirt.py
index a88ded7..85490ba 100644
--- a/vdsm/network/configurators/libvirt.py
+++ b/vdsm/network/configurators/libvirt.py
@@ -46,7 +46,8 @@
<network>
<name>vdsm-awesome_net</name>
- <forward mode='bridge'/><bridge name='awesome_net'/> ||
+ <forward mode='bridge'/>
+ <bridge name='awesome_net' macTableManager="libvirt"/> ||
<forward mode='passthrough'><interface dev='incredible'/></forward>
</network>
@@ -54,6 +55,8 @@
according to net if bridged or bridgeless this
determines respectively the presence of bridge element
or interface subelement.
+ For bridged networks, libvirt can manage the forwarding table of the
+ bridge, which can enhance performance for the host.
"""
netName = netinfo.LIBVIRT_NET_PREFIX + network
@@ -75,7 +78,8 @@
root.append(nameElem)
root.append(forwardElem)
if bridged:
- root.append(EtreeElement('bridge', name=network))
+ root.append(
+ EtreeElement('bridge', name=network, macTableManager='libvirt'))
else:
forwardElem.append(EtreeElement('interface', dev=iface))
return etree.tostring(root)
--
To view, visit https://gerrit.ovirt.org/47935
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d52d90587c79e992a6466f3f98ee9c877cc36f4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
Dan Kenigsberg has posted comments on this change.
Change subject: config: Resolve crash when IPv6 disabled in kernel
......................................................................
Patch Set 1: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/47978/1/vdsm/network/configurators/ifcfg.py
File vdsm/network/configurators/ifcfg.py:
Line 102: self._addSourceRoute(bridge)
Line 103: _ifup(bridge)
Line 104:
Line 105: # Check if ipv6 is disabled by kernel arguments
Line 106: has_ipv6 = True
hmm, I think that we'd better expose this as a memoized function in caps.py, and in the output of getCaps. Otherwise Engine would not know if we support ipv6 or not.
Line 107: try:
Line 108: socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
Line 109: except socket.error:
Line 110: has_ipv6 = False
--
To view, visit https://gerrit.ovirt.org/47978
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I774cac868ddee08ac072adf2104a811594779052
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ollie Armstrong <ollie(a)fubra.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes