Change in vdsm[master]: Encapsulate vdsm-unregister into vdsm-tool function
by lilei@linux.vnet.ibm.com
Lei Li has uploaded a new change for review.
Change subject: Encapsulate vdsm-unregister into vdsm-tool function
......................................................................
Encapsulate vdsm-unregister into vdsm-tool function
Change-Id: I7348baeabbdcbb0c2da64170b6957430feaa1954
Signed-off-by: Lei Li <lilei(a)linux.vnet.ibm.com>
---
M vdsm-tool/Makefile.am
A vdsm-tool/register.py
M vdsm.spec.in
3 files changed, 43 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/27/4527/1
--
To view, visit http://gerrit.ovirt.org/4527
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7348baeabbdcbb0c2da64170b6957430feaa1954
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Lei Li <lilei(a)linux.vnet.ibm.com>
10 years, 5 months
Change in vdsm[master]: add a jsonrpcSeverClient for jsonRPC Server functional test
by shaohef@linux.vnet.ibm.com
ShaoHe Feng has uploaded a new change for review.
Change subject: add a jsonrpcSeverClient for jsonRPC Server functional test
......................................................................
add a jsonrpcSeverClient for jsonRPC Server functional test
This jsonrpcSeverClient is easy to call the jsonRPC server.
And it is an example for user to call the jsonRPC server.
The jsonrpcSeverClient will parser the vdsmapi-schema.json.
It will generate the method of vdsm-api dynamically.
Then we can easy call the vdsm-api, refer to vdsm-api.html.
vdsm-api.html is in the vdsm doc path.
Some comments tell us how to call the vdsm-api at the end of
jsonrpcSeverClient.py
Change-Id: Ib081e26203638114d7d632489432a50eeea45dd4
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
M tests/functional/Makefile.am
A tests/functional/jsonrpcSeverClient.py
2 files changed, 144 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/11283/1
diff --git a/tests/functional/Makefile.am b/tests/functional/Makefile.am
index 030242b..e3374e8 100644
--- a/tests/functional/Makefile.am
+++ b/tests/functional/Makefile.am
@@ -21,6 +21,7 @@
vdsmfunctestsdir = ${vdsmtestsdir}/functional
dist_vdsmfunctests_PYTHON = \
+ jsonrpcSeverClient.py \
momTests.py \
sosPluginTests.py \
xmlrpcTests.py \
diff --git a/tests/functional/jsonrpcSeverClient.py b/tests/functional/jsonrpcSeverClient.py
new file mode 100644
index 0000000..77af03b
--- /dev/null
+++ b/tests/functional/jsonrpcSeverClient.py
@@ -0,0 +1,143 @@
+#
+# Copyright 2012 Red Hat, Inc.
+#
+# 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 json
+import os
+import socket
+import ssl
+import struct
+import vdsmapi
+from functools import partial
+from contextlib import closing
+from vdsm.config import config
+from vdsm import constants
+
+
+class ConnectionError(Exception):
+ pass
+
+
+class ProtocolError(Exception):
+ pass
+
+
+class jsonRpcServerClient(object):
+
+ #TODO: spport ssl
+ def __init__(self, ip, port, certReq=False, tsPath=None):
+ self._ip = ip
+ self._port = port
+ self._tsPath = tsPath
+ self._Size = struct.Struct("!Q")
+ self._cert_reqs = ssl.CERT_REQUIRED if certReq else ssl.CERT_NONE
+ schema = os.path.join(constants.P_VDSM, 'vdsmapi-schema.json')
+ self._dynamicAttribute(schema)
+
+ def buildMessage(self, data):
+ msg = json.dumps(data)
+ msg = msg.encode('utf-8')
+ msize = self._Size.pack(len(msg))
+ resp = msize + msg
+ return resp
+
+ def _createRequest(self, method, reqId=None, params=()):
+ return {'jsonrpc': '2.0', "id": reqId, "method": method,
+ "params": params}
+
+ def sendMessage(self, msg):
+ with closing(socket.socket(socket.AF_INET,
+ socket.SOCK_STREAM)) as tcp_sock:
+ if self._cert_reqs == ssl.CERT_REQUIRED:
+ if self._tsPath is None:
+ self._tsPath = config.get('vars', 'trust_store_path')
+ KEYFILE = self._tsPath + '/keys/vdsmkey.pem'
+ CERTFILE = self._tsPath + '/certs/vdsmcert.pem'
+ CACERT = self._tsPath + '/certs/cacert.pem'
+ sock = ssl.wrap_socket(tcp_sock,
+ keyfile=KEYFILE,
+ certfile=CERTFILE,
+ ca_certs=CACERT,
+ cert_reqs=self._cert_reqs)
+ else:
+ sock = tcp_sock
+ sock.settimeout(3) # TBD timeout
+ try:
+ sock.connect((self._ip, self._port))
+ except socket.error as e:
+ raise ConnectionError("Unable to connect to server: %s", e)
+ try:
+ sock.sendall(msg)
+ except (socket.error, socket.timeout), e:
+ raise ProtocolError("Unable to send request: %s", e)
+ try:
+ data = sock.recv(self._Size.size)
+ except socket.error as e:
+ raise ProtocolError("Unable to read response length: %s", e)
+ if not data:
+ raise ProtocolError("No data received")
+ msgLen = self._Size.unpack(data)[0]
+ try:
+ data = sock.recv(msgLen)
+ except socket.error as e:
+ raise ProtocolError("Unable to read response body: %s", e)
+ if len(data) != msgLen:
+ raise ProtocolError("Response body length mismatch")
+ return json.loads(data)
+
+ def call(self, method, reqId=None, params=()):
+ msg = self.buildMessage(self._createRequest(method, reqId, params))
+ reply = self.sendMessage(msg)
+ return reply
+
+ def _dynamicAttribute(self, schema):
+ self.dynamicAttr = {}
+ with open(schema) as f:
+ symbols = vdsmapi.parse_schema(f)
+ for s in symbols:
+ if 'command' in s:
+ className = s['command']['class']
+ functionName = s['command']['name']
+ if className not in self.dynamicAttr.keys():
+ self.dynamicAttr[className] = []
+ self.dynamicAttr[className].append(functionName)
+ for key, funs in self.dynamicAttr.items():
+ funDicts = {}
+ for fun in funs:
+ method = ".".join((key, fun))
+ funDicts[fun] = partial(self.call, method)
+ cls = type(key, (object,), funDicts)
+ setattr(self, key, cls())
+
+
+if __name__ == '__main__':
+ if not config.getboolean('vars', 'jsonrpc_enable'):
+ exit(1)
+
+ ip = "127.0.0.1"
+ port = config.getint('addresses', 'json_port')
+ rpcIns = jsonRpcServerClient(ip, port)
+
+ # test the RpcClient
+ # you can open vdsm-api.html by your browser, such as by firefox
+ # firefox /usr/share/doc/vdsm-*/vdsm-api.html
+ # vdsm-api.html is in the vdsm doc path.
+ # then can call the API show in vdsm-api.html as follow
+ print rpcIns.call("Host.getAllTasksInfo", 1)
+ print rpcIns.Host.getAllTasksInfo(1)
--
To view, visit http://gerrit.ovirt.org/11283
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib081e26203638114d7d632489432a50eeea45dd4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
10 years, 5 months
Change in vdsm[master]: [WIP] objectfs integration
by peet@redhat.com
Peter V. Saveliev has uploaded a new change for review.
Change subject: [WIP] objectfs integration
......................................................................
[WIP] objectfs integration
Export VM objects as files in runtime.
Signed-off-by: Peter V. Saveliev <peet(a)redhat.com>
Change-Id: I6dd2ca2245f3f5496eca9f8c14bed79d4638c189
---
M vdsm/vm.py
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/8383/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index d49eef1..cd6c6ca 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -33,6 +33,7 @@
from logUtils import SimpleLogAdapter
import libvirt
from vdsm import vdscli
+from pyvfs.objectfs import export
DEFAULT_BRIDGE = config.get("vars", "default_bridge")
@@ -250,6 +251,12 @@
'Restoring state', 'Saving State',
'Up', 'WaitForLaunch')
+
+@export(blacklist=[
+ "/log",
+ "/MigrationSourceThreadClass",
+ "/cif",
+ ])
class Vm(object):
"""
Used for abstracting communication between various parts of the
--
To view, visit http://gerrit.ovirt.org/8383
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6dd2ca2245f3f5496eca9f8c14bed79d4638c189
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Peter V. Saveliev <peet(a)redhat.com>
10 years, 5 months
Change in vdsm[master]: vdsm: catch timeout while starting VM
by peet@redhat.com
Peter V. Saveliev has uploaded a new change for review.
Change subject: vdsm: catch timeout while starting VM
......................................................................
vdsm: catch timeout while starting VM
If the requested VM does not start within given timeout,
set its status to «down» and throw an exception.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=755528
Signed-off-by: Peter V. Saveliev <peet(a)redhat.com>
Change-Id: I233d3c6cf1e62e46d005b8a6d502a02438100daa
---
M vdsm/vm.py
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/12235/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 8b2bbb6..19e6aa4 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -35,6 +35,7 @@
import libvirt
from vdsm import vdscli
+__timeout__ = 10
DEFAULT_BRIDGE = config.get("vars", "default_bridge")
DISK_DEVICES = 'disk'
@@ -657,6 +658,10 @@
def run(self):
self._creationThread.start()
+ self._creationThread.join(__timeout__)
+ if self._creationThread.is_alive():
+ self.setDownStatus(ERROR, 'timeout while starting vm')
+ raise Exception("timeout exception")
def memCommit(self):
"""
--
To view, visit http://gerrit.ovirt.org/12235
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I233d3c6cf1e62e46d005b8a6d502a02438100daa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Peter V. Saveliev <peet(a)redhat.com>
10 years, 5 months
Change in vdsm[master]: vdsm: cope with I/O errors, getting permissions
by peet@redhat.com
Peter V. Saveliev has uploaded a new change for review.
Change subject: vdsm: cope with I/O errors, getting permissions
......................................................................
vdsm: cope with I/O errors, getting permissions
Treat OSError during floppy image permission check as a
read-only floppy. Later the floppy can be safely "ejected",
if the error persists.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=755528
Change-Id: I1f595a7adc05cd2efbfb831c247233ecb01da05a
Signed-off-by: Peter V. Saveliev <peet(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 9 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/18371/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 4f80b4c..165670a 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1531,10 +1531,15 @@
driverAttrs['error_policy'] = 'stop'
diskelem.appendChildWithArgs('driver', **driverAttrs)
elif self.device == 'floppy':
- if (self.path and
- not utils.getUserPermissions(constants.QEMU_PROCESS_USER,
- self.path)['write']):
- diskelem.appendChildWithArgs('readonly')
+ if self.path:
+ try:
+ wp = utils.getUserPermissions(constants.QEMU_PROCESS_USER,
+ self.path)['write'])
+ except OSError:
+ wp = False
+
+ if not wp:
+ diskelem.appendChildWithArgs('readonly')
if hasattr(self, 'specParams') and 'ioTune' in self.specParams:
self._validateIoTuneParams()
--
To view, visit http://gerrit.ovirt.org/18371
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f595a7adc05cd2efbfb831c247233ecb01da05a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Peter V. Saveliev <peet(a)redhat.com>
10 years, 5 months
Change in vdsm[master]: new API call getVersionInfo()
by peet@redhat.com
Peter V. Saveliev has uploaded a new change for review.
Change subject: new API call getVersionInfo()
......................................................................
new API call getVersionInfo()
getCapabilities() is too expensive to discover the target VDSM
version e.g. for migration
Signed-off-by: Peter V. Saveliev <peet(a)redhat.com>
Change-Id: I3f55ef437ca404ca04598d34c41756b1e68ced95
---
M vdsm/API.py
M vdsm/BindingXMLRPC.py
M vdsm_api/vdsmapi-schema.json
3 files changed, 50 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/8431/1
diff --git a/vdsm/API.py b/vdsm/API.py
index bbc3221..f95ac80 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -39,6 +39,7 @@
import storage.image
from vdsm.define import doneCode, errCode, Kbytes, Mbytes
import caps
+import dsaversion
from vdsm.config import config
import supervdsm
@@ -328,6 +329,12 @@
return errCode['noVM']
return v.migrateStatus()
+ def getVersionInfo(self):
+ """
+ """
+ info = dsaversion.version_info
+ return {'status': doneCode, 'info': info}
+
def getStats(self):
"""
Obtain statistics of the specified VM
diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py
index fc57019..351e3a0 100644
--- a/vdsm/BindingXMLRPC.py
+++ b/vdsm/BindingXMLRPC.py
@@ -284,6 +284,10 @@
ret['info'].update(self.getServerInfo())
return ret
+ def getVersionInfo(self):
+ api = API.Global()
+ return api.getVersionInfo()
+
def getStats(self):
api = API.Global()
return api.getStats()
@@ -748,6 +752,7 @@
(self.vmGetMigrationStatus, 'migrateStatus'),
(self.vmMigrationCancel, 'migrateCancel'),
(self.getCapabilities, 'getVdsCapabilities'),
+ (self.getVersionInfo, 'getVersionInfo'),
(self.getStats, 'getVdsStats'),
(self.vmGetStats, 'getVmStats'),
(self.getAllVmStats, 'getAllVmStats'),
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 10d2aaa..a1b5ba3 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -1515,6 +1515,44 @@
'returns': 'HostStats'}
##
+# @VdsmCapabilities:
+#
+# Host information and capabilities.
+#
+# @version_name: The name given to this version of VDSM
+#
+# @software_version: VDSM version (x.y.z)
+#
+# @software_revision: Extra VDSM version information
+#
+# @supportedRHEVMs: A list of supported ovirt-engine versions
+#
+# @supportedProtocols: A list of supported xmlrpc protocol versions
+#
+# @clusterLevels: A list of supported cluster versions
+#
+# Since: 4.10.1
+#
+##
+{'type': 'HostInfo',
+ 'data': {'version_name': 'str', 'software_version': 'str',
+ 'software_revision': 'str', 'supportedRHEVMs': ['str'],
+ 'supportedProtocols': ['str'], 'clusterLevels': ['str']}}
+
+##
+## @Host.getVersionInfo:
+#
+# Get VDSM version information
+#
+# Returns:
+# The versions dictionary
+#
+# Since: 4.10.1
+##
+{'command': {'class': 'Host', 'name': 'getVersionInfo'},
+ 'returns': 'HostInfo'}
+
+##
# @StorageDomainImageClass:
#
# An enumeration of Storage Domain classes.
--
To view, visit http://gerrit.ovirt.org/8431
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f55ef437ca404ca04598d34c41756b1e68ced95
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Peter V. Saveliev <peet(a)redhat.com>
10 years, 5 months
Change in vdsm[master]: Change log message from warning to debug
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: Change log message from warning to debug
......................................................................
Change log message from warning to debug
Related to BZ#876558
Change-Id: I87d78a36abe0751960ecd4e7798d79210a3a0704
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm/storage/blockVolume.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/21/10621/1
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
index 186ca95..f399d58 100644
--- a/vdsm/storage/blockVolume.py
+++ b/vdsm/storage/blockVolume.py
@@ -641,7 +641,7 @@
def _getVolumeTag(sdUUID, volUUID, tagPrefix):
tags = lvm.getLV(sdUUID, volUUID).tags
if TAG_VOL_UNINIT in tags:
- log.warning("Reloading uninitialized volume %s/%s", sdUUID, volUUID)
+ log.debug("Reloading uninitialized volume %s/%s", sdUUID, volUUID)
lvm.invalidateVG(sdUUID)
tags = lvm.getLV(sdUUID, volUUID).tags
if TAG_VOL_UNINIT in tags:
--
To view, visit http://gerrit.ovirt.org/10621
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I87d78a36abe0751960ecd4e7798d79210a3a0704
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
10 years, 5 months
Change in vdsm[master]: Move uninstall preun section to vdsm-unregister
by lilei@linux.vnet.ibm.com
Lei Li has uploaded a new change for review.
Change subject: Move uninstall preun section to vdsm-unregister
......................................................................
Move uninstall preun section to vdsm-unregister
The specfile vdsm.spec.in has very long %post and %preun
sections, move the install/uninstall hooks into vdsm-tool.
This patch move unregister to a script which will be
encapsulated into a vdsm-tool function stop-vdsm-service.
Change-Id: I4e7b5dc969dfb51e6880b9bb209a363609f5e123
Signed-off-by: Lei Li <lilei(a)linux.vnet.ibm.com>
---
M vdsm.spec.in
M vdsm/Makefile.am
A vdsm/vdsm-unregister.in
3 files changed, 36 insertions(+), 42 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/4526/1
--
To view, visit http://gerrit.ovirt.org/4526
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e7b5dc969dfb51e6880b9bb209a363609f5e123
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Lei Li <lilei(a)linux.vnet.ibm.com>
10 years, 5 months
Change in vdsm[master]: utils.py: Add hostUUID retrieval support for KVM on PPC64
by Pradipta Kumar Banerjee
Pradipta Banerjee has uploaded a new change for review.
Change subject: utils.py: Add hostUUID retrieval support for KVM on PPC64
......................................................................
utils.py: Add hostUUID retrieval support for KVM on PPC64
Change-Id: I7a557b096550631e340fcc61bcb3fa4c3ae73837
Signed-off-by: Pradipta Kr. Banerjee <bpradip(a)in.ibm.com>
---
M vdsm/utils.py
1 file changed, 16 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/37/8637/1
diff --git a/vdsm/utils.py b/vdsm/utils.py
index 0dbb342..80582d4 100644
--- a/vdsm/utils.py
+++ b/vdsm/utils.py
@@ -37,6 +37,7 @@
import functools
import stat
import glob
+import platform
import ethtool
@@ -701,19 +702,23 @@
with open(constants.P_VDSM_NODE_ID) as f:
__hostUUID = f.readline().replace("\n", "")
else:
- p = subprocess.Popen([constants.EXT_SUDO,
+ arch = platform.machine()
+ if arch == 'x86_64':
+ p = subprocess.Popen([constants.EXT_SUDO,
constants.EXT_DMIDECODE, "-s", "system-uuid"],
- close_fds=True, stdin=subprocess.PIPE,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- out, err = p.communicate()
- out = '\n'.join( line for line in out.splitlines()
+ close_fds=True, stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ out, err = p.communicate()
+ out = '\n'.join( line for line in out.splitlines()
if not line.startswith('#') )
- if p.returncode == 0 and 'Not' not in out:
- #Avoid error string - 'Not Settable' or 'Not Present'
- __hostUUID = out.strip()
- else:
- logging.warning('Could not find host UUID.')
+ if p.returncode == 0 and 'Not' not in out:
+ #Avoid error string - 'Not Settable' or 'Not Present'
+ __hostUUID = out.strip()
+ elif arch == 'ppc64':
+ if os.path.exists('/proc/device-tree/system-id'):
+ #eg. output IBM,03061C14A
+ __hostUUID = file('/proc/device-tree/system-id').readline().replace(",", "")
try:
mac = sorted(_getAllMacs())[0]
@@ -724,6 +729,7 @@
if __hostUUID != "None":
__hostUUID += "_" + mac
else:
+ logging.warning('Could not find host UUID')
__hostUUID = "_" + mac
except:
logging.error("Error retrieving host UUID", exc_info=True)
--
To view, visit http://gerrit.ovirt.org/8637
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a557b096550631e340fcc61bcb3fa4c3ae73837
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Pradipta Banerjee <bpradip(a)in.ibm.com>
10 years, 5 months
Change in vdsm[master]: vdsm: Reduce the migration progress timeout
by Vinzenz Feenstra
Vinzenz Feenstra has uploaded a new change for review.
Change subject: vdsm: Reduce the migration progress timeout
......................................................................
vdsm: Reduce the migration progress timeout
The progress of the migration should indicate a stuck migration
way before the currently configured migration_timeout, which has
by default 300 seconds.
Half of the time should be more than enough for now.
This commit introduces the migration_progress_timeout configuration
value to be able adjusting this value.
Change-Id: I8f314d70b8f32cfff58f9776bcc2182a748a9b67
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M lib/vdsm/config.py.in
M vdsm/vm.py
2 files changed, 7 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/16602/1
diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index 2a5618a..d95c78d 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -52,6 +52,11 @@
'Please note, that this is not overall migration timeout. '
'Source waits twice as long (to avoid races).'),
+ ('migration_progress_timeout', '150',
+ 'Maximum time the source host waits during a migration in case '
+ 'that there is no progress. If the time has passed, the migration '
+ 'will be aborted.'),
+
('migration_listener_timeout', '30',
'Time to wait (in seconds) for migration destination to start '
'listening before migration begins.'),
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 281c584..309a1bd 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -746,6 +746,7 @@
lastProgressTime = time.time()
smallest_dataRemaining = None
+ progress_timeout = config.getint('vars', 'migration_progress_timeout')
while not self._stop.isSet():
self._stop.wait(self._MIGRATION_MONITOR_INTERVAL)
@@ -758,8 +759,7 @@
smallest_dataRemaining > dataRemaining):
smallest_dataRemaining = dataRemaining
lastProgressTime = time.time()
- elif (time.time() - lastProgressTime >
- config.getint('vars', 'migration_timeout')):
+ elif (time.time() - lastProgressTime) > progress_timeout:
# Migration is stuck, abort
self._vm.log.warn(
'Migration is stuck: Hasn\'t progressed in %s seconds. '
--
To view, visit http://gerrit.ovirt.org/16602
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f314d70b8f32cfff58f9776bcc2182a748a9b67
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
10 years, 5 months