Change in vdsm[master]: netinfo: rework reporting of DHCPv4/6 on network devices
by osvoboda@redhat.com
Ondřej Svoboda has uploaded a new change for review.
Change subject: netinfo: rework reporting of DHCPv4/6 on network devices
......................................................................
netinfo: rework reporting of DHCPv4/6 on network devices
This patch addresses the same problem [1] as commit b92edb but
hopefully in a more readable way.
[1] DHCP still being reported for hours after a network got static
IP configuration, because reporting is based on dhclient's leases.
Change-Id: Iaffdc836f8f64ecdc0a7e37ef50c228032f99696
Bug-Url: https://bugzilla.redhat.com/1184497
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M lib/vdsm/netinfo.py
1 file changed, 19 insertions(+), 18 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/30/46430/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index 1ca5c06..a2c0eab 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -481,10 +481,6 @@
else:
try:
if family == 4:
- # Read dhcpv4 from an associated network's reported information
- if 'dhcpv4' in net_attrs:
- return net_attrs['dhcpv4']
- # Read the same information from RunningConfig
return net_attrs['bootproto'] == 'dhcp'
else:
return net_attrs['dhcpv6']
@@ -531,12 +527,20 @@
return data
-def _netinfo_by_device(networks):
- netinfo_by_device = {}
- for net_attrs in networks.itervalues():
- device = net_attrs['iface']
- netinfo_by_device[device] = net_attrs
- return netinfo_by_device
+def _update_reported_dhcp(net_attrs, netinfo):
+ """
+ Report DHCPv4/6 of a network's underlying device based on the network's
+ configuration, to fix bug #1184497 (DHCP still being reported for hours
+ after a network got static IP configuration, because reporting is based on
+ dhclient's leases).
+ """
+ underlying_device = net_attrs['iface']
+ for devices in ('bridges', 'vlans', 'bondings', 'nics'):
+ devinfo = netinfo[devices].get(underlying_device)
+ if devinfo:
+ devinfo['dhcpv4'] = net_attrs['dhcpv4']
+ devinfo['dhcpv6'] = net_attrs['dhcpv6']
+ break
def _bridgeinfo(link):
@@ -577,7 +581,7 @@
return {'iface': link.device, 'vlanid': link.vlanid}
-def _devinfo(link, routes, ipaddrs, dhcpv4_ifaces, dhcpv6_ifaces, net_attrs):
+def _devinfo(link, routes, ipaddrs, dhcpv4_ifaces, dhcpv6_ifaces):
gateway = _get_gateway(routes, link.name)
ipv4addr, ipv4netmask, ipv4addrs, ipv6addrs = getIpInfo(
link.name, ipaddrs, gateway)
@@ -587,9 +591,8 @@
'ipv6addrs': ipv6addrs,
'gateway': gateway,
'ipv6gateway': _get_gateway(routes, link.name, family=6),
- 'dhcpv4': _dhcp_used(link.name, dhcpv4_ifaces, net_attrs),
- 'dhcpv6': _dhcp_used(link.name, dhcpv6_ifaces, net_attrs,
- family=6),
+ 'dhcpv4': link.name in dhcpv4_ifaces, # to be refined if a network
+ 'dhcpv6': link.name in dhcpv6_ifaces, # is not configured for DHCP
'mtu': str(link.mtu),
'netmask': ipv4netmask}
if 'BOOTPROTO' not in info['cfg']:
@@ -784,8 +787,6 @@
else:
d['networks'] = vdsmnets
- netinfo_by_device = _netinfo_by_device(d['networks'])
-
for dev in (link for link in getLinks() if not link.isHidden()):
if dev.isBRIDGE():
devinfo = d['bridges'][dev.name] = _bridgeinfo(dev)
@@ -798,8 +799,7 @@
else:
continue
devinfo.update(_devinfo(dev, routes, ipaddrs, dhcpv4_ifaces,
- dhcpv6_ifaces,
- netinfo_by_device.get(dev.name, None)))
+ dhcpv6_ifaces))
if dev.isBOND():
_bondOptsCompat(devinfo)
_bondCustomOpts(dev, devinfo, running_config)
@@ -807,6 +807,7 @@
for net, attrs in d['networks'].iteritems():
if attrs['bridged']:
attrs['cfg'] = d['bridges'][net]['cfg']
+ _update_reported_dhcp(attrs, d)
return d
--
To view, visit https://gerrit.ovirt.org/46430
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaffdc836f8f64ecdc0a7e37ef50c228032f99696
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: Don't prepare image with illegal volumes
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: Don't prepare image with illegal volumes
......................................................................
Don't prepare image with illegal volumes
The irs verb 'prepareImage' is used only by clientIF when preparing the
host to start a VM. Currently, this operation succeeds even if one or
more of the volumes in the image is illegal. Since we should never
permit a VM to start with an illegal disk, check for this and report an
error if any illegal volumes are found.
The pivot stage of a live merge operation depends on this behavior to
ensure that a VM is not accidentally started using a stale leaf volume.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1206722
Change-Id: Ie543aeb8bdb52305419613ab6297681817124308
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/39302/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 8f07586..dc8ca77 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3225,6 +3225,11 @@
if leafUUID not in imgVolumes:
raise se.VolumeDoesNotExist(leafUUID)
+ for volUUID in imgVolumes:
+ legality = dom.produceVolume(imgUUID, volUUID).getLegality()
+ if legality == volume.ILLEGAL_VOL:
+ raise se.prepareIllegalVolumeError(volUUID)
+
imgPath = dom.activateVolumes(imgUUID, imgVolumes)
if spUUID and spUUID != sd.BLANK_UUID:
runImgPath = dom.linkBCImage(imgPath, imgUUID)
--
To view, visit https://gerrit.ovirt.org/39302
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie543aeb8bdb52305419613ab6297681817124308
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: ssl: runtime config to choose implementation
by Piotr Kliczewski
Piotr Kliczewski has uploaded a new change for review.
Change subject: ssl: runtime config to choose implementation
......................................................................
ssl: runtime config to choose implementation
During build process we can choose to use standard ssl module or both
m2crypto and ssl module. First option is dedicated enable debian support
whereas second options make it possible to choose an implementation by
setting ssl_impl config value to m2c or ssl.
Change-Id: I9881d11e30ced9c34bfe602bba3d968f57e0fe15
Signed-off-by: pkliczewski <piotr.kliczewski(a)gmail.com>
---
M lib/vdsm/config.py.in
M lib/vdsm/jsonrpcvdscli.py
M lib/vdsm/vdscli.py
M lib/yajsonrpc/stompreactor.py
M vdsm.spec.in
M vdsm/clientIF.py
M vdsm/kaxmlrpclib.py
M vdsm/protocoldetector.py
M vdsm/virt/migration.py
9 files changed, 37 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/44689/1
diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index 8f2e519..6f5a719 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -203,6 +203,9 @@
('connection_stats_timeout', '3600',
'Time in seconds defining how frequently we log transport stats'),
+
+ ('ssl_impl', 'm2c',
+ 'Specifies which ssl impl should be used. m2c by default'),
]),
# Section: [mom]
diff --git a/lib/vdsm/jsonrpcvdscli.py b/lib/vdsm/jsonrpcvdscli.py
index 8d8aa0a..ae8965a 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -30,7 +30,10 @@
from vdsm import response
from .config import config
try:
- from . import m2cutils as sslutils
+ if config.get('vars', 'ssl_impl') == 'm2c':
+ from . import m2cutils as sslutils
+ else:
+ from . import sslutils
except ImportError:
from . import sslutils
diff --git a/lib/vdsm/vdscli.py b/lib/vdsm/vdscli.py
index cf083e3..e655c0d 100644
--- a/lib/vdsm/vdscli.py
+++ b/lib/vdsm/vdscli.py
@@ -26,8 +26,12 @@
import re
import sys
from xml.parsers.expat import ExpatError
+from .config import config
try:
- from . import m2cutils as sslutils
+ if config.get('vars', 'ssl_impl') == 'm2c':
+ from . import m2cutils as sslutils
+ else:
+ from . import sslutils
except ImportError:
from . import sslutils
diff --git a/lib/yajsonrpc/stompreactor.py b/lib/yajsonrpc/stompreactor.py
index b1eda30..4cab4aa 100644
--- a/lib/yajsonrpc/stompreactor.py
+++ b/lib/yajsonrpc/stompreactor.py
@@ -27,7 +27,10 @@
from . import stomp
from .betterAsyncore import Dispatcher, Reactor
try:
- from vdsm.m2cutils import SSLSocket
+ if config.get('vars', 'ssl_impl') == 'm2c':
+ from vdsm.m2cutils import SSLSocket
+ else:
+ from ssl import SSLSocket
except ImportError:
from ssl import SSLSocket
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 33e89e1..851c0d3 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -42,7 +42,8 @@
%global _polkitdir %{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d
%endif
-# enable m2crypto by default
+# 0 - enabled ssl
+# 1 - enabled both implementations by default
%global with_m2c 1
# Gluster should not be shipped with RHEV
@@ -1071,7 +1072,7 @@
%{python_sitelib}/%{vdsm_name}/schedule.py*
%if %{with_m2c}
%{python_sitelib}/%{vdsm_name}/m2cutils.py*
-%exclude %{python_sitelib}/%{vdsm_name}/sslutils.py*
+%{python_sitelib}/%{vdsm_name}/sslutils.py*
%else
%exclude %{python_sitelib}/%{vdsm_name}/m2cutils.py*
%{python_sitelib}/%{vdsm_name}/sslutils.py*
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 043383a..0020a1c 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -55,7 +55,10 @@
from virt.vmdevices import hwclass
from virt.utils import isVdsmImage
try:
- from vdsm import m2cutils as sslutils
+ if config.get('vars', 'ssl_impl') == 'm2c':
+ from vdsm import m2cutils as sslutils
+ else:
+ from vdsm import sslutils
except ImportError:
from vdsm import sslutils
try:
diff --git a/vdsm/kaxmlrpclib.py b/vdsm/kaxmlrpclib.py
index b0640e8..d43230f 100644
--- a/vdsm/kaxmlrpclib.py
+++ b/vdsm/kaxmlrpclib.py
@@ -109,9 +109,13 @@
_connection_class = TcpkeepHTTPConnection
###################
+from vdsm.config import config
# the same, for ssl
try:
- from vdsm import m2cutils as sslutils
+ if config.get('vars', 'ssl_impl') == 'm2c':
+ from vdsm import m2cutils as sslutils
+ else:
+ from vdsm import sslutils
except ImportError:
from vdsm import sslutils
import ssl
diff --git a/vdsm/protocoldetector.py b/vdsm/protocoldetector.py
index dbdc730..d06fb3d 100644
--- a/vdsm/protocoldetector.py
+++ b/vdsm/protocoldetector.py
@@ -23,9 +23,13 @@
import vdsm.infra.filecontrol as filecontrol
+from vdsm.config import config
from vdsm.utils import monotonic_time
try:
- from vdsm.m2cutils import SSLHandshakeDispatcher
+ if config.get('vars', 'ssl_impl') == 'm2c':
+ from vdsm.m2cutils import SSLHandshakeDispatcher
+ else:
+ from vdsm.sslutils import SSLHandshakeDispatcher
except ImportError:
from vdsm.sslutils import SSLHandshakeDispatcher
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index 797002c..2de8fd5 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -40,7 +40,10 @@
from . import vmstatus
try:
- from vdsm import m2cutils as sslutils
+ if config.get('vars', 'ssl_impl') == 'm2c':
+ from vdsm import m2cutils as sslutils
+ else:
+ from vdsm import sslutils
except ImportError:
from vdsm import sslutils
--
To view, visit https://gerrit.ovirt.org/44689
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9881d11e30ced9c34bfe602bba3d968f57e0fe15
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
8 years, 8 months
Change in vdsm[master]: tests: increase timeout to 30 seconds
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: tests: increase timeout to 30 seconds
......................................................................
tests: increase timeout to 30 seconds
Increase maximum timeout to 30 seconds instead of only 1.
On automation testing gc is a bit slower,
so we want to be safe and avoid unit tests failing.
Change-Id: I62cca38db73a0344d927e58cf79ca14e323278bf
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M tests/outOfProcessTests.py
1 file changed, 14 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/36267/1
diff --git a/tests/outOfProcessTests.py b/tests/outOfProcessTests.py
index 8cb89a7..18c97e9 100644
--- a/tests/outOfProcessTests.py
+++ b/tests/outOfProcessTests.py
@@ -63,6 +63,7 @@
def testAmountOfInstancesPerPoolName(self):
idle = oop.IOPROC_IDLE_TIME
+ maxSleep = 30
try:
oop.IOPROC_IDLE_TIME = 5
poolA = "A"
@@ -74,16 +75,19 @@
oop.getProcessPool(poolB)
self.assertEquals(wrapper(), None)
gc.collect()
- time.sleep(1)
- gc.collect()
- try:
- self.assertEquals(ioproc(), None)
- except AssertionError:
- logging.info("GARBAGE: %s", gc.garbage)
- refs = gc.get_referrers(ioproc())
- logging.info(refs)
- logging.info(gc.get_referrers(*refs))
- raise
+ for i in xrange(1, maxSleep+1):
+ time.sleep(1)
+ gc.collect()
+ try:
+ self.assertEquals(ioproc(), None)
+ break
+ except AssertionError:
+ if (i == maxSleep):
+ logging.info("GARBAGE: %s", gc.garbage)
+ refs = gc.get_referrers(ioproc())
+ logging.info(refs)
+ logging.info(gc.get_referrers(*refs))
+ raise
finally:
oop.IOPROC_IDLE_TIME = idle
--
To view, visit http://gerrit.ovirt.org/36267
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I62cca38db73a0344d927e58cf79ca14e323278bf
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: net: add simple network namespace functions to ipwrapper
by ibarkan@redhat.com
Ido Barkan has uploaded a new change for review.
Change subject: net: add simple network namespace functions to ipwrapper
......................................................................
net: add simple network namespace functions to ipwrapper
Adding simple wrappers for adding, deleting, and executing ip commands
in other namespaces.
Change-Id: I6b83c9635fba4feb4946ceba460f3ab8c09ad656
Signed-off-by: Ido Barkan <ibarkan(a)redhat.com>
---
M lib/vdsm/ipwrapper.py
M tests/nettestlib.py
2 files changed, 26 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/46447/1
diff --git a/lib/vdsm/ipwrapper.py b/lib/vdsm/ipwrapper.py
index 3ded776..e8aa6cd 100644
--- a/lib/vdsm/ipwrapper.py
+++ b/lib/vdsm/ipwrapper.py
@@ -585,3 +585,20 @@
def linkDel(dev):
command = [_IP_BINARY.cmd, 'link', 'del', 'dev', dev]
_execCmd(command)
+
+
+def netns_add(name):
+ _execCmd([_IP_BINARY.cmd, 'netns', 'add', name])
+
+
+def netns_delete(name):
+ _execCmd([_IP_BINARY.cmd, 'netns', 'delete', name])
+
+
+def netns_exec(netns_name, command):
+ netns_command = [_IP_BINARY.cmd, 'netns', 'exec', netns_name]
+ _execCmd(netns_command + command)
+
+
+def netns_assign(device, netns_name):
+ _execCmd([_IP_BINARY.cmd, 'link', 'set', device, 'netns', netns_name])
diff --git a/tests/nettestlib.py b/tests/nettestlib.py
index 2ffb11a..c923f44 100644
--- a/tests/nettestlib.py
+++ b/tests/nettestlib.py
@@ -132,6 +132,15 @@
pass
+@contextmanager
+def network_namespace(name):
+ netns_add(name)
+ try:
+ yield name
+ finally:
+ netns_delete(name)
+
+
def _listenOnDevice(fd, icmp):
while True:
packet = os.read(fd, 2048)
--
To view, visit https://gerrit.ovirt.org/46447
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b83c9635fba4feb4946ceba460f3ab8c09ad656
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: Added standard build skeleton
by dcaroest@redhat.com
David Caro has uploaded a new change for review.
Change subject: Added standard build skeleton
......................................................................
Added standard build skeleton
This will replace all/any other vdsm jobs being run now.
Change-Id: I24b446d3ae38c944b5a28d56ed0965d0f2edc206
Signed-off-by: David Caro <dcaroest(a)redhat.com>
---
A automation/build-artifacts.sh
A automation/check-merged.sh
A automation/check-patch.sh
3 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/28/41928/1
diff --git a/automation/build-artifacts.sh b/automation/build-artifacts.sh
new file mode 100644
index 0000000..231f390
--- /dev/null
+++ b/automation/build-artifacts.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+echo "TODO"
diff --git a/automation/check-merged.sh b/automation/check-merged.sh
new file mode 100644
index 0000000..231f390
--- /dev/null
+++ b/automation/check-merged.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+echo "TODO"
diff --git a/automation/check-patch.sh b/automation/check-patch.sh
new file mode 100644
index 0000000..231f390
--- /dev/null
+++ b/automation/check-patch.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+echo "TODO"
--
To view, visit https://gerrit.ovirt.org/41928
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I24b446d3ae38c944b5a28d56ed0965d0f2edc206
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: David Caro <dcaroest(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: multiapth: Require newer multiapth version
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: multiapth: Require newer multiapth version
......................................................................
multiapth: Require newer multiapth version
Multipath did not identify iscsi devices correctly, so their session
recovery_tmo was not configured correctly. This caused slow failover
when path is having trouble, and may lead to blocking of multiple vdsm
threads for many minutes.
This issue was fixed in device-mapper-multipath-0.4.9-82.el7. We require
now this version.
Change-Id: Id7baf2762166e93e6f458e8b380035bc9e2fd1bd
Bug-Url: https://bugzilla.redhat.com/1255173
Relates-To: https://bugzilla.redhat.com/880738
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/45115/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 72e7df6..bc83d72 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -176,7 +176,7 @@
Requires: sanlock >= 2.8, sanlock-python
%if 0%{?rhel}
-Requires: device-mapper-multipath >= 0.4.9-68
+Requires: device-mapper-multipath >= 0.4.9-82
Requires: e2fsprogs
Requires: fence-agents-all
Requires: kernel >= 3.10.0-132.el7
--
To view, visit https://gerrit.ovirt.org/45115
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7baf2762166e93e6f458e8b380035bc9e2fd1bd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: ImageUpload-api
by aaviram@redhat.com
Amit Aviram has uploaded a new change for review.
Change subject: ImageUpload-api
......................................................................
ImageUpload-api
Change-Id: Iddf676fb15c88e126811a25e5e97609c6d937422
Bug-Url: https://bugzilla.redhat.com/??????
Signed-off-by: Amit Aviram <aaviram(a)redhat.com>
---
M client/vdsClient.py
M vdsm.spec.in
M vdsm/API.py
M vdsm/rpc/BindingXMLRPC.py
M vdsm/rpc/vdsmapi-schema.json
5 files changed, 60 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/41870/1
diff --git a/client/vdsClient.py b/client/vdsClient.py
index 375fa1a..fe03aa7 100755
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -1585,6 +1585,19 @@
return stats['status']['code'], stats['status']['message']
return 0, ''
+ def do_startImageTransferSession(self, args):
+ ticket = args[0]
+ op = args[1]
+ spId = args[2]
+ sdId = args[3]
+ imgId = args[4]
+ volId = args[5]
+ stats = self.s.startImageTransferSession(ticket, op, spId, sdId,
+ imgId, volId)
+ if stats['status']['code']:
+ return stats['status']['code'], stats['status']['message']
+ return 0, ''
+
def do_getVmsInfo(self, args):
spUUID = args[0]
if len(args) >= 2:
@@ -2535,6 +2548,11 @@
' <enabled = true/false>',
'Enable or disable Hosted Engine HA'
' maintenance')),
+ 'startImageTransferSession': (serv.do_startImageTransferSession,
+ ('<ticketUUID> <op>',
+ '<spUUID> <sdUUID> ',
+ '<imgUUID> <volUUID> ',
+ 'Start an image transfer session.')),
'deleteImage': (serv.deleteImage,
('<sdUUID> <spUUID> <imgUUID> [<postZero>] [<force>]',
'Delete Image folder with all volumes.',
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 456a2d9..82fbe9b 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -293,7 +293,7 @@
# GlusterFS client-side RPMs needed for Gluster SD
%if 0%{?with_gluster}
-Requires: glusterfs >= 3.6.999
+Requires: glusterfs >= 3.5
Requires: glusterfs-cli
Requires: glusterfs-api
Requires: glusterfs-fuse
diff --git a/vdsm/API.py b/vdsm/API.py
index 3cdc465..bb41d39 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1662,6 +1662,14 @@
return errCode['haErr']
return {'status': doneCode}
+ def startImageTransferSession(self, ticket, op, spId, sdId,
+ imgId, volId):
+ self.log.info("ImageUploadSessionStart!!: \nticket:%s\nop:%s\n"
+ "spId:%s\nsdId:%s\nimgId:%s\nvolId:%s", ticket,
+ op, spId, sdId, imgId, volId)
+
+ return {'status': doneCode}
+
# take a rough estimate on how much free mem is available for new vm
# memTotal = memFree + memCached + mem_used_by_non_qemu + resident .
# simply returning (memFree + memCached) is not good enough, as the
diff --git a/vdsm/rpc/BindingXMLRPC.py b/vdsm/rpc/BindingXMLRPC.py
index 9a1da99..3e92879 100644
--- a/vdsm/rpc/BindingXMLRPC.py
+++ b/vdsm/rpc/BindingXMLRPC.py
@@ -603,6 +603,12 @@
api = API.Global()
return api.setHaMaintenanceMode(mode, enabled)
+ def startImageTransferSession(self, ticket, op, spId, sdId,
+ imgId, volId):
+ api = API.Global()
+ return api.startImageTransferSession(ticket, op, spId,
+ sdId, imgId, volId)
+
def domainActivate(self, sdUUID, spUUID, options=None):
domain = API.StorageDomain(sdUUID)
return domain.activate(spUUID)
@@ -1025,6 +1031,7 @@
(self.setMOMPolicy, 'setMOMPolicy'),
(self.setMOMPolicyParameters, 'setMOMPolicyParameters'),
(self.setHaMaintenanceMode, 'setHaMaintenanceMode'),
+ (self.startImageTransferSession, 'startImageTransferSession'),
(self.vmHotplugDisk, 'hotplugDisk'),
(self.vmHotunplugDisk, 'hotunplugDisk'),
(self.vmHotplugNic, 'hotplugNic'),
diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json
index 0c73078..959c24d 100644
--- a/vdsm/rpc/vdsmapi-schema.json
+++ b/vdsm/rpc/vdsmapi-schema.json
@@ -574,6 +574,8 @@
{'enum': 'HaMaintenanceMode',
'data': ['GLOBAL', 'LOCAL']}
+
+
##
# @Host.setHaMaintenanceMode:
#
@@ -589,6 +591,30 @@
'data': {'mode': 'HaMaintenanceMode', 'enabled': 'bool'}}
##
+# @Host.startImageTransferSession:
+#
+# Start an image upload session
+#
+# @ticket: ticket
+#
+# @op: op
+#
+# @spId: op
+#
+# @sdId: op
+#
+# @imgId: op
+#
+# @volId: op
+#
+# Since: 4.14.0
+##
+{'command': {'class': 'Host', 'name': 'startImageTransferSession'},
+ 'data': {'ticket': 'UUID', 'op': 'str', 'spId': 'UUID',
+ 'sdId': 'UUID', 'imgId': 'UUID', 'volId': 'UUID'}}
+
+
+##
# @TaskDetails:
#
# A collection of information about a task.
--
To view, visit https://gerrit.ovirt.org/41870
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iddf676fb15c88e126811a25e5e97609c6d937422
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aaviram(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: dispatcher: improve failure logging
by Piotr Kliczewski
Piotr Kliczewski has uploaded a new change for review.
Change subject: dispatcher: improve failure logging
......................................................................
dispatcher: improve failure logging
We want to understand if there are any issues during I/O processing.
Change-Id: I93d993909a5b42650265d6cf0d0e811d4e98f2b5
Signed-off-by: pkliczewski <piotr.kliczewski(a)gmail.com>
---
M lib/yajsonrpc/betterAsyncore.py
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/46624/1
diff --git a/lib/yajsonrpc/betterAsyncore.py b/lib/yajsonrpc/betterAsyncore.py
index 50e8c75..ef5738b 100644
--- a/lib/yajsonrpc/betterAsyncore.py
+++ b/lib/yajsonrpc/betterAsyncore.py
@@ -22,6 +22,7 @@
from errno import EWOULDBLOCK
from vdsm.infra.eventfd import EventFD
+from vdsm.utils import traceback
class Dispatcher(asyncore.dispatcher):
@@ -37,15 +38,18 @@
def handle_connect(self):
self._delegate_call("handle_connect")
+ @traceback()
def handle_close(self):
self._delegate_call("handle_close")
+ @traceback()
def handle_accept(self):
self._delegate_call("handle_accept")
def handle_expt(self):
self._delegate_call("handle_expt")
+ @traceback()
def handle_error(self):
self._delegate_call("handle_error")
@@ -55,9 +59,11 @@
def writable(self):
return self._delegate_call("writable")
+ @traceback()
def handle_read(self):
self._delegate_call("handle_read")
+ @traceback()
def handle_write(self):
self._delegate_call("handle_write")
--
To view, visit https://gerrit.ovirt.org/46624
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I93d993909a5b42650265d6cf0d0e811d4e98f2b5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
8 years, 8 months
Change in vdsm[master]: configfile: remove unneeded methods.
by mtayer@redhat.com
mooli tayer has uploaded a new change for review.
Change subject: configfile: remove unneeded methods.
......................................................................
configfile: remove unneeded methods.
Change-Id: Icf08bfebc83a9af5eb3c7de48f9a51d2263766fd
Signed-off-by: Mooli Tayer <mtayer(a)redhat.com>
---
M lib/vdsm/tool/configurators/configfile.py
M tests/toolTests.py
2 files changed, 2 insertions(+), 106 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/36324/1
diff --git a/lib/vdsm/tool/configurators/configfile.py b/lib/vdsm/tool/configurators/configfile.py
index d8b7fdd..d1e0472 100644
--- a/lib/vdsm/tool/configurators/configfile.py
+++ b/lib/vdsm/tool/configurators/configfile.py
@@ -83,7 +83,6 @@
version,
sectionStart='## beginning of configuration section by vdsm',
sectionEnd='## end of configuration section by vdsm',
- prefix='# VDSM backup',
lineComment='by vdsm'):
if not os.path.exists(filename):
raise OSError(
@@ -94,7 +93,6 @@
self._context = False
self._sectionStart = sectionStart
self._sectionEnd = sectionEnd
- self._prefix = prefix
# remove 'lineComment' at 4.0. see 'Backward compatibility'
self._lineComment = lineComment
self._version = version
@@ -104,9 +102,6 @@
raise RuntimeError("can only enter once")
self._entries = {}
self._context = True
- self._prefixRemove = None
- self._prefixAdd = None
- self._section = None
self._oldmod = os.stat(self._filename).st_mode
self._remove = None
self._rmstate = BEFORE
@@ -131,11 +126,6 @@
continue
if not self._remove or self._rmstate != WITHIN:
- if self._prefixRemove:
- if line.startswith(self._prefix):
- line = line[len(self._prefix):]
- if self._prefixAdd:
- line = self._prefix + line
m = confpat.match(line.rstrip())
if m:
oldentries.add(m.group('key'))
@@ -149,11 +139,6 @@
def _end(self):
return "%s-%s\n" % (self._sectionEnd, self._version)
-
- def _writeSection(self, f):
- f.write(self._start())
- f.write(self._section)
- f.write(self._end())
def _writeEntries(self, f, oldentries):
f.write(self._start())
@@ -170,8 +155,6 @@
try:
oldlines, oldentries = self._getOldContent()
with os.fdopen(fd, 'w', ) as f:
- if self._section:
- self._writeSection(f)
f.writelines(oldlines)
if self._entries:
self._writeEntries(f, oldentries)
@@ -199,32 +182,6 @@
all pairs are added in a comment wrapped section.
"""
self._entries[key] = val
-
- @context
- def prependSection(self, section):
- """
- add 'section' in the beginning of the file.
- section is added in a comment wrapped section.
-
- Only one section is currently supported.
- """
- self._section = section
-
- @context
- def prefixLines(self):
- """
- Add self.prefix to the beginning of each line.
- No editing is done on new content added by this config file.
- """
- self._prefixAdd = True
-
- @context
- def unprefixLines(self):
- """
- Remove self.prefix from each line starting with it.
- No editing is done on new content added by this config file.
- """
- self._prefixRemove = True
@context
def removeConf(self):
diff --git a/tests/toolTests.py b/tests/toolTests.py
index 82a2668..89a93bf 100644
--- a/tests/toolTests.py
+++ b/tests/toolTests.py
@@ -452,66 +452,6 @@
"key4=val\n"
"# end conf-3.4.4\n")
- def testPrefixAndPrepend(self):
- self._writeConf("/var/log/libvirt/libvirtd.log {\n"
- " weekly\n"
- "}\n")
- with ConfigFile(self.tname,
- version='3.4.4',
- sectionStart="# start conf",
- sectionEnd="# end conf",
- prefix="# comment ") as conf:
- conf.prefixLines()
- conf.prependSection("Some text to\n"
- "add at the top\n")
- with open(self.tname, 'r') as f:
- self.assertEqual(f.read(),
- "# start conf-3.4.4\n"
- "Some text to\n"
- "add at the top\n"
- "# end conf-3.4.4\n"
- "# comment /var/log/libvirt/libvirtd.log {\n"
- "# comment weekly\n"
- "# comment }\n")
-
- def testPrefixIdempotencey(self):
- original = (
- "/var/log/libvirt/libvirtd.log {\n"
- " weekly\n"
- "}\n"
- )
- self._writeConf(original)
- with ConfigFile(self.tname,
- version='3.4.4',
- sectionStart="# start conf",
- sectionEnd="# end conf",
- prefix="# comment ") as conf:
- conf.prefixLines()
- with open(self.tname, 'r') as f:
- self.assertEqual(f.read(),
- "# comment /var/log/libvirt/libvirtd.log {\n"
- "# comment weekly\n"
- "# comment }\n")
- with ConfigFile(self.tname,
- version='3.4.4',
- sectionStart="# start conf",
- sectionEnd="# end conf",
- prefix="# comment ") as conff:
- conff.unprefixLines()
- with open(self.tname, 'r') as f:
- self.assertEqual(f.read(), original)
-
- def testRemoveEntireLinePrefix(self):
- self._writeConf("# comment\n")
- with ConfigFile(self.tname,
- version='3.4.4',
- sectionStart="# start conf",
- sectionEnd="# end conf",
- prefix="# comment") as conf:
- conf.unprefixLines()
- with open(self.tname, 'r') as f:
- self.assertEqual(f.read(), "\n")
-
def testRemoveConfSection(self):
self._writeConf("key=val\n"
"remove me!(see 'Backward compatibility')# by vdsm\n"
@@ -523,8 +463,7 @@
with ConfigFile(self.tname,
version='3.4.4',
sectionStart="# start conf",
- sectionEnd="# end conf",
- prefix="# comment") as conf:
+ sectionEnd="# end conf") as conf:
conf.removeConf()
with open(self.tname, 'r') as f:
self.assertEqual(f.read(), "key=val\n"
@@ -536,7 +475,7 @@
version='3.4.4',
sectionStart="# start conf",
sectionEnd="# end conf")
- self.assertRaises(RuntimeError, conff.prefixLines)
+ self.assertRaises(RuntimeError, conff.addEntry, 'key', 'val')
self.assertRaises(RuntimeError, conff.removeConf)
def testHasConf(self):
--
To view, visit http://gerrit.ovirt.org/36324
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf08bfebc83a9af5eb3c7de48f9a51d2263766fd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer(a)redhat.com>
8 years, 8 months