Adam Litke has uploaded a new change for review.
Change subject: mom: Redirect mom init stacktrace to debug log
......................................................................
mom: Redirect mom init stacktrace to debug log
When MOM initialization fails we are currently falling back to the old
KsmMonitor. When this happens we print a warning which is appropriate. Since
the error is handled, we should not print the stack trace at warning level.
This information is useful in debug mode however.
Split the stack trace printout into a separate debug logging message.
Change-Id: I8e85fafadd3e9180b6c5911baa6552b380476e3c
Signed-off-by: Adam Litke <agl(a)us.ibm.com>
---
M vdsm/clientIF.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/9271/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 38aa0d7..ed3a0f0 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -194,7 +194,8 @@
self.mom = MomThread(momconf)
except:
self.log.warn("MOM initialization failed and fall "
- "back to KsmMonitor", exc_info=True)
+ "back to KsmMonitor")
+ self.log.debug("Details:", exc_info=True)
self.ksmMonitor = ksm.KsmMonitorThread(self)
def _syncLibvirtNetworks(self):
--
To view, visit http://gerrit.ovirt.org/9271
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e85fafadd3e9180b6c5911baa6552b380476e3c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <agl(a)us.ibm.com>
Adam Litke has uploaded a new change for review.
Change subject: build: Add BuildDepends for m2crypto
......................................................................
build: Add BuildDepends for m2crypto
During the build, I get the following traceback:
Traceback (most recent call last):
File "../tests/testrunner.py", line 274, in <module>
hackVdsmModule()
File "../tests/testrunner.py", line 252, in hackVdsmModule
sub = __import__(name, globals(), locals(), [], -1)
File "/home/aglitke/rpmbuild/BUILD/vdsm-4.10.2/vdsm/SecureXMLRPCServer.py",
line 39, in <module>
from M2Crypto import SSL, X509
ImportError: No module named M2Crypto
We need the m2crypto package at build time now as well (in order to run tests).
Change-Id: I4bfe0c6ca979f868be665d48bce395c896bec1f7
Signed-off-by: Adam Litke <agl(a)us.ibm.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/9253/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 20ad1dc..9ba254f 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -42,6 +42,7 @@
BuildRequires: libvirt-python
BuildRequires: genisoimage
BuildRequires: openssl
+BuildRequires: m2crypto
%if 0%{?rhel}
BuildRequires: python-ordereddict
%endif
--
To view, visit http://gerrit.ovirt.org/9253
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4bfe0c6ca979f868be665d48bce395c896bec1f7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <agl(a)us.ibm.com>
Royce Lv has uploaded a new change for review.
Change subject: join supervdsm subprocess after terminated to avoid defunct status
......................................................................
join supervdsm subprocess after terminated to avoid defunct status
After validateAccess there leaves a defunct process
clear it by join after termination
Change-Id: I0cdcfb3b467e9226f14a4ebc2845ff2db0f19b5f
Signed-off-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
---
M vdsm/supervdsmServer.py
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/03/6503/1
--
To view, visit http://gerrit.ovirt.org/6503
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0cdcfb3b467e9226f14a4ebc2845ff2db0f19b5f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: xmlrpcTests: narrow the expected exception when using retry
......................................................................
xmlrpcTests: narrow the expected exception when using retry
Change the expected exception from the default Exception to
AssertionError
Change-Id: I0deded14d02a21bcfbca49dbdfadfe8652added3
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M tests/functional/xmlrpcTests.py
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/8444/1
diff --git a/tests/functional/xmlrpcTests.py b/tests/functional/xmlrpcTests.py
index 6ccaf66..1d44059 100644
--- a/tests/functional/xmlrpcTests.py
+++ b/tests/functional/xmlrpcTests.py
@@ -122,7 +122,8 @@
'vmName': 'foo'})
self.assertVdsOK(r)
try:
- retry(lambda: self.assertVmUp(VMID), timeout=20)
+ retry(lambda: self.assertVmUp(VMID),
+ expectedException=AssertionError, timeout=20)
finally:
# FIXME: if the server dies now, we end up with a leaked VM.
r = self.s.destroy(VMID)
@@ -154,7 +155,8 @@
try:
self.assertVdsOK(self.s.create(conf))
# wait 65 seconds for VM to come up until timeout
- retry(assertVMAndGuestUp, timeout=65)
+ retry(assertVMAndGuestUp, expectedException=AssertionError,
+ timeout=65)
finally:
destroyResult = self.s.destroy(VMID)
--
To view, visit http://gerrit.ovirt.org/8444
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0deded14d02a21bcfbca49dbdfadfe8652added3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
Juan Hernandez has uploaded a new change for review.
Change subject: Implement SSL session cache
......................................................................
Implement SSL session cache
We are currently implementing SSL for the XML-RPC communications with
the ssl module. Unfortunately this module uses OpenSSL in such a way
that a new context is created for each TCP connection. This means that
the heavy part of the SSL handshake (asymmetric encryption) is
performed for each connection. In addition as we use HTTP 1.0 this
also means that we use one connection per request, and thus one
handshake per request. This is a potential performance problem in the
VDSM side and a huge performance problem in the engine side: when the
number of hosts managed by the engine the use of CPU grows to a point
where almost all the CPU is used for SSL handshares.
This patch uses the OpenSSL.SSL module (pyOpenSSL) in a way such that
SSL sessions are cached, thus greatly reducing the amount of CPU
needed for handshakes, specially in the engine.
Bug-Id: https://bugzilla.redhat.com/857035
Change-Id: Ic75adee4070b415b8855af1f2ea289825496fbc1
Signed-off-by: Juan Hernandez <juan.hernandez(a)redhat.com>
---
M vdsm/SecureXMLRPCServer.py
1 file changed, 125 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/8123/1
diff --git a/vdsm/SecureXMLRPCServer.py b/vdsm/SecureXMLRPCServer.py
index 9396a28..744e594 100644
--- a/vdsm/SecureXMLRPCServer.py
+++ b/vdsm/SecureXMLRPCServer.py
@@ -35,6 +35,129 @@
import socket
import SocketServer
+from OpenSSL import SSL
+
+
+class SSLServerSocket(object):
+ """SSL decorator for server sockets.
+
+ This class wraps a normal socket so that when the accept method
+ is called the client socket as also decorated with SSL functionality.
+ The rest of the methods are just delegated to the raw socket.
+ """
+
+ def __init__(self, raw, certfile=None, keyfile=None, ca_certs=None):
+ # Save the reference to the raw socket so that we can delegate
+ # calls to it later:
+ self.raw = raw
+
+ # Create the OpenSSL context:
+ self.context = SSL.Context(SSL.SSLv3_METHOD)
+ self.context.set_session_id("vdsm")
+
+ # Load the crendentials:
+ if certfile and keyfile:
+ self.context.use_certificate_file(certfile)
+ self.context.use_privatekey_file(keyfile)
+
+ # Load the CA certificates used to verify certifictes presented
+ # by the clients:
+ if ca_certs:
+ self.context.load_verify_locations(ca_certs)
+ self.context.set_verify(
+ SSL.VERIFY_PEER |
+ SSL.VERIFY_FAIL_IF_NO_PEER_CERT |
+ SSL.VERIFY_CLIENT_ONCE,
+ SSLServerSocket.verify)
+
+ @staticmethod
+ def verify(connection, certificate, x, y, z):
+ # No need for additional verifications:
+ return True
+
+ def accept(self):
+ # Get the client socket and address calling the accept method of
+ # the raw socket and replace the client socket with a wrapper:
+ client, address = self.raw.accept()
+ client = SSLClientSocket(client, self.context)
+ return client, address
+
+ def bind(self, address):
+ return self.raw.bind(address)
+
+ def fileno(self):
+ return self.raw.fileno()
+
+ def getsockname(self):
+ return self.raw.getsockname()
+
+ def gettimeout(self):
+ return self.raw.gettimeout()
+
+ def listen(self, backlog=5):
+ return self.raw.listen(backlog)
+
+ def setsockopt(self, level, optname, value):
+ return self.raw.setsockopt(level, optname, value)
+
+
+class SSLClientSocket(object):
+ """SSL decorator for client sockets.
+
+ This class wraps a client socket returned by the accept
+ method of a server socket providing the SSL functionality.
+
+ Note that most methods are delegated to the wrapped raw
+ and many are just not implemented because they are not used
+ in our use case.
+ """
+
+ def __init__(self, raw, context):
+ # Save the reference to the raw client socket so that we can
+ # delegate calls to it later:
+ self.raw = raw
+ self.context = context
+
+ # Create a new SSL connection and a file like object on top of it
+ # in order to be able to implement the makefile method used by
+ # the XML RPC server:
+ self.connection = SSL.Connection(self.context, self.raw)
+
+ # Configure the connection to that it will automatically do the
+ # hand shake before the first read or write operation:
+ self.connection.set_accept_state()
+
+ def close(self):
+ return self.connection.close()
+
+ def do_handshake(self):
+ return self.connection.do_handshake()
+
+ def makefile(self, mode="r", bufsize=-1):
+ # In order to implement this method we borrow the _fileobject
+ # function from the socket module, and that forces us to
+ # implement correcty the recv and send family of methods:
+ return socket._fileobject(self, mode, bufsize)
+
+ def recv(self, bufsize, flags=0):
+ return self.connection.recv(bufsize)
+
+ def send(self, string, flags=0):
+ return self.connection.send(string)
+
+ def sendall(self, string, flags=0):
+ return self.connection.sendall(string)
+
+ def setsockopt(self, level, optname, value):
+ self.connection.setsockopt(level, optname, value)
+
+ def shutdown(self, how):
+ # Not completly sure, but I think we should first shutdown the
+ # SSL connection and then the raw socket:
+ self.connection.shutdown()
+ self.raw.shutdown(how)
+
+
SecureXMLRPCRequestHandler = SimpleXMLRPCServer.SimpleXMLRPCRequestHandler
@@ -53,11 +176,9 @@
requestHandler,
logRequests, allow_none, encoding,
bind_and_activate=False)
- self.socket = ssl.wrap_socket(self.socket,
+ self.socket = SSLServerSocket(self.socket,
keyfile=keyfile, certfile=certfile,
- ca_certs=ca_certs, server_side=True,
- cert_reqs=ssl.CERT_REQUIRED,
- do_handshake_on_connect=False)
+ ca_certs=ca_certs)
if timeout is not None:
self.socket.settimeout = timeout
if bind_and_activate:
--
To view, visit http://gerrit.ovirt.org/8123
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic75adee4070b415b8855af1f2ea289825496fbc1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez(a)redhat.com>