Change in vdsm[master]: logging: setup log filter correctly
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: logging: setup log filter correctly
......................................................................
logging: setup log filter correctly
logging.config.fileConfig() does not setup filters, it just setups
loggers, handlers and formatters. dictConfig() can setup filters but the
logging configuration is not very readable in a Python dict.
This patch subclass the log handler to be filtered, in the __init__()
method, add the filter need. Then in the logger.conf, use the subclass
instead of the original handler.
Change-Id: I76c2f77c95dd44853f070c8f7b7a8b71cfd6866c
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M vdsm/logUtils.py
M vdsm/logger.conf.in
2 files changed, 16 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/88/9688/1
diff --git a/vdsm/logUtils.py b/vdsm/logUtils.py
index 933719d..8202bde 100644
--- a/vdsm/logUtils.py
+++ b/vdsm/logUtils.py
@@ -21,6 +21,7 @@
import logging
import sys
from functools import wraps
+from logging.handlers import WatchedFileHandler
from inspect import ismethod
@@ -160,3 +161,17 @@
raise
except:
self.handleError(record)
+
+
+def getFilteredClass(logHandlerClass, *filters):
+ class Filtered(logHandlerClass):
+ def __init__(self, *args, **kwargs):
+ logHandlerClass.__init__(self, *args, **kwargs)
+ for aFilter in filters:
+ self.addFilter(aFilter)
+
+ return Filtered
+
+
+FilteredWatchedFileHandler = getFilteredClass(
+ WatchedFileHandler, TracebackRepeatFilter())
diff --git a/vdsm/logger.conf.in b/vdsm/logger.conf.in
index edd4616..cd42154 100644
--- a/vdsm/logger.conf.in
+++ b/vdsm/logger.conf.in
@@ -43,9 +43,8 @@
args=('/dev/log', handlers.SysLogHandler.LOG_USER)
[handler_logfile]
-class=logging.handlers.WatchedFileHandler
+class=logUtils.FilteredWatchedFileHandler
args=('@VDSMLOGDIR(a)/vdsm.log',)
-filters=storage.misc.TracebackRepeatFilter
level=DEBUG
formatter=long
--
To view, visit http://gerrit.ovirt.org/9688
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I76c2f77c95dd44853f070c8f7b7a8b71cfd6866c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
10 years, 7 months
Change in vdsm[master]: logUtils: a timed log throttle filter for stats thread
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: logUtils: a timed log throttle filter for stats thread
......................................................................
logUtils: a timed log throttle filter for stats thread
The exception log of stats thread some times contains a lot of the same
messages. The normal stats log is very verbose as well.
This patch adds a timed throttle filter to the stats log. If the a
message in the same file same line (and same exception) is raised for
above threshold times in a certain interval, the noise will be cuts down.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=853725
Change-Id: I60fe36ce6b324941d2cbb60ac9b40ed85dcdb858
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M vdsm.spec.in
M vdsm/logUtils.py
2 files changed, 40 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/9689/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 45cd87a..c8b1281 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -137,6 +137,7 @@
Requires: %{name}-python = %{version}-%{release}
Requires: pyparted
Requires: mom >= 0.3.0
+Requires: python-repoze-lru
Requires(pre,preun): policycoreutils-python
Requires(post): /usr/sbin/saslpasswd2
diff --git a/vdsm/logUtils.py b/vdsm/logUtils.py
index 28c9e0a..ef082f8 100644
--- a/vdsm/logUtils.py
+++ b/vdsm/logUtils.py
@@ -20,10 +20,13 @@
import logging
import sys
+import time
from functools import wraps
from logging.handlers import WatchedFileHandler
from logging.handlers import RotatingFileHandler
from inspect import ismethod
+from collections import deque
+from repoze.lru import LRUCache
def funcName(func):
@@ -112,6 +115,41 @@
return 1
+class TimedThrottleFilter(logging.Filter):
+ """
+ Throttle duplicated log messages if the same message is emitted too fast.
+ """
+
+ def __init__(self, threshold=3, interval=10, cacheSize=1024):
+ """
+ Throttle the same message if it is emitted threshold times in
+ interval seconds.
+ """
+ self._threshold = threshold
+ self._interval = interval
+ self._cache = LRUCache(cacheSize)
+
+ def _makeKey(self, record):
+ key = record.name + record.pathname + str(record.lineno)
+ if record.exc_info:
+ key += str(record.exc_info[0]) # class of the exception raised
+ return key
+
+ def filter(self, record):
+ key = self._makeKey(record)
+ stamps = self._cache.get(key, deque(maxlen=self._threshold))
+ if not stamps:
+ self._cache.put(key, stamps)
+
+ ctime = int(time.time())
+ if (len(stamps) < self._threshold or
+ ctime - stamps[0] > self._interval):
+ stamps.append(ctime)
+ return 1
+
+ return 0
+
+
class QueueHandler(logging.Handler):
"""
This handler sends events to a queue. Typically, it would be used together
@@ -178,4 +216,4 @@
WatchedFileHandler, TracebackRepeatFilter())
FilteredRotatingFileHandler = getFilteredClass(
- RotatingFileHandler, TracebackRepeatFilter())
+ RotatingFileHandler, TracebackRepeatFilter(), TimedThrottleFilter(3, 10))
--
To view, visit http://gerrit.ovirt.org/9689
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I60fe36ce6b324941d2cbb60ac9b40ed85dcdb858
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
10 years, 7 months
Change in vdsm[master]: AdvancedStatsThread: Throttle duplicated exception log
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: AdvancedStatsThread: Throttle duplicated exception log
......................................................................
AdvancedStatsThread: Throttle duplicated exception log
When the same exception is raised in the stats function many times, the
log message is the same as well, so extra message does not help us on the
problem. If the problem is not solved, the same exception will be raised
again and again, then the log will contain a lot of garbages.
This patch proposes a way to throttle duplicated exception log in stats
functions. For the same exception in the same stats function, if it is
raised too many times, just suppress the log.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=853725
Change-Id: I2ee04d8d82e2a14b0a003627981c28e5e64a46ab
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M vdsm/utils.py
1 file changed, 45 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/84/8884/1
diff --git a/vdsm/utils.py b/vdsm/utils.py
index 002094a..7fab19a 100644
--- a/vdsm/utils.py
+++ b/vdsm/utils.py
@@ -291,6 +291,45 @@
return bgn_sample, end_sample, (end_time - bgn_time)
+
+class _ExceptionLogThrottle(object):
+ '''
+ Record previous exception for each statsFunction, throttle the log
+ if the same exception is raised too many times.
+ '''
+
+ def __init__(self, log, dupThreshold=3):
+ self._log = log
+ self._dupThreshold = dupThreshold
+ self._exceptions = {}
+
+ def _exceptionEqual(self, exc1, exc2):
+ return exc1.__class__ == exc2.__class__ and exc1.args == exc2.args
+
+ def needSuppress(self, statsFunction, exceptObj):
+ if (statsFunction not in self._exceptions or
+ not self._exceptionEqual(
+ self._exceptions[statsFunction]['exception'], exceptObj)):
+
+ self._exceptions[statsFunction] = {'exception': exceptObj,
+ 'dupCount': 0}
+ return False
+
+ dupCount = self._exceptions[statsFunction]['dupCount']
+
+ if dupCount <= self._dupThreshold:
+ dupCount += 1
+ if dupCount == self._dupThreshold:
+ self._log.debug(
+ "Log will be throttled for the same exception: %s" %
+ exceptObj.message)
+ self._exceptions[statsFunction] = {'exception': exceptObj,
+ 'dupCount': dupCount}
+ return False
+
+ return True
+
+
class AdvancedStatsThread(threading.Thread):
"""
A thread that runs the registered AdvancedStatsFunction objects
@@ -311,6 +350,8 @@
self._statsTime = None
self._statsFunctions = []
+
+ self._logThrottle = _ExceptionLogThrottle(log)
def addStatsFunction(self, *args):
"""
@@ -395,8 +436,10 @@
statsFunction()
except Exception, e:
if not self.handleStatsException(e):
- self._log.error("Stats function failed: %s",
- statsFunction, exc_info=True)
+ if not self._logThrottle.needSuppress(
+ statsFunction, e):
+ self._log.error("Stats function failed: %s",
+ statsFunction, exc_info=True)
self._stopEvent.wait(waitInterval)
intervalAccum = (intervalAccum + waitInterval) % maxInterval
--
To view, visit http://gerrit.ovirt.org/8884
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ee04d8d82e2a14b0a003627981c28e5e64a46ab
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
10 years, 7 months
Change in vdsm[master]: [WIP] Add virtual HTTP(s) server multiplexing port 54321
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: [WIP] Add virtual HTTP(s) server multiplexing port 54321
......................................................................
[WIP] Add virtual HTTP(s) server multiplexing port 54321
Add a request router to route HTTP request to the virtual server, and
XMLRPC request to the XMLRPC binding. This allow VDSM provide XMLRPC and
HTTP service using the same socket binded at 54321.
The request router can be extended to match path patterns and reques
method, etc...
This virtual HTTP server can be extened to support guest console stream
and crash core dump.
How to test:
1) This patch can pass the functional tests added recently when
ssl = false or ssl = true
2) To test the virtual HTTP server, use the command as follow.
When ssl = true
wget --no-check-certificate \
--certificate=/etc/pki/vdsm/certs/vdsmcert.pem \
--private-key=/etc/pki/vdsm/keys/vdsmkey.pem \
--ca-certificate=/etc/pki/vdsm/certs/cacert.pem \
https://localhost:54321/etc/vdsm/vdsm.conf
When ssl = false
wget http://localhost:54321/etc/vdsm/vdsm.conf
Change-Id: Ie99bf9353603ae96b0570367e22a01817e5c4e97
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M vdsm/BindingXMLRPC.py
M vdsm/SecureXMLRPCServer.py
2 files changed, 71 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/05/9605/1
diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py
index d460910..a74d197 100644
--- a/vdsm/BindingXMLRPC.py
+++ b/vdsm/BindingXMLRPC.py
@@ -21,6 +21,7 @@
import time
from errno import EINTR
import SimpleXMLRPCServer
+import SimpleHTTPServer
from vdsm import SecureXMLRPCServer
import logging
import libvirt
@@ -138,15 +139,25 @@
threadLocal.flowID = self.headers.get(HTTP_HEADER_FLOWID)
return r
+ urlRouter = SecureXMLRPCServer.UrlRouter()
+ urlRouter.registerHandler('/', LoggingHandler)
+ urlRouter.registerHandler('/RPC2', LoggingHandler)
+ urlRouter.registerHandler(
+ '/etc/vdsm/vdsm.conf', SimpleHTTPServer.SimpleHTTPRequestHandler)
+ # TODO: subclass SimpleHTTPServer.SimpleHTTPRequestHandler to provide
+ # a HTTP server forwarding the guest serial console stream and gurest
+ # crash core dump download
+
if self.enableSSL:
KEYFILE, CERTFILE, CACERT = self._getKeyCertFilenames()
s = SecureXMLRPCServer.SecureThreadedXMLRPCServer(server_address,
keyfile=KEYFILE, certfile=CERTFILE, ca_certs=CACERT,
timeout=self.serverRespTimeout,
- requestHandler=LoggingHandler)
+ requestHandler=urlRouter.getHandlerClass())
else:
s = utils.SimpleThreadedXMLRPCServer(server_address,
- requestHandler=LoggingHandler, logRequests=True)
+ requestHandler=urlRouter.getHandlerClass(),
+ logRequests=True)
utils.closeOnExec(s.socket.fileno())
s.lastClientTime = 0
diff --git a/vdsm/SecureXMLRPCServer.py b/vdsm/SecureXMLRPCServer.py
index 2de1cf7..87ba0f4 100644
--- a/vdsm/SecureXMLRPCServer.py
+++ b/vdsm/SecureXMLRPCServer.py
@@ -34,6 +34,7 @@
import httplib
import socket
import SocketServer
+import BaseHTTPServer
import logging
from M2Crypto import SSL, X509
@@ -114,6 +115,63 @@
return client, address
+# TODO: extend the router to support path patterns and routing different
+# request method (GET, POST) to different handlerClass
+class UrlRouter(object):
+ def __init__(self):
+ self._handlerClasses = []
+
+ def registerHandler(self, path, handlerClass):
+ """Register a handler class with the related path
+
+ In old style class, mro is depth first. Sometimes base handler class
+ overrides setup() or parse_request() methon as
+ BindingXMLRPC._createXMLRPCServer.LoggingHandler does.
+
+ For the overriden method to be resolved first, the class must occur
+ before the ancestor class in the router handlerClass.__bases__ list.
+
+ It is guaranteed that the router handlerClasse.__bases__ obey the
+ order of the handler class registered. So if you override a handler
+ method, register it before other handler classes to make the mothed
+ resoled first.
+
+ In new style class, there is no such problem."""
+
+ if path in map(lambda (p, _): p, self._handlerClasses):
+ raise ValueError("Path %s is already registered" % path)
+
+ self._handlerClasses.append((path, handlerClass))
+
+ def getHandlerClass(self):
+ handlerClassDict = dict(self._handlerClasses)
+
+ class ReqHandler:
+ """Route the request to the appropriate handler
+
+ Handles all HTTP GET and POST requests and attempts to route them
+ by URL.
+ """
+
+ def do_POST(self):
+ handlerClassDict[self.path].do_POST(self)
+
+ def do_GET(self):
+ handlerClassDict[self.path].do_GET(self)
+
+ bases = []
+ # Remove duplicated handlerClass while keep the elements in the copy
+ # list remained in original order.
+ for _, handlerClass in self._handlerClasses:
+ if handlerClass not in bases:
+ bases.append(handlerClass)
+ bases.append(BaseHTTPServer.BaseHTTPRequestHandler)
+
+ ReqHandler.__bases__ = tuple(bases)
+
+ return ReqHandler
+
+
class SecureXMLRPCServer(SimpleXMLRPCServer.SimpleXMLRPCServer):
def __init__(self, addr,
requestHandler=SimpleXMLRPCServer.SimpleXMLRPCRequestHandler,
--
To view, visit http://gerrit.ovirt.org/9605
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie99bf9353603ae96b0570367e22a01817e5c4e97
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
10 years, 7 months
Change in vdsm[master]: [WIP] remote serial console via HTTP virtual server
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: [WIP] remote serial console via HTTP virtual server
......................................................................
[WIP] remote serial console via HTTP virtual server
How to test:
We test the remote serial console using netcat, however netcat do not
support SSL, so we perform this test without SSL.
Firstly, in /etc/vdsm/vdsm.conf, set "ssl = False", then in the last
part of /etc/libvirt/libvirtd.conf set "listen_tls = 0" "listen_tcp = 1"
"auth_tcp = "none"" and in the last part of /etc/libvirt/qemu.conf, set
"spice_tls=0".
Restart libvirtd and vdsmd, create a virtual machine with VDSM. Fedora
is the preferable guest OS because it scans serial console and
automatically starts a tty programme on it. You can just use a Fedora
XFCE live CD to boot your VM if you do not have an existing Fedora VM.
Run net cat as follow.
nc 127.0.0.1 54321
Paste the following request in net cat.
POST /VM/paste-your-VM-uuid-here/dev/console HTTP/1.0
Hit enter twice, you will see the response as follow.
HTTP/1.0 200 OK
Server: BaseHTTP/0.3 Python/2.7.3
Date: Wed, 26 Dec 2012 09:38:27 GMT
Content-type: application/octet-stream
After your VM is up, hit enter again, you will get the guest console as
follow. It works in full duplex mode.
Fedora release 17 (Beefy Miracle)
Kernel 3.3.4-5.fc17.x86_64 on an x86_64 (hvc0)
localhost login:
If you can edit the kernel arguments while booting guest with grub,
append "console=ttyS0" and you will see the boot up messages in net cat.
Change-Id: I9b2fd0979dac68a7efed4d5bbcb1866cd48a0ccb
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M vdsm.spec.in
M vdsm/BindingXMLRPC.py
M vdsm/Makefile.am
A vdsm/consoleHandler.py
M vdsm/libvirtvm.py
M vdsm/supervdsmServer.py
M vdsm/vm.py
7 files changed, 140 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/10381/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 465d548..834cfa9 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -610,6 +610,7 @@
%{_datadir}/%{vdsm_name}/blkid.py*
%{_datadir}/%{vdsm_name}/caps.py*
%{_datadir}/%{vdsm_name}/clientIF.py*
+%{_datadir}/%{vdsm_name}/consoleHandler.py*
%{_datadir}/%{vdsm_name}/API.py*
%{_datadir}/%{vdsm_name}/hooking.py*
%{_datadir}/%{vdsm_name}/hooks.py*
diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py
index 23ef422..742f709 100644
--- a/vdsm/BindingXMLRPC.py
+++ b/vdsm/BindingXMLRPC.py
@@ -33,6 +33,7 @@
from vdsm.define import doneCode, errCode
import API
from vdsm.exception import VdsmException
+import consoleHandler
try:
from gluster.api import getGlusterMethods
_glusterEnabled = True
@@ -142,12 +143,8 @@
urlRouter = SecureXMLRPCServer.UrlRouter()
urlRouter.registerHandler('/$', LoggingHandler)
urlRouter.registerHandler('/RPC2$', LoggingHandler)
- # all files under /etc/vdsm/
urlRouter.registerHandler(
- '/etc/vdsm/', SimpleHTTPServer.SimpleHTTPRequestHandler)
- # TODO: subclass SimpleHTTPServer.SimpleHTTPRequestHandler to provide
- # a HTTP server forwarding the guest serial console stream and guest
- # crash core dump download
+ consoleHandler.CONSOLE_REGEX, consoleHandler.consoleHandler)
if self.enableSSL:
KEYFILE, CERTFILE, CACERT = self._getKeyCertFilenames()
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index a687c56..38d85ad 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -30,6 +30,7 @@
caps.py \
clientIF.py \
configNetwork.py \
+ consoleHandler.py \
debugPluginClient.py \
guestIF.py \
hooking.py \
diff --git a/vdsm/consoleHandler.py b/vdsm/consoleHandler.py
new file mode 100644
index 0000000..1260941
--- /dev/null
+++ b/vdsm/consoleHandler.py
@@ -0,0 +1,118 @@
+#
+# Copyright IBM Corp. 2012
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+import os
+import errno
+import asyncore
+import BaseHTTPServer
+import urlparse
+
+import supervdsm
+import storage.misc
+import API
+
+CONSOLE_REGEX = (r'/VM/' + storage.misc.UUID_REGEX.pattern[1:-1] +
+ r'/dev/console$')
+
+
+class ForwardSession(asyncore.dispatcher_with_send):
+ def __init__(self, sock, sockmap):
+ asyncore.dispatcher_with_send.__init__(self, sock, sockmap)
+ self._peer = None
+
+ def linkPeer(self, peer):
+ self._peer = peer
+
+ def unlinkPeer(self):
+ self._peer = None
+
+ def sessionExit(self):
+ try:
+ self.close()
+ except OSError as e:
+ if e.errno != errno.EBADF:
+ raise
+ myPeer = self._peer
+ self._peer = None
+ if myPeer:
+ myPeer.unlinkPeer()
+ myPeer.sessionExit()
+
+ def handle_read(self):
+ if not self._peer:
+ self.sessionExit()
+ return
+ data = self.recv(4096)
+ if data:
+ self._peer.send(data)
+
+ def handle_close(self):
+ self.sessionExit()
+
+ def readable(self):
+ if not (self._peer and self.connected):
+ return False
+ return len(self._peer.out_buffer) < 512
+
+
+class PTYSession(ForwardSession, asyncore.file_dispatcher):
+ def __init__(self, pty, sockmap):
+ ForwardSession.__init__(self, None, sockmap)
+ asyncore.file_dispatcher.__init__(self, pty, sockmap)
+
+
+class consoleHandler(BaseHTTPServer.BaseHTTPRequestHandler):
+ wbufsize = 0
+ rbufsize = 0
+ disable_nagle_algorithm = True
+
+ def do_POST(self):
+ self.close_connection = 1
+
+ pty = None
+ try:
+ vmid = urlparse.urlparse(self.path).path.split('/')[2]
+ vm = API.VM(vmid)
+ stats = vm.getStats()
+ if stats['status']['code'] != 0:
+ raise RuntimeError(stats['status']['message'])
+ ptyDev = stats['statsList'][0]['consolePath']
+ supervdsm.getProxy().takeOwnership(ptyDev)
+ pty = os.open(ptyDev, os.O_RDWR | os.O_NONBLOCK | os.O_NOCTTY)
+ except Exception as e:
+ self.send_response(404, "Error open PTY for %s: %r\n" %
+ (self.path, e))
+ self.end_headers()
+ self.wfile.flush()
+ if pty:
+ os.close(pty)
+ return
+
+ self.send_response(200)
+ self.send_header("Content-type", "application/octet-stream")
+ self.end_headers()
+ self.wfile.flush()
+
+ sockMap = {}
+ sockSession = ForwardSession(self.request, sockMap)
+ ptySession = PTYSession(pty, sockMap)
+ os.close(pty)
+ sockSession.linkPeer(ptySession)
+ ptySession.linkPeer(sockSession)
+ asyncore.loop(use_poll=True, map=sockMap)
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index d5b5e4f..a6e9361 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -1378,6 +1378,7 @@
self._getUnderlyingControllerDeviceInfo()
self._getUnderlyingBalloonDeviceInfo()
self._getUnderlyingWatchdogDeviceInfo()
+ self._getUnderlyingConsoleDeviceInfo()
# Obtain info of all unknown devices. Must be last!
self._getUnderlyingUnknownDeviceInfo()
@@ -2881,6 +2882,16 @@
nicDev['network'] = network
self.conf['devices'].append(nicDev)
+ def _getUnderlyingConsoleDeviceInfo(self):
+ '''
+ Obtain console device info from libvirt
+ '''
+ consoleElem = _domParseStr(self._lastXMLDesc).childNodes[0]. \
+ getElementsByTagName('devices')[0]. \
+ getElementsByTagName('console')[0]
+ self.conf["consolePath"] = str(
+ consoleElem.getElementsByTagName('source')[0].getAttribute('path'))
+
def _setWriteWatermarks(self):
"""
Define when to receive an event about high write to guest image
diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index 1601ba5..43cc775 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -47,7 +47,8 @@
from storage.fileUtils import chown, resolveGid, resolveUid
from storage.fileUtils import validateAccess as _validateAccess
from vdsm.constants import METADATA_GROUP, EXT_UDEVADM, \
- DISKIMAGE_USER, DISKIMAGE_GROUP, P_LIBVIRT_VMCHANNELS
+ DISKIMAGE_USER, DISKIMAGE_GROUP, P_LIBVIRT_VMCHANNELS, \
+ VDSM_USER, VDSM_GROUP
from storage.devicemapper import _removeMapping, _getPathsStatus
import configNetwork
from vdsm.config import config
@@ -292,6 +293,10 @@
def removeFs(self, path):
return mkimage.removeFs(path)
+ @logDecorator
+ def takeOwnership(self, path):
+ chown(path, VDSM_USER, VDSM_GROUP)
+
def __pokeParent(parentPid, address):
try:
diff --git a/vdsm/vm.py b/vdsm/vm.py
index e73ac6d..5a73558 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1090,6 +1090,7 @@
'displaySecurePort': self.conf['displaySecurePort'],
'displayType': self.conf['display'],
'displayIp': self.conf['displayIp'],
+ 'consolePath': self.conf['consolePath'],
'pid': self.conf['pid'],
'vmType': self.conf['vmType'],
'kvmEnable': self._kvmEnable,
--
To view, visit http://gerrit.ovirt.org/10381
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b2fd0979dac68a7efed4d5bbcb1866cd48a0ccb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
10 years, 7 months
Change in vdsm[master]: Fix vm block stats lost after recovery
by wudxw@linux.vnet.ibm.com
Mark Wu has uploaded a new change for review.
Change subject: Fix vm block stats lost after recovery
......................................................................
Fix vm block stats lost after recovery
We don't need call preparePaths() in the code path of vm recovery,
because the 'path' has been prepared on vm creatation and saved in
recovery file. But the flag _volumesPrepared still needs to be set
to make the block stats can be collected.
Change-Id: I59a90cf909a07967f642d348e47b4928f7516c61
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M vdsm/libvirtvm.py
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/6056/1
--
To view, visit http://gerrit.ovirt.org/6056
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I59a90cf909a07967f642d348e47b4928f7516c61
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
10 years, 7 months
Change in vdsm[master]: Source image exception when querying source image
by shuming@linux.vnet.ibm.com
Shu Ming has uploaded a new change for review.
Change subject: Source image exception when querying source image
......................................................................
Source image exception when querying source image
se.StorageException exception should also be converted
to se.SourceImageActionError exception
Change-Id: I6abb905f1042477aa6757d6e10d6989923e955b4
Signed-off-by: Shu Ming <shuming(a)linux.vnet.ibm.com>
---
M vdsm/storage/image.py
1 file changed, 0 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/8479/1
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 9a22863..f9cb3a0 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -457,9 +457,6 @@
try:
# Find all volumes of source image
srcChain = self.getChain(srcSdUUID, imgUUID)
- except se.StorageException:
- self.log.error("Unexpected error", exc_info=True)
- raise
except Exception, e:
self.log.error("Unexpected error", exc_info=True)
raise se.SourceImageActionError(imgUUID, srcSdUUID, str(e))
--
To view, visit http://gerrit.ovirt.org/8479
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6abb905f1042477aa6757d6e10d6989923e955b4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shu Ming <shuming(a)linux.vnet.ibm.com>
10 years, 7 months
Change in vdsm[master]: [WIP]Make HSM service self containted
by shuming@linux.vnet.ibm.com
Shu Ming has uploaded a new change for review.
Change subject: [WIP]Make HSM service self containted
......................................................................
[WIP]Make HSM service self containted
After moving the share files between common
VDSM service and HSM service to site package
directory, HSM service now can start up locally
only depending on site package files. Also make
sure the original VDSM service can startup only
depending on the site package files.
Change-Id: I7b842f6e97e7506d66226bca088e1b5296be26c4
Signed-off-by: Shu Ming <shuming(a)linux.vnet.ibm.com>
---
M vdsm/API.py
M vdsm/Makefile.am
M vdsm/alignmentScan.py
M vdsm/caps.py
M vdsm/clientIF.py
M vdsm/configNetwork.py
M vdsm/gluster/Makefile.am
M vdsm/hooking.py
M vdsm/mkimage.py
M vdsm/storage/Makefile.am
M vdsm/storage/devicemapper.py
M vdsm/storage/fileSD.py
M vdsm/storage/hsm.py
M vdsm/storage/imageRepository/formatConverter.py
M vdsm/storage/iscsi.py
M vdsm/storage/misc.py
M vdsm/storage/multipath.py
M vdsm/storage/remoteFileHandler.py
M vdsm/storage/resourceManager.py
M vdsm/storage/task.py
M vdsm/supervdsm.py
M vdsm/supervdsmServer.py
M vdsm/tc.py
23 files changed, 75 insertions(+), 70 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/11502/1
diff --git a/vdsm/API.py b/vdsm/API.py
index 0046b57..99952b0 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -32,8 +32,8 @@
import configNetwork
from vdsm import netinfo
from vdsm import constants
-import storage.misc
-import storage.clusterlock
+import vdsm.misc as misc
+import vdsm.clusterlock as clusterlock
import storage.volume
import storage.sd
import storage.image
@@ -185,7 +185,7 @@
'message': 'Missing required '
'parameter %s' % (param)}}
try:
- storage.misc.validateUUID(vmParams['vmId'])
+ misc.validateUUID(vmParams['vmId'])
except:
return {'status': {'code': errCode['MissParam']
['status']['code'],
@@ -1000,7 +1000,7 @@
def spmStart(self, prevID, prevLver, enableScsiFencing,
maxHostID=None, domVersion=None):
if maxHostID is None:
- maxHostID = storage.clusterlock.MAX_HOST_ID
+ maxHostID = clusterlock.MAX_HOST_ID
recoveryMode = None # unused
return self._irs.spmStart(self._UUID, prevID, prevLver, recoveryMode,
enableScsiFencing, maxHostID, domVersion)
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index 88b3287..8fb5969 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -29,7 +29,6 @@
blkid.py \
caps.py \
clientIF.py \
- configNetwork.py \
debugPluginClient.py \
dummybr.py \
dmidecodeUtil.py \
@@ -37,34 +36,36 @@
hooking.py \
hooks.py \
kaxmlrpclib.py \
- ksm.py \
libvirtvm.py \
- logUtils.py \
- lsblk.py \
- md_utils.py \
- mkimage.py \
momIF.py \
- neterrors.py \
nwfilter.py \
- parted_utils.py \
- supervdsm.py \
- supervdsmServer.py \
- tc.py \
vdsmDebugPlugin.py \
vmChannels.py \
vm.py \
- zombieReaper.py \
$(NULL)
dist_vdsmpylib_PYTHON = \
__init__.py \
+ configNetwork.py \
define.py \
exception.py \
+ ksm.py \
libvirtconnection.py \
+ logUtils.py \
+ lsblk.py \
+ md_utils.py \
+ mkimage.py \
+ neterrors.py \
netinfo.py \
+ parted_utils.py \
qemuImg.py \
SecureXMLRPCServer.py \
+ supervdsm.py \
+ supervdsmServer.py \
+ tc.py \
utils.py
+ zombieReaper.py \
+ $(NULL)
nodist_vdsmpylib_PYTHON = \
config.py \
diff --git a/vdsm/alignmentScan.py b/vdsm/alignmentScan.py
index 53d4ee3..9de3285 100644
--- a/vdsm/alignmentScan.py
+++ b/vdsm/alignmentScan.py
@@ -20,7 +20,7 @@
from collections import namedtuple
-from storage.misc import execCmd
+from vdsm.misc import execCmd
ScanOutput = namedtuple(
'ScanOutput',
diff --git a/vdsm/caps.py b/vdsm/caps.py
index a307200..7b6c296 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -39,7 +39,7 @@
from vdsm import netinfo
import hooks
from vdsm import utils
-import storage.hba
+import vdsm.hba as hba
# For debian systems we can use python-apt if available
try:
@@ -286,7 +286,7 @@
caps['packages2'] = _getKeyPackages()
caps['emulatedMachines'] = _getEmulatedMachines()
caps['ISCSIInitiatorName'] = _getIscsiIniName()
- caps['HBAInventory'] = storage.hba.HBAInventory()
+ caps['HBAInventory'] = hba.HBAInventory()
caps['vmTypes'] = ['kvm']
caps['memSize'] = str(utils.readMemInfo()['MemTotal'] / 1024)
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 841e962..b6a112c 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -25,7 +25,7 @@
from xml.dom import minidom
import uuid
-from storage.dispatcher import Dispatcher
+from vdsm.dispatcher import Dispatcher
from storage.hsm import HSM
from vdsm.config import config
import ksm
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 5380f31..612fc18 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -36,7 +36,7 @@
from vdsm import constants
from vdsm import utils
-from storage.misc import execCmd
+from vdsm.misc import execCmd
import neterrors as ne
from vdsm import define
from vdsm import netinfo
diff --git a/vdsm/gluster/Makefile.am b/vdsm/gluster/Makefile.am
index abecfff..1c4abd1 100644
--- a/vdsm/gluster/Makefile.am
+++ b/vdsm/gluster/Makefile.am
@@ -21,7 +21,7 @@
include $(top_srcdir)/build-aux/Makefile.subs
vdsmglusterdir = $(vdsmdir)/gluster
-dist_vdsmgluster_PYTHON = \
+dist_vdsmpylib_PYTHON = \
__init__.py \
api.py \
cli.py \
diff --git a/vdsm/hooking.py b/vdsm/hooking.py
index 02acd2e..9351a8c 100644
--- a/vdsm/hooking.py
+++ b/vdsm/hooking.py
@@ -39,7 +39,7 @@
import os
from xml.dom import minidom
-from storage.misc import execCmd
+from vdsm.misc import execCmd
from vdsm.utils import tobool
# make pyflakes happy
diff --git a/vdsm/mkimage.py b/vdsm/mkimage.py
index 0eabae2..6c1a14a 100644
--- a/vdsm/mkimage.py
+++ b/vdsm/mkimage.py
@@ -28,9 +28,9 @@
from vdsm.constants import EXT_MKFS_MSDOS, EXT_MKISOFS, \
DISKIMAGE_USER, DISKIMAGE_GROUP
from vdsm.constants import P_VDSM_RUN
-from storage.fileUtils import resolveUid, resolveGid
-import storage.misc
-import storage.mount
+from vdsm.fileUtils import resolveUid, resolveGid
+import vdsm.misc as misc
+import vdsm.mount as mount
_P_PAYLOAD_IMAGES = os.path.join(P_VDSM_RUN, 'payload')
@@ -79,13 +79,13 @@
try:
floppy = _getFileName(vmId, files)
command = [EXT_MKFS_MSDOS, '-C', floppy, '1440']
- rc, out, err = storage.misc.execCmd(command, raw=True)
+ rc, out, err = misc.execCmd(command, raw=True)
if rc:
raise OSError(errno.EIO, "could not create floppy file: "
"code %s, out %s\nerr %s" % (rc, out, err))
dirname = tempfile.mkdtemp()
- m = storage.mount.Mount(floppy, dirname)
+ m = mount.Mount(floppy, dirname)
m.mount(mntOpts='loop')
try:
_decodeFilesIntoDir(files, dirname)
@@ -105,7 +105,7 @@
isopath = _getFileName(vmId, files)
command = [EXT_MKISOFS, '-r', '-o', isopath, dirname]
- rc, out, err = storage.misc.execCmd(command, raw=True)
+ rc, out, err = misc.execCmd(command, raw=True)
if rc:
raise OSError(errno.EIO, "could not create iso file: "
"code %s, out %s\nerr %s" % (rc, out, err))
diff --git a/vdsm/storage/Makefile.am b/vdsm/storage/Makefile.am
index 8c5d8e2..aee3f56 100644
--- a/vdsm/storage/Makefile.am
+++ b/vdsm/storage/Makefile.am
@@ -25,26 +25,15 @@
__init__.py \
blockSD.py \
blockVolume.py \
- clusterlock.py \
- devicemapper.py \
- dispatcher.py \
domainMonitor.py \
fileSD.py \
- fileUtils.py \
fileVolume.py \
fuser.py \
- glusterSD.py \
- glusterVolume.py \
hba.py \
hsm.py \
image.py \
- iscsiadm.py \
- iscsi.py \
localFsSD.py \
lvm.py \
- misc.py \
- mount.py \
- multipath.py \
nfsSD.py \
outOfProcess.py \
persistentDict.py \
@@ -53,10 +42,8 @@
resourceManager.py \
sdc.py \
sd.py \
- securable.py \
sp.py \
storageConstants.py \
- storage_exception.py \
storage_mailbox.py \
storageServer.py \
sync.py \
@@ -66,6 +53,23 @@
threadPool.py \
volume.py
+dist_vdsmpylib_PYTHON = \
+ clusterlock.py \
+ devicemapper.py \
+ dispatcher.py \
+ fileUtils.py \
+ glusterSD.py \
+ glusterVolume.py
+ iscsiadm.py \
+ iscsi.py \
+ misc.py \
+ mount.py \
+ multipath.py \
+ securable.py \
+ storage_exception.py
+
+
+
EXTRA_DIST = \
12-vdsm-lvm.rules
diff --git a/vdsm/storage/devicemapper.py b/vdsm/storage/devicemapper.py
index 9ec261f..455215c 100644
--- a/vdsm/storage/devicemapper.py
+++ b/vdsm/storage/devicemapper.py
@@ -24,7 +24,7 @@
import errno
import re
-from supervdsm import getProxy
+from vdsm.supervdsm import getProxy
from vdsm.constants import EXT_DMSETUP
DMPATH_FORMAT = "/dev/mapper/%s"
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index 1730a0d..1388ad2 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -34,7 +34,7 @@
from persistentDict import PersistentDict, DictValidator
from vdsm import constants
import time
-import supervdsm
+import vdsm.supervdsm as supervdsm
import mount
REMOTE_PATH = "REMOTE_PATH"
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 832f930..cb0479e 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -63,10 +63,10 @@
from resourceFactories import IMAGE_NAMESPACE
import resourceManager as rm
import devicemapper
-import logUtils
+import vdsm.logUtils as logUtils
import mount
import dispatcher
-import supervdsm
+import vdsm.supervdsm as supervdsm
import storageServer
from vdsm import utils
diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py
index e7bf297..9abfa34 100644
--- a/vdsm/storage/imageRepository/formatConverter.py
+++ b/vdsm/storage/imageRepository/formatConverter.py
@@ -23,12 +23,12 @@
from vdsm import constants
from vdsm import qemuImg
-from storage import sd
-from storage import blockSD
-from storage import image
-from storage import volume
-from storage import blockVolume
-from storage import storage_exception as se
+import sd
+import blockSD
+import image
+import volume
+import blockVolume
+import storage_exception as se
def __convertDomainMetadataToTags(domain, targetVersion):
diff --git a/vdsm/storage/iscsi.py b/vdsm/storage/iscsi.py
index bc93f5c..8e24384 100644
--- a/vdsm/storage/iscsi.py
+++ b/vdsm/storage/iscsi.py
@@ -37,7 +37,7 @@
from threading import RLock
import iscsiadm
-import supervdsm
+import vdsm.supervdsm as supervdsm
IscsiPortal = namedtuple("IscsiPortal", "hostname, port")
IscsiTarget = namedtuple("IscsiTarget", "portal, tpgt, iqn")
diff --git a/vdsm/storage/misc.py b/vdsm/storage/misc.py
index 533a3ac..1c4c0ca 100644
--- a/vdsm/storage/misc.py
+++ b/vdsm/storage/misc.py
@@ -60,7 +60,7 @@
import storage_exception as se
from vdsm.betterPopen import BetterPopen
import fileUtils
-import logUtils
+from vdsm import logUtils
IOUSER = "vdsm"
diff --git a/vdsm/storage/multipath.py b/vdsm/storage/multipath.py
index 89adee3..cabf5ae 100644
--- a/vdsm/storage/multipath.py
+++ b/vdsm/storage/multipath.py
@@ -33,7 +33,7 @@
from vdsm import utils
import misc
import iscsi
-import supervdsm
+import vdsm.supervdsm as supervdsm
import devicemapper
import storage_exception as se
diff --git a/vdsm/storage/remoteFileHandler.py b/vdsm/storage/remoteFileHandler.py
index c12d22b..7527503 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -33,7 +33,7 @@
import misc
import fileUtils
-import zombieReaper
+import vdsm.zombieReaper as zombieReaper
# Crabs are known for their remote process calls
LENGTH_STRUCT_FMT = "Q"
diff --git a/vdsm/storage/resourceManager.py b/vdsm/storage/resourceManager.py
index 14049dc..06ce2af 100644
--- a/vdsm/storage/resourceManager.py
+++ b/vdsm/storage/resourceManager.py
@@ -28,7 +28,7 @@
import storage_exception as se
import misc
-from logUtils import SimpleLogAdapter
+from vdsm.logUtils import SimpleLogAdapter
# Errors
diff --git a/vdsm/storage/task.py b/vdsm/storage/task.py
index 9a71b37..e3b0c53 100644
--- a/vdsm/storage/task.py
+++ b/vdsm/storage/task.py
@@ -58,7 +58,7 @@
from weakref import proxy
from vdsm.config import config
import outOfProcess as oop
-from logUtils import SimpleLogAdapter
+from vdsm.logUtils import SimpleLogAdapter
getProcPool = oop.getGlobalProcPool
diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py
index 10abae0..2158a9b 100644
--- a/vdsm/supervdsm.py
+++ b/vdsm/supervdsm.py
@@ -28,7 +28,7 @@
from time import sleep
from errno import ENOENT, ESRCH
-import storage.misc as misc
+import misc as misc
from vdsm import constants, utils
_g_singletonSupervdsmInstance = None
diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index 83a5803..c48e337 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -30,28 +30,28 @@
import signal
from multiprocessing import Pipe, Process
from gluster import cli as gcli
-import storage.misc as misc
+import vdsm.misc as misc
from vdsm import utils
from parted_utils import getDevicePartedInfo as _getDevicePartedInfo
from md_utils import getMdDeviceUuidMap as _getMdDeviceUuidMap
from lsblk import getLsBlk as _getLsBlk
-from storage.multipath import getScsiSerial as _getScsiSerial
-from storage.iscsi import forceIScsiScan as _forceIScsiScan
-from storage.iscsi import getDevIscsiInfo as _getdeviSCSIinfo
-from storage.iscsi import readSessionInfo as _readSessionInfo
+from vdsm.multipath import getScsiSerial as _getScsiSerial
+from vdsm.iscsi import forceIScsiScan as _forceIScsiScan
+from vdsm.iscsi import getDevIscsiInfo as _getdeviSCSIinfo
+from vdsm.iscsi import readSessionInfo as _readSessionInfo
from supervdsm import _SuperVdsmManager
-from storage.fileUtils import chown, resolveGid, resolveUid
-from storage.fileUtils import validateAccess as _validateAccess
+from vdsm.fileUtils import chown, resolveGid, resolveUid
+from vdsm.fileUtils import validateAccess as _validateAccess
from vdsm.constants import METADATA_GROUP, EXT_UDEVADM, \
DISKIMAGE_USER, DISKIMAGE_GROUP, P_LIBVIRT_VMCHANNELS
-from storage.devicemapper import _removeMapping, _getPathsStatus
+from vdsm.devicemapper import _removeMapping, _getPathsStatus
import configNetwork
from vdsm.config import config
import tc
import ksm
import mkimage
-from storage.multipath import MPATH_CONF
+from vdsm.multipath import MPATH_CONF
import zombieReaper
_UDEV_RULE_FILE_DIR = "/etc/udev/rules.d/"
diff --git a/vdsm/tc.py b/vdsm/tc.py
index e3c2770..99403c4 100644
--- a/vdsm/tc.py
+++ b/vdsm/tc.py
@@ -26,7 +26,7 @@
import ethtool
-import storage.misc
+import vdsm.misc as misc
from vdsm.constants import EXT_TC
ERR_DEV_NOEXIST = 2
@@ -99,7 +99,7 @@
def _process_request(command):
- retcode, out, err = storage.misc.execCmd(command, raw=True, sudo=False)
+ retcode, out, err = misc.execCmd(command, raw=True, sudo=False)
if retcode != 0:
raise TrafficControlException(retcode, err, command)
return out
--
To view, visit http://gerrit.ovirt.org/11502
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b842f6e97e7506d66226bca088e1b5296be26c4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shu Ming <shuming(a)linux.vnet.ibm.com>
10 years, 7 months
Change in vdsm[master]: '0' is a valid master version
by shuming@linux.vnet.ibm.com
Shu Ming has uploaded a new change for review.
Change subject: '0' is a valid master version
......................................................................
'0' is a valid master version
When connecting the storage pool first time with
master domain version '0', exception happens not
finding the temporary pool file for pool parameters.
Change-Id: I736d917bfa7d3a5ac59cddcaf1a18846f53d85b0
Signed-off-by: Shu Ming <shuming(a)linux.vnet.ibm.com>
---
M vdsm/storage/hsm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/7948/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 1e9311b..f7f8b49 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -849,7 +849,7 @@
return
pool = sp.StoragePool(spUUID, self.taskMng)
- if not hostID or not scsiKey or not msdUUID or not masterVersion:
+ if not hostID or not scsiKey or not msdUUID or (masterVersion == None):
hostID, scsiKey, msdUUID, masterVersion = pool.getPoolParams()
res = pool.connect(hostID, scsiKey, msdUUID, masterVersion)
if res:
--
To view, visit http://gerrit.ovirt.org/7948
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I736d917bfa7d3a5ac59cddcaf1a18846f53d85b0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shu Ming <shuming(a)linux.vnet.ibm.com>
10 years, 7 months
Change in vdsm[master]: persist state in _changeBlockDev
by lvroyce@linux.vnet.ibm.com
Royce Lv has uploaded a new change for review.
Change subject: persist state in _changeBlockDev
......................................................................
persist state in _changeBlockDev
persist state to make vm.conf survive recovery
Change-Id: I220b72ebb360356092a2dccc25dfb9f63f638607
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
M vdsm/libvirtvm.py
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/8617/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index bd43b56..abd8440 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -2028,6 +2028,8 @@
['message']}}
self.cif.teardownVolumePath(self.conf.get(vmDev))
self.conf[vmDev] = path
+ # persist state to keep vm conf consistency in recovery
+ self.saveState()
return {'status': doneCode, 'vmList': self.status()}
def setTicket(self, otp, seconds, connAct, params):
--
To view, visit http://gerrit.ovirt.org/8617
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I220b72ebb360356092a2dccc25dfb9f63f638607
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
10 years, 7 months