Yaniv Bronhaim has uploaded a new change for review.
Change subject: Explicit call for libvirtd service manipulations during configure
......................................................................
Explicit call for libvirtd service manipulations during configure
We used service.py package to run operations on running services. service.py
tries all alternatives until reaching included one (systemd, initctl..).
Over RHEL we prefer to use initctl to manage libvirtd (as it helps us to avoid
respawn script). For that we need explicitly to use initctl manipulation for
libvirtd.
Change-Id: I08bbf2bb2aac950bf15210018adfb296a8f3fda3
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1047514
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M lib/vdsm/tool/configurator.py
1 file changed, 32 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/22843/1
diff --git a/lib/vdsm/tool/configurator.py b/lib/vdsm/tool/configurator.py
index 869d774..1cabe28 100644
--- a/lib/vdsm/tool/configurator.py
+++ b/lib/vdsm/tool/configurator.py
@@ -178,6 +178,35 @@
)
+# The above helper functions should provide service manipulation using service
+# package. Some services can be used only by specific mechanisem as libvirtd
+# which is managed by upstart. using systemctl in this case will give invalid
+# results.
+def _getServiceStatus(s):
+ if s is "libvirtd":
+ ret = service._initctlStatus(s)
+ else:
+ ret = service.service_status(s)
+ return ret
+
+
+def _stopService(s):
+ if s is "libvirtd":
+ ret = service._initctlStop(s)
+ else:
+ ret = service.service_stop(s)
+ return ret
+
+
+def _startService(s):
+ if s is "libvirtd":
+ ret = service._initctlStart(s)
+ else:
+ ret = service.service_start(s)
+
+ return ret
+
+
@expose("configure")
def configure(*args):
"""
@@ -197,7 +226,7 @@
services = []
for c in configurer_to_trigger:
for s in c.getServices():
- if service.service_status(s) == 0:
+ if _getServiceStatus(s) == 0:
if not args.force:
raise RuntimeError(
"Cannot configure while %s is running" % s
@@ -205,13 +234,13 @@
services.append(s)
for s in services:
- service.service_stop(s)
+ _stopService(s)
for c in configurer_to_trigger:
c.configure()
for s in reversed(services):
- service.service_start(s)
+ _startService(s)
@expose("is-configured")
--
To view, visit http://gerrit.ovirt.org/22843
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I08bbf2bb2aac950bf15210018adfb296a8f3fda3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Assaf Muller has uploaded a new change for review.
Change subject: [4/x] Added netinfo:getDeviceByIP and a test
......................................................................
[4/x] Added netinfo:getDeviceByIP and a test
Change-Id: I3563ae9b3e199e29ea2227463b9e4a3752cb99a0
Signed-off-by: Assaf Muller <amuller(a)redhat.com>
---
M lib/vdsm/netinfo.py
M tests/netinfoTests.py
2 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/22841/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index d000fe4..d8af7bc 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -615,6 +615,23 @@
return ''
+def getDeviceByIP(ip):
+ """
+ Get network device by IP address
+ :param ip: String representing IPv4 or IPv6, but not link-local IPv6
+ """
+ for info in ethtool.get_interfaces_info(ethtool.get_active_devices()):
+ for ipv4addr in info.get_ipv4_addresses():
+ if ip in (ipv4addr.address, IPv4toMapped(ipv4addr.address)):
+ return info.device
+
+ for ipv6addr in info.get_ipv6_addresses():
+ if ip == ipv6addr.address:
+ return info.device
+
+ return ''
+
+
class NetInfo(object):
def __init__(self, _netinfo=None):
if _netinfo is None:
diff --git a/tests/netinfoTests.py b/tests/netinfoTests.py
index da233e0..5207c0d 100644
--- a/tests/netinfoTests.py
+++ b/tests/netinfoTests.py
@@ -24,6 +24,8 @@
import tempfile
from xml.dom import minidom
+import ethtool
+
from vdsm import ipwrapper
from vdsm import netconfpersistence
from vdsm import netinfo
@@ -111,6 +113,15 @@
def testIPv4toMapped(self):
self.assertEqual('::ffff:127.0.0.1', netinfo.IPv4toMapped('127.0.0.1'))
+ def testGetDeviceByIP(self):
+ for dev in ethtool.get_interfaces_info(ethtool.get_active_devices()):
+ ipaddrs = [ipv6.address for ipv6 in dev.get_ipv6_addresses()
+ if ipv6.scope != 'link']
+ if dev.ipv4_address is not None:
+ ipaddrs.append(dev.ipv4_address)
+ for ip in ipaddrs:
+ self.assertTrue(dev.device == netinfo.getDeviceByIP(ip))
+
def _testNics(self):
"""Creates a test fixture so that nics() reports:
physical nics: em, me, me0, me1, hid0 and hideous
--
To view, visit http://gerrit.ovirt.org/22841
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3563ae9b3e199e29ea2227463b9e4a3752cb99a0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller(a)redhat.com>
Nir Soffer has uploaded a new change for review.
Change subject: Bug-Url: clientIF: Check device visibility on failed hotplugDisk
......................................................................
Bug-Url: clientIF: Check device visibility on failed hotplugDisk
According to the analysis in the bug, invoking vmHotplugDisk right after
connectStorageServer may not leave enough time for multipath to create
the device, leading to incorrect failure.
The original fix failed to invoke multipath.rescan(), and the bug was
verified by QE and used by customers for the last 6 month. We believe
that the problem is a tiny race that is unlikely to happen, but it is
possible and should be fixed.
This patch implements the original fix in a different way, calling
getDevicesVisibility(), which invokes multipath.rescan() if a device is
missing.
This is the second patch in series of patches fixing the regressions
introduced by commit 15c7f74365cb5d2c9258bc333c441941c6e42bdb.
Change-Id: I3d75ac53ca809b7a25d7fb237ec661dd865e31fc
Bug-Url: https://bugzilla.redhat.com/923773
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/clientIF.py
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/21181/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 137ba4e..367416d 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -282,15 +282,16 @@
# GUID drive format
elif "GUID" in drive:
- volPath = os.path.join("/dev/mapper", drive["GUID"])
-
- if not os.path.exists(volPath):
+ res = self.irs.getDevicesVisibility([drive["GUID"]])
+ if not res["visible"][drive["GUID"]]:
raise vm.VolumeError(drive)
res = self.irs.appropriateDevice(drive["GUID"], vmId)
if res['status']['code']:
raise vm.VolumeError(drive)
+ volPath = os.path.join("/dev/mapper", drive["GUID"])
+
# UUID drive format
elif "UUID" in drive:
volPath = self._getUUIDSpecPath(drive["UUID"])
--
To view, visit http://gerrit.ovirt.org/21181
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d75ac53ca809b7a25d7fb237ec661dd865e31fc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>