Change in vdsm[master]: hotunplug: Identify a nic according to its alias
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: hotunplug: Identify a nic according to its alias
......................................................................
hotunplug: Identify a nic according to its alias
MAC addresses may change. The "alias" is immutable.
Change-Id: Iae7619c2547d667103e33777180e01b285f4b18d
Bug-Url: https://bugzilla.redhat.com/919356
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/libvirtvm.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/12892/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 39d1b5b..99bf548 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -1669,7 +1669,8 @@
# Find NIC object in vm's NICs list
nic = None
for dev in self._devices[vm.NIC_DEVICES][:]:
- if dev.macAddr.lower() == nicParams['macAddr'].lower():
+ if dev.alias == nicParams.get('alias') or \
+ dev.macAddr.lower() == nicParams['macAddr'].lower():
nic = dev
break
--
To view, visit http://gerrit.ovirt.org/12892
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae7619c2547d667103e33777180e01b285f4b18d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: Change mom policy related interface to support multi-policy
by lvroyce@linux.vnet.ibm.com
Royce Lv has uploaded a new change for review.
Change subject: Change mom policy related interface to support multi-policy
......................................................................
Change mom policy related interface to support multi-policy
Change-Id: I09c40fee74b10d3eb41f4ec3ca18096a9b20dfcd
Signed-off-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
---
M .gitignore
M tests/functional/Makefile.am
R tests/functional/momTests.py.in
M vdsm/API.py
M vdsm/BindingXMLRPC.py
M vdsm/momIF.py
M vdsm_cli/vdsClient.py
7 files changed, 56 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/12466/1
diff --git a/.gitignore b/.gitignore
index 41066dd..b9b992c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,7 @@
config.status
configure
results.log
+tests/functional/momTests.py
tests/run_tests.sh
tests/run_tests_local.sh
vdsm-*.tar.gz
diff --git a/tests/functional/Makefile.am b/tests/functional/Makefile.am
index 030242b..fe4f276 100644
--- a/tests/functional/Makefile.am
+++ b/tests/functional/Makefile.am
@@ -17,12 +17,21 @@
#
# Refer to the README and COPYING files for full details of the license
#
+include $(top_srcdir)/build-aux/Makefile.subs
vdsmfunctestsdir = ${vdsmtestsdir}/functional
dist_vdsmfunctests_PYTHON = \
- momTests.py \
sosPluginTests.py \
xmlrpcTests.py \
$(NULL)
+nodist_vdsmfunctests_PYTHON = \
+ momTests.py
+
+EXTRA_DIST = \
+ momTests.py.in
+
+CLEANFILES = \
+ $(nodist_vdsmfunctests_PYTHON)
+
diff --git a/tests/functional/momTests.py b/tests/functional/momTests.py.in
similarity index 76%
rename from tests/functional/momTests.py
rename to tests/functional/momTests.py.in
index 1981e05..c54b427 100644
--- a/tests/functional/momTests.py
+++ b/tests/functional/momTests.py.in
@@ -18,6 +18,7 @@
# Refer to the README and COPYING files for full details of the license
#
import imp
+import os
import random
import time
@@ -54,3 +55,17 @@
hostStats = s.getVdsStats()['info']
self.assertEqual(bool(run), hostStats['ksmState'])
self.assertEqual(pages_to_scan, hostStats['ksmPages'])
+
+ @testValidation.ValidateRunningAsRoot
+ def testDefaultPolicy(self):
+ s = vdscli.connect()
+ r = s.getMOMPolicy()
+
+ policy_dir = '@CONFDIR@/mom-policy-dir'
+ names = sorted(os.listdir(policy_dir))
+ for name in names:
+ if name.startswith('.') or not name.endswith('.policy'):
+ fname = os.path.join(policy_dir, name)
+ with open(fname, 'r') as f:
+ policyStr = f.read()
+ self.assertEqual(policyStr, r['policyDict'].get(name))
diff --git a/vdsm/API.py b/vdsm/API.py
index 0046b57..0f02fde 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1379,6 +1379,12 @@
except:
return errCode['momErr']
+ def getMOMPolicy(self):
+ try:
+ return dict(status=doneCode,
+ policyDict=self._cif.mom.getPolicy())
+ except:
+ return errCode['momErr']
# 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/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py
index 9a4db12..a540900 100644
--- a/vdsm/BindingXMLRPC.py
+++ b/vdsm/BindingXMLRPC.py
@@ -401,6 +401,10 @@
api = API.Global()
return api.setMOMPolicy(policy)
+ def getMOMPolicy(self):
+ api = API.Global()
+ return api.getMOMPolicy()
+
def domainActivate(self, sdUUID, spUUID, options=None):
domain = API.StorageDomain(sdUUID)
return domain.activate(spUUID)
@@ -807,6 +811,7 @@
(self.fenceNode, 'fenceNode'),
(self.prepareForShutdown, 'prepareForShutdown'),
(self.setLogLevel, 'setLogLevel'),
+ (self.getMOMPolicy, 'getMOMPolicy'),
(self.setMOMPolicy, 'setMOMPolicy'),
(self.vmHotplugDisk, 'hotplugDisk'),
(self.vmHotunplugDisk, 'hotunplugDisk'),
diff --git a/vdsm/momIF.py b/vdsm/momIF.py
index d0f63d1..831b649 100644
--- a/vdsm/momIF.py
+++ b/vdsm/momIF.py
@@ -56,9 +56,16 @@
ret['ksmCpu'] = stats['ksmd_cpu_usage']
return ret
- def setPolicy(self, policyStr):
- # mom.setPolicy will raise an exception on failure.
- self._mom.setPolicy(policyStr)
+ def setPolicy(self, policyParam):
+ if isinstance(policyParam, dict) and len(policyParam) == 1:
+ policy = policyParam.popItem()
+ self._mom.setNamedPolicy(policy[0], policy[1])
+ else:
+ # mom.setPolicy will raise an exception on failure.
+ self._mom.setPolicy(policyParam)
+
+ def getPolicy(self):
+ return self._mom.getNamedPolicies()
def stop(self):
if self._mom is not None:
diff --git a/vdsm_cli/vdsClient.py b/vdsm_cli/vdsClient.py
index 1da7d5f..1fa0d22 100644
--- a/vdsm_cli/vdsClient.py
+++ b/vdsm_cli/vdsClient.py
@@ -1404,6 +1404,12 @@
return stats['status']['code'], stats['status']['message']
return 0, ''
+ def do_getMOMPolicy(self, policyFile):
+ stats = self.s.getMOMPolicy()
+ if stats['status']['code']:
+ return stats['status']['code'], stats['status']['message']
+ return 0, ''
+
def do_setMOMPolicy(self, policyFile):
stats = self.s.setMOMPolicy(policyFile)
if stats['status']['code']:
@@ -2253,6 +2259,9 @@
('<level> [logName][,logName]...', 'set log verbosity'
' level (10=DEBUG, 50=CRITICAL'
)),
+ 'getMOMPolicy': (serv.do_getMOMPolicy,
+ ('', 'get MOM policy')),
+
'setMOMPolicy': (serv.do_setMOMPolicy,
('<policyfile>', 'set MOM policy')),
'deleteImage': (serv.deleteImage,
--
To view, visit http://gerrit.ovirt.org/12466
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I09c40fee74b10d3eb41f4ec3ca18096a9b20dfcd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
9 years, 4 months
Change in vdsm[master]: netconf: enable multiple gateways for iproute2 configurator
by wudxw@linux.vnet.ibm.com
Mark Wu has uploaded a new change for review.
Change subject: netconf: enable multiple gateways for iproute2 configurator
......................................................................
netconf: enable multiple gateways for iproute2 configurator
Change-Id: I76e1225caffdb2de3073041e541c7c978eefb396
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M vdsm/netconf/iproute2.py
1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/76/16276/1
diff --git a/vdsm/netconf/iproute2.py b/vdsm/netconf/iproute2.py
index d474e09..795dd9b 100644
--- a/vdsm/netconf/iproute2.py
+++ b/vdsm/netconf/iproute2.py
@@ -45,6 +45,8 @@
utils.execCmd(['brctl', 'addif', bridge.name, bridge.port.name])
self.configApplier.setIpConfig(bridge)
self.configApplier.setIfaceMtu(bridge.name, bridge.mtu)
+ ipaddr, netmask, gateway, bootproto, _ = bridge.getIpConfig()
+ self._addSourceRoute(bridge, ipaddr, netmask, gateway, bootproto)
self.configApplier.ifup(bridge)
def configureVlan(self, vlan, bridge=None, **opts):
@@ -53,6 +55,8 @@
if vlan.ip:
self.configApplier.setIpConfig(vlan)
self.configApplier.setIfaceMtu(vlan.name, vlan.mtu)
+ ipaddr, netmask, gateway, bootproto, _ = vlan.getIpConfig()
+ self._addSourceRoute(vlan, ipaddr, netmask, gateway, bootproto)
self.configApplier.ifup(vlan)
def configureBond(self, bond, bridge=None, **opts):
@@ -76,6 +80,8 @@
if bond.ip:
self.configApplier.setIpConfig(bond)
self.configApplier.setIfaceMtu(bond.name, bond.mtu)
+ ipaddr, netmask, gateway, bootproto, _ = bond.getIpConfig()
+ self._addSourceRoute(bond, ipaddr, netmask, gateway, bootproto)
self.configApplier.ifup(bond)
def editBonding(self, bond, _netinfo):
@@ -91,22 +97,27 @@
if nic.ip:
self.configApplier.setIpConfig(nic)
self.configApplier.setIfaceMtu(nic.name, nic.mtu)
+ ipaddr, netmask, gateway, bootproto, _ = nic.getIpConfig()
+ self._addSourceRoute(nic, ipaddr, netmask, gateway, bootproto)
self.configApplier.ifup(nic)
def removeBridge(self, bridge):
self.configApplier.ifdown(bridge)
+ self._removeSourceRoute(bridge)
utils.execCmd([constants.EXT_BRCTL, 'delbr', bridge.name])
if bridge.port:
bridge.port.remove()
def removeVlan(self, vlan):
self.configApplier.ifdown(vlan)
+ self._removeSourceRoute(vlan)
ipwrapper.linkDel(['dev', vlan.name])
vlan.device.remove()
def _ifaceDownAndCleanup(self, iface, _netinfo):
"""Returns True iff the iface is to be removed."""
self.configApplier.ifdown(iface)
+ self._removeSourceRoute(iface)
if iface.master is None:
self.configApplier.removeIpConfig(iface)
return not _netinfo.ifaceUsers(iface.name)
--
To view, visit http://gerrit.ovirt.org/16276
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I76e1225caffdb2de3073041e541c7c978eefb396
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
9 years, 4 months
Change in vdsm[master]: remove symlink when connect local storage failed
by lvroyce@linux.vnet.ibm.com
Royce Lv has uploaded a new change for review.
Change subject: remove symlink when connect local storage failed
......................................................................
remove symlink when connect local storage failed
if connectStorageServer failed for some reason,
symlink remains in /rhev/data-center/mnt,
which makes second failure call connectStorageServer
falsely success, so remove the symlink
Change-Id: I0e44605fb6c6e2512a6aa1acefb3d1d7e09a67aa
Signed-off-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
---
M vdsm/storage/storageServer.py
1 file changed, 7 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/40/6140/1
--
To view, visit http://gerrit.ovirt.org/6140
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e44605fb6c6e2512a6aa1acefb3d1d7e09a67aa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
9 years, 4 months
Change in vdsm[master]: getStorageDomainInfo: SP keys when disconnected.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: getStorageDomainInfo: SP keys when disconnected.
......................................................................
getStorageDomainInfo: SP keys when disconnected.
Before this patch, getStorageDomainInfo() returns the real pool
info part (master_ver, spm_id, lver) only if the host is connected
to the same pool which the domain is attached. This patch reads
directly the pool MD for any MSD.
This changes the previous behaviour.
TODO: pool related information should not be returned as part of
this API response.
Change-Id: I8b7323d4ccaaaec0f39d5590a06879faa7fc999e
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 10 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/55/19555/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 2b91640..6262822 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2736,8 +2736,11 @@
# These keys are not likely to change (also because of
# BC) so it's not that horrible. In any case please
# remove this when we can stop supporting this API.
- info.update({'lver': -1, 'spm_id': -1, 'master_ver': 0})
if info['role'] == sd.MASTER_DOMAIN:
+ pmd = sp.StoragePool._getPoolMD(dom)
+ info['lver'] = pmd[sp.PMDK_LVER]
+ info['master_ver'] = pmd[sp.PMDK_MASTER_VER]
+ info['spm_id'] = -1
try:
# Verify that the host is connected to the same pool which
# the SD is attached to.
@@ -2757,9 +2760,12 @@
"master is %s",
sdUUID, pool.masterDomain.sdUUID)
else:
- poolInfo = pool.getInfo()
- for key in ('lver', 'spm_id', 'master_ver'):
- info[key] = poolInfo[key]
+ # spm_id is relevant only when the host is connected
+ # to the pool and this SD is the actual master
+ info['spm_id'] = pmd[sp.PMDK_SPM_ID]
+
+ else: # sd.REGULAR_DOMAIN
+ info.update({'lver': -1, 'spm_id': -1, 'master_ver': 0})
return dict(info=info)
--
To view, visit http://gerrit.ovirt.org/19555
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b7323d4ccaaaec0f39d5590a06879faa7fc999e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: [wip] drbd: initial implementation
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: [wip] drbd: initial implementation
......................................................................
[wip] drbd: initial implementation
Change-Id: I33bb867ba6c7cfca54d31334554cb37db11aeeea
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M client/vdsClient.py
M configure.ac
M lib/vdsm/constants.py.in
M vdsm.spec.in
M vdsm/storage/Makefile.am
A vdsm/storage/drbd.py
M vdsm/storage/hsm.py
M vdsm/storage/lvm.py
M vdsm/storage/storage_exception.py
M vdsm/sudoers.vdsm.in
10 files changed, 530 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/13585/1
diff --git a/client/vdsClient.py b/client/vdsClient.py
index 1da7d5f..9e9fb2e 100644
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -1676,6 +1676,56 @@
return status['status']['code'], status['status']['message']
+ def createReplicatedDevice(self, args):
+ dev = self.s.createReplicatedDevice(*args)
+ if dev['status']['code']:
+ return dev['status']['code'], dev['status']['message']
+ return 0, dev['uuid']
+
+ def getReplicatedResourcesList(self, args):
+ res = self.s.getReplicatedResourcesList()
+ if res['status']['code']:
+ return res['status']['code'], res['status']['message']
+ for res in res['resList']:
+ print res
+ return 0, ''
+
+ def getReplicatedResourceInfo(self, args):
+ rdUUID = args[0]
+ res = self.s.getReplicatedResourceInfo(rdUUID)
+ if res['status']['code']:
+ return res['status']['code'], res['status']['message']
+ for key, value in res['resInfo'].items():
+ print key, "=", value
+ return 0, ''
+
+ def attachReplicatedResource(self, args):
+ rdUUID = args[0]
+ device = args[1]
+ res = self.s.attachReplicatedResource(rdUUID, device)
+ if res['status']['code']:
+ return res['status']['code'], res['status']['message']
+ return 0, ''
+
+ def connectReplicatedResource(self, args):
+ rdUUID = args[0]
+ target = args[1]
+ res = self.s.connectReplicatedResource(rdUUID, target)
+ if res['status']['code']:
+ return res['status']['code'], res['status']['message']
+ return 0, ''
+
+ def activateReplicatedResource(self, args):
+ rdUUID = args[0]
+ if len(args) == 2:
+ force = args[1]
+ else:
+ force = 'False'
+ res = self.s.activateReplicatedResource(rdUUID, force)
+ if res['status']['code']:
+ return res['status']['code'], res['status']['message']
+ return 0, ''
+
if __name__ == '__main__':
if _glusterEnabled:
serv = ge.GlusterService()
@@ -2392,6 +2442,32 @@
'Finish live replication to the destination '
'domain'
)),
+ 'createReplicatedDevice': (
+ serv.createReplicatedDevice, (
+ '<device>', 'Creates new replicated device'
+ )),
+ 'getReplicatedResourcesList': (
+ serv.getReplicatedResourcesList, (
+ '', 'Get replicated resources list'
+ )),
+ 'getReplicatedResourceInfo': (
+ serv.getReplicatedResourceInfo, (
+ '<rdUUID>', 'Get replicated device info.'
+ )),
+ 'attachReplicatedResource': (
+ serv.attachReplicatedResource, (
+ '<rdUUID> <device>',
+ 'Attach a replicated resource to a block device.'
+ )),
+ 'connectReplicatedResource': (
+ serv.connectReplicatedResource, (
+ '<rdUUID> <target>',
+ 'Connects a replicated resource to a remote peer'
+ )),
+ 'activateReplicatedResource': (
+ serv.activateReplicatedResource, (
+ '<rdUUID> [<force>]', 'Activates a replicated resource'
+ )),
}
if _glusterEnabled:
commands.update(ge.getGlusterCmdDict(serv))
diff --git a/configure.ac b/configure.ac
index 6baa950..9553cc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -147,6 +147,8 @@
AC_PATH_PROG([DD_PATH], [dd], [/bin/dd])
AC_PATH_PROG([DMIDECODE_PATH], [dmidecode], [/usr/sbin/dmidecode])
AC_PATH_PROG([DMSETUP_PATH], [dmsetup], [/sbin/dmsetup])
+AC_PATH_PROG([DRBDMETA_PATH], [drbdmeta], [/sbin/drbdmeta])
+AC_PATH_PROG([DRBDSETUP_PATH], [drbdsetup], [/sbin/drbdsetup])
AC_PATH_PROG([ECHO_PATH], [echo], [/bin/echo])
AC_PATH_PROG([FSCK_PATH], [fsck], [/sbin/fsck])
AC_PATH_PROG([FENCE_AGENT_PATH], [fence_ilo], [/usr/sbin/fence_ilo])
diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index e7e2f83..e36de0b 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -91,6 +91,9 @@
EXT_DMIDECODE = '@DMIDECODE_PATH@'
EXT_DMSETUP = '@DMSETUP_PATH@'
+EXT_DRBDMETA = '@DRBDMETA_PATH@'
+EXT_DRBDSETUP = '@DRBDSETUP_PATH@'
+
EXT_EDITNETWORK = '@VDSMDIR@/editNetwork'
EXT_FENCE_PREFIX = os.path.dirname('@FENCE_AGENT_PATH@') + '/fence_'
diff --git a/vdsm.spec.in b/vdsm.spec.in
index dbb9d04..0711007 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -750,6 +750,7 @@
%{_datadir}/%{vdsm_name}/storage/devicemapper.py*
%{_datadir}/%{vdsm_name}/storage/dispatcher.py*
%{_datadir}/%{vdsm_name}/storage/domainMonitor.py*
+%{_datadir}/%{vdsm_name}/storage/drbd.py*
%{_datadir}/%{vdsm_name}/storage/fileSD.py*
%{_datadir}/%{vdsm_name}/storage/fileUtils.py*
%{_datadir}/%{vdsm_name}/storage/fileVolume.py*
diff --git a/vdsm/storage/Makefile.am b/vdsm/storage/Makefile.am
index ab3c387..0478add 100644
--- a/vdsm/storage/Makefile.am
+++ b/vdsm/storage/Makefile.am
@@ -29,6 +29,7 @@
devicemapper.py \
dispatcher.py \
domainMonitor.py \
+ drbd.py \
fileSD.py \
fileUtils.py \
fileVolume.py \
diff --git a/vdsm/storage/drbd.py b/vdsm/storage/drbd.py
new file mode 100644
index 0000000..3bbc954
--- /dev/null
+++ b/vdsm/storage/drbd.py
@@ -0,0 +1,324 @@
+#
+# Copyright 2009-2011 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 random
+import socket
+
+import utils
+import constants
+import threading
+import storage_exception as se
+
+DRBD_VERSION = "v08"
+DRBD_MAXUUID = 256 ** 8
+DRBD_MAXMINOR = 255
+DRBD_DEVPREFIX = "drbd"
+DRBD_BASEPORT = 7800
+
+KNOWN_VALUES = (
+ "Configured",
+ "Unconfigured",
+ "NA",
+)
+
+CONN_STATE_VALUES = (
+ "StandAlone",
+ "Disconnecting",
+ "Unconnected",
+ "Timeout",
+ "BrokenPipe",
+ "NetworkFailure",
+ "ProtocolError",
+ "WFConnection",
+ "WFReportParams",
+ "TearDown",
+ "Connected",
+ "StartingSyncS",
+ "StartingSyncT",
+ "WFBitMapS",
+ "WFBitMapT",
+ "WFSyncUUID",
+ "SyncSource",
+ "SyncTarget",
+ "PausedSyncS",
+ "PausedSyncT",
+ "VerifyS",
+ "VerifyT",
+ "Ahead",
+ "Behind",
+)
+
+ROLE_STATE_VALUES = (
+ "Primary",
+ "Secondary",
+ "Unknown",
+)
+
+DISK_STATE_VALUES = (
+ "Diskless",
+ "Attaching",
+ "Failed",
+ "Negotiating",
+ "Inconsistent",
+ "Outdated",
+ "DUnknown",
+ "Consistent",
+ "UpToDate",
+)
+
+
+class ReplicatedDevice(object):
+ @classmethod
+ def newUUID(cls):
+ return "%016X" % (random.randint(0, DRBD_MAXUUID),)
+
+ @classmethod
+ def readUUID(cls, device):
+ rc, out, err = utils.execCmd([
+ constants.EXT_DRBDMETA, "0", DRBD_VERSION, device,
+ "internal", "read-dev-uuid"
+ ])
+
+ if rc != 0 or len(out) != 1:
+ raise se.ReplicatedDeviceError()
+
+ return out[0]
+
+ @classmethod
+ def writeUUID(cls, device, uuid):
+ rc, out, err = utils.execCmd([
+ constants.EXT_DRBDMETA, "0", DRBD_VERSION, device,
+ "internal", "write-dev-uuid", uuid
+ ])
+
+ if rc != 0:
+ raise se.ReplicatedDeviceError()
+
+ @classmethod
+ def create(cls, device):
+ # Checking if the device was already initialized
+ try:
+ uuid = cls.readUUID(device)
+ raise se.ReplicatedDeviceInitialized(uuid)
+ except se.ReplicatedDeviceError:
+ pass
+
+ rc, out, err = utils.execCmd([
+ constants.EXT_DRBDMETA, "0", DRBD_VERSION, device,
+ "internal", "create-md", "--force"
+ ])
+
+ if rc != 0:
+ raise se.ReplicatedDeviceError()
+
+ uuid = cls.newUUID()
+ cls.writeUUID(device, uuid)
+
+ if uuid != cls.readUUID(device):
+ raise se.ReplicatedDeviceError()
+
+ return uuid
+
+
+class ReplicatedStatus(dict):
+ # format:
+ # "inkey" ("outkey", default, "_decodeMethod", methodArgs...),
+ _statusMap = {
+ "_minor": ("minor", None, "_decodeMinor"),
+ "_res_name": ("resName", "", "_decodeValue", str),
+ "_volume": ("volume", 0, "_decodeValue", int),
+ "_known": ("known", "NA", "_decodeEnum", KNOWN_VALUES),
+ "_cstate": ("connState",
+ "Unconnected", "_decodeEnum", CONN_STATE_VALUES),
+ "_role": ("roleState",
+ "Unknown", "_decodeEnum", ROLE_STATE_VALUES),
+ "_peer": ("peerState",
+ "Unknown", "_decodeEnum", ROLE_STATE_VALUES),
+ "_disk": ("diskState",
+ "DUnknown", "_decodeEnum", DISK_STATE_VALUES),
+ "_pdisk": ("peerDiskState",
+ "DUnknown", "_decodeEnum", DISK_STATE_VALUES),
+ # This is a drbd bug, the same key is called in two different ways
+ # depending on the state of the resource. Remove me in the future.
+ "_pdsk": ("peerDiskState",
+ "DUnknown", "_decodeEnum", DISK_STATE_VALUES),
+ "_flags_susp": ("flagsSusp", False, "_decodeFlags"),
+ "_flags_aftr_isp": ("flagsAfterIsp", False, "_decodeFlags"),
+ "_flags_peer_isp": ("flagsPeerIsp", False, "_decodeFlags"),
+ "_flags_user_isp": ("flagsUserIsp", False, "_decodeFlags"),
+ "_resynced_percent": ("resyncedPercent", 0, "_decodeValue", float),
+ }
+
+ def __init__(self, *args, **kwargs):
+ dict.__init__(self, *args, **kwargs)
+
+ for key, description in self._statusMap.items():
+ dict.__setitem__(self, description[0], description[1])
+
+ def __setitem__(self, item, value):
+ if item not in self._statusMap:
+ raise KeyError(item)
+
+ description = self._statusMap[item]
+
+ # Validating key value
+ validate = getattr(self, description[2])
+ value = validate(value, description[1], *description[3:])
+
+ dict.__setitem__(self, description[0], value)
+
+ def _decodeMinor(self, value, default):
+ value = int(value)
+ return value if value != 4294967295 else default
+
+ def _decodeValue(self, value, default, newtype):
+ return default if value == "" else newtype(value)
+
+ def _decodeEnum(self, value, default, enums):
+ if value in enums:
+ return value
+ elif default in enums:
+ return default
+ raise ValueError(default)
+
+ def _decodeFlags(self, value, default):
+ return True if value == "1" else default
+
+
+class ReplicatedResource(object):
+ minorLock = threading.Lock()
+
+ def __init__(self, rdUUID):
+ self.rdUUID = rdUUID
+
+ @classmethod
+ def attach(cls, rdUUID, device):
+ rc, out, err = utils.execCmd([
+ constants.EXT_DRBDSETUP, "new-resource", rdUUID
+ ])
+
+ if rc != 0:
+ raise se.ReplicatedResourceError()
+
+ with cls.minorLock:
+ minor = str(cls._getFreeMinor())
+
+ rc, out, err = utils.execCmd([
+ constants.EXT_DRBDSETUP, "new-minor", rdUUID,
+ minor, "0"
+ ])
+
+ if rc != 0:
+ raise se.ReplicatedResourceError()
+
+ rc, out, err = utils.execCmd([
+ constants.EXT_DRBDMETA, minor, DRBD_VERSION, device,
+ "internal", "apply-al"
+ ])
+
+ if rc != 0:
+ raise se.ReplicatedResourceError()
+
+ rc, out, err = utils.execCmd([
+ constants.EXT_DRBDSETUP, "attach", minor, device,
+ device, "internal"
+ ])
+
+ if rc != 0:
+ raise se.ReplicatedResourceError()
+
+ @property
+ def status(self):
+ return ReplicatedResource.info(self.rdUUID)
+
+ @classmethod
+ def _getFreeMinor(cls):
+ usedminors = set(map(lambda x: x['minor'], cls.info()))
+
+ for minor in xrange(1, DRBD_MAXMINOR):
+ if minor not in usedminors:
+ return minor
+
+ raise se.ReplicatedResourceError()
+
+ @classmethod
+ def info(cls, resource=None):
+ target = resource if resource else "all"
+
+ rc, out, err = utils.execCmd([
+ constants.EXT_DRBDSETUP, "sh-status", target
+ ])
+
+ if rc != 20:
+ raise se.ReplicatedResourceError()
+
+ result = []
+ status = ReplicatedStatus()
+
+ for line in filter(lambda x: len(x) > 0, out):
+ if line == "_sh_status_process":
+ result.append(status)
+ status = ReplicatedStatus()
+ continue
+
+ key, value = line.split("=", 1)
+ status[key] = value
+
+ if resource:
+ if len(result) == 1:
+ return result[0]
+ else:
+ raise se.ReplicatedResourceError()
+
+ return result
+
+ # XXX: Using the force flag might lead to data corruption! It should be
+ # used only during the device initialization or in an unrecoverable
+ # split-brain situation.
+ def primary(self, force=False):
+ primary_minor = str(self.status['minor'])
+ primary_force = ["--force"] if force is True else []
+
+ rc, out, err = utils.execCmd([constants.EXT_DRBDSETUP, "primary",
+ primary_minor] + primary_force)
+ if rc != 0:
+ raise se.ReplicatedResourceError()
+
+ def connect(self, remote):
+ drbdport = DRBD_BASEPORT + self.status['minor']
+ remoteip = socket.gethostbyname(remote)
+
+ connect_opts = [
+ "ipv4:0.0.0.0:%d" % (drbdport,),
+ "ipv4:%s:%d" % (remoteip, drbdport),
+ "--protocol=C",
+ "--allow-two-primaries=yes",
+ ]
+
+ rc, out, err = utils.execCmd([constants.EXT_DRBDSETUP, "connect",
+ self.rdUUID] + connect_opts)
+ if rc != 0:
+ raise se.ReplicatedResourceError()
+
+
+def getReplicatedDevices():
+ for status in ReplicatedResource.info():
+ if status['minor'] and status['roleState'] == "Primary":
+ yield DRBD_DEVPREFIX + str(status['minor'])
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index ae35b11..eb342a2 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -45,6 +45,7 @@
import glusterSD
import localFsSD
import lvm
+import drbd
import fileUtils
import multipath
from sdc import sdCache
@@ -1969,17 +1970,23 @@
vars.task.setDefaultException(
se.VolumeGroupCreateError(str(vgname), str(devlist)))
misc.validateUUID(vgname, 'vgname')
- # getSharedLock(connectionsResource...)
- knowndevs = set(multipath.getMPDevNamesIter())
+ #getSharedLock(connectionsResource...)
+ knownmpath = list(multipath.getMPDevNamesIter())
+ knowndrbd = list(drbd.getReplicatedDevices())
size = 0
devices = []
for dev in devlist:
- if dev in knowndevs:
- devices.append(dev)
- size += multipath.getDeviceSize(devicemapper.getDmId(dev))
+ # Finding the device in the known ones
+ if dev in knownmpath:
+ devname = devicemapper.getDmId(dev)
+ elif dev in knowndrbd:
+ devname = dev
else:
raise se.InvalidPhysDev(dev)
+
+ devices.append(dev)
+ size += multipath.getDeviceSize(devname)
# Minimal size check
if size < MINIMALVGSIZE:
@@ -3417,3 +3424,80 @@
result[d] = repo_stats[d]['result']
return result
+
+ @public
+ def createReplicatedDevice(self, device):
+ """
+ Creates a new replicated device (drbd).
+
+ :param device: The block device to be used.
+ :type device: str
+
+ :returns: The new device uuid.
+ :rtype: str
+ """
+ newUUID = drbd.ReplicatedDevice.create(device)
+ return dict(uuid=newUUID)
+
+ @public
+ def getReplicatedResourcesList(self):
+ """
+ List all the replicated resources in the system (drbd).
+
+ :returns: The replicated resources list.
+ :rtype: list
+ """
+ resources = drbd.ReplicatedResource.info()
+ return dict(resList=map(lambda x: x['resName'], resources))
+
+ @public
+ def getReplicatedResourceInfo(self, rdUUID):
+ """
+ Gets the info of a replicated resource (drbd).
+
+ :param rdUUID: The resource UUID.
+ :type rdUUID: UUID
+
+ :returns: The replicated resources information.
+ :rtype: dict
+ """
+ resource = dict(drbd.ReplicatedResource.info(rdUUID))
+ return dict(resInfo=resource)
+
+ @public
+ def attachReplicatedResource(self, rdUUID, device):
+ """
+ Attaches a replicated resource (drbd) to a block device.
+
+ :param rdUUID: The resource UUID.
+ :type rdUUID: UUID
+ :param device: The block device to be used.
+ :type device: str
+ """
+ drbd.ReplicatedResource.attach(rdUUID, device)
+
+ @public
+ def connectReplicatedResource(self, rdUUID, target):
+ """
+ Connects a replicated resource (drbd) to a remote peer.
+
+ :param rdUUID: The resource UUID.
+ :type rdUUID: UUID
+ :param target: The peer target address.
+ :type device: str
+ """
+ rd = drbd.ReplicatedResource(rdUUID)
+ rd.connect(target)
+
+ @public
+ def activateReplicatedResource(self, rdUUID, force=False):
+ """
+ Connects a replicated resource (drbd) to a remote peer.
+
+ :param rdUUID: The resource UUID.
+ :type rdUUID: UUID
+ :param target: The peer target address.
+ :type device: str
+ """
+ rd = drbd.ReplicatedResource(rdUUID)
+ rd.primary(misc.parseBool(force))
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 97fe38a..351fca4 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -40,6 +40,7 @@
from vdsm import constants
import misc
import multipath
+import drbd
import storage_exception as se
from vdsm.config import config
import devicemapper
@@ -83,9 +84,8 @@
LVM_FLAGS = ("--noheadings", "--units", "b", "--nosuffix", "--separator",
SEPARATOR)
-PV_PREFIX = "/dev/mapper"
-# Assuming there are no spaces in the PV name
-re_pvName = re.compile(PV_PREFIX + '[^\s\"]+', re.MULTILINE)
+DEVICE_PREFIX = "/dev"
+MAPPER_PREFIX = "/dev/mapper"
# operations lock
LVM_OP_INVALIDATE = "lvm invalidate operation"
@@ -263,7 +263,12 @@
if not self._filterStale:
return self._extraCfg
- self._extraCfg = _buildConfig(multipath.getMPDevNamesIter())
+ devList = (
+ list(multipath.getMPDevNamesIter()) +
+ list(drbd.getReplicatedDevices())
+ )
+
+ self._extraCfg = _buildConfig(devList)
_updateLvmConf(self._extraCfg)
self._filterStale = False
@@ -635,8 +640,11 @@
def _fqpvname(pv):
- if pv and not pv.startswith(PV_PREFIX):
- pv = os.path.join(PV_PREFIX, pv)
+ if pv and not pv.startswith(DEVICE_PREFIX):
+ if pv.startswith(drbd.DRBD_DEVPREFIX):
+ pv = os.path.join(DEVICE_PREFIX, pv)
+ else:
+ pv = os.path.join(MAPPER_PREFIX, pv)
return pv
@@ -795,7 +803,10 @@
Receives guids iterable.
Returns (un)pvables, (un)succeed guids.
"""
- devs = tuple("%s/%s" % (PV_PREFIX, dev) for dev in devices)
+ # FIXME: these new MAPPER_PREFIX entries should be handled to include
+ # drbd too, see the function _fqpvname.
+ devs = tuple("%s/%s" % (MAPPER_PREFIX, dev) for dev in devices)
+ re_pvName = re.compile(MAPPER_PREFIX + '[^\s\"]+', re.MULTILINE)
options = ("--test",)
rc, out, err = _createpv(devs, metadataSize, options)
diff --git a/vdsm/storage/storage_exception.py b/vdsm/storage/storage_exception.py
index c2c3dc8..d0a946e 100644
--- a/vdsm/storage/storage_exception.py
+++ b/vdsm/storage/storage_exception.py
@@ -1721,3 +1721,17 @@
code = 855
message = ("Could not acquire resource. "
"Probably resource factory threw an exception.")
+
+
+#################################################
+# Replicated Device Exceptions
+#################################################
+
+class ReplicatedDeviceError(StorageException):
+ code = 900
+ message = "Replicated device general error"
+
+
+class ReplicatedResourceError(StorageException):
+ code = 901
+ message = "Replicated resource general error"
diff --git a/vdsm/sudoers.vdsm.in b/vdsm/sudoers.vdsm.in
index 24031ec..c673688 100644
--- a/vdsm/sudoers.vdsm.in
+++ b/vdsm/sudoers.vdsm.in
@@ -24,6 +24,8 @@
@SERVICE_PATH@ multipathd reload, \
@ISCSIADM_PATH@ *, \
@LVM_PATH@, \
+ @DRBDMETA_PATH@, \
+ @DRBDSETUP_PATH@, \
@CAT_PATH@ /sys/block/*/device/../../*, \
@CAT_PATH@ /sys/devices/platform/host*, \
@CAT_PATH@ /etc/iscsi/iscsid.conf, \
--
To view, visit http://gerrit.ovirt.org/13585
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I33bb867ba6c7cfca54d31334554cb37db11aeeea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: Remove block size validation from blockSD instatiation.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Remove block size validation from blockSD instatiation.
......................................................................
Remove block size validation from blockSD instatiation.
This check is unnecessary at this point since vdsm will
fail before if blocks are not 512 sized.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=955993
Change-Id: I296b4bd3a697078c89451b167b1f9e0f64cc015e
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/blockSD.py
M vdsm/storage/hsm.py
2 files changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/14514/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 86ffb66..0c7771c 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -409,10 +409,6 @@
self.logBlkSize = 512
self.phyBlkSize = 512
- # Check that all devices in the VG have the same logical and physical
- # block sizes.
- lvm.checkVGBlockSizes(sdUUID, (self.logBlkSize, self.phyBlkSize))
-
# _extendlock is used to prevent race between
# VG extend and LV extend.
self._extendlock = threading.Lock()
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 25363dc..a196105 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2238,6 +2238,11 @@
if domType in (sd.FCP_DOMAIN, sd.ISCSI_DOMAIN):
uuids = tuple(blockSD.getStorageDomainsList())
+ logBlkSize = 512
+ phyBlkSize = 512
+ for uuid in uuids:
+ lvm.checkVGBlockSizes(uuid, (logBlkSize, phyBlkSize))
+
elif domType is sd.NFS_DOMAIN:
lPath = conObj._mountCon._getLocalPath()
self.log.debug("nfs local path: %s", lPath)
--
To view, visit http://gerrit.ovirt.org/14514
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I296b4bd3a697078c89451b167b1f9e0f64cc015e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: gluster: add server uuid into volume brick info list
by tjeyasin@redhat.com
Hello Ayal Baron, Bala.FA, Saggi Mizrahi, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/18492
to review the following change.
Change subject: gluster: add server uuid into volume brick info list
......................................................................
gluster: add server uuid into volume brick info list
Currently, when a node has more than one ip, the oVirt-engine fails
to map the corresponding server using the ip alone.
If we get the host uuid along with other brick details in volume info
command it will be easy for ovirt-engine to find out the
server and thereby we can avoid confusion in finding the server.
This patch provides volume brick uuid for a given brick
Change-Id: I0e33f9baf50f66f6120545c25b0a01a7c3b75d17
Signed-off-by: Timothy Asir <tjeyasin(a)redhat.com>
---
M vdsm/gluster/cli.py
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/18492/1
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index bac6d1c..e466366 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -345,9 +345,11 @@
else:
value['transportType'] = [TransportType.TCP, TransportType.RDMA]
value['bricks'] = []
+ value['bricksUuid'] = []
value['options'] = {}
for b in el.findall('bricks/brick'):
value['bricks'].append(b.text)
+ value['bricksUuid'] += [c[1] for c in b.items() if c[0] == 'uuid']
for o in el.findall('options/option'):
value['options'][o.find('name').text] = o.find('value').text
volumes[value['volumeName']] = value
--
To view, visit http://gerrit.ovirt.org/18492
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e33f9baf50f66f6120545c25b0a01a7c3b75d17
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeyasin(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: [WIP]blockSD: do not umount if not all processes were killed
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: [WIP]blockSD: do not umount if not all processes were killed
......................................................................
[WIP]blockSD: do not umount if not all processes were killed
Umount of the masterFS will fail if there are
processes accessing it.
Related to BZ#949581
Change-Id: I899aa033436bb41d8bef5ec18091c3d9c9566efc
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm/storage/blockSD.py
1 file changed, 15 insertions(+), 16 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/76/18876/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index e8b2980..c2c27f9 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -1166,11 +1166,11 @@
cls.__handleStuckUmount(masterdir)
try:
masterMount = mount.getMountFromTarget(masterdir)
- except OSError as ex:
- if ex.errno == errno.ENOENT:
+ except OSError as e:
+ if e.errno == errno.ENOENT:
return
-
raise
+
if masterMount.isMounted():
# Try umount, take 1
try:
@@ -1185,36 +1185,35 @@
return
if len(pids) == 0:
- cls.log.warn("Unmount failed because of errors that fuser "
- "can't solve")
+ cls.log.warn("Unmount failed, but there are no processes "
+ "accessing masterFS reported by fuser")
else:
+ doUmount = True
for pid in pids:
+ cls.log.debug("Trying to kill pid %d", pid)
try:
- cls.log.debug("Trying to kill pid %d", pid)
os.kill(pid, signal.SIGKILL)
except OSError as e:
if e.errno == errno.ESRCH: # No such process
- pass
+ cls.log.warn("Could not find pid %d ", pid)
elif e.errno == errno.EPERM: # Op. not permitted
cls.log.warn("Could not kill pid %d because "
"operation was not permitted",
pid)
+ doUmount = False
else:
cls.log.warn("Could not kill pid %d because an"
" unexpected error",
exc_info=True)
- except:
- cls.log.warn("Could not kill pid %d because an "
- "unexpected error", exc_info=True)
+ doUmount = False
- # Try umount, take 2
- try:
- masterMount.umount()
- except mount.MountError:
- pass
+ if doUmount:
+ try:
+ masterMount.umount()
+ except mount.MountError:
+ pass
if masterMount.isMounted():
- # We failed to umount masterFS
# Forcibly rebooting the SPM host would be safer. ???
raise se.StorageDomainMasterUnmountError(masterdir, 1)
--
To view, visit http://gerrit.ovirt.org/18876
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I899aa033436bb41d8bef5ec18091c3d9c9566efc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: clientIF: only warn when failing to deactivate lvs after ali...
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: clientIF: only warn when failing to deactivate lvs after alignment scan
......................................................................
clientIF: only warn when failing to deactivate lvs after alignment scan
The deactivation fails because the vm can be up when performing scan,
which means deactivate should fail when vm is up and we should only
log instead of raise.
Related to BZ#998411
Change-Id: I2e22c136d11537d3cd96815ea52ae893b97787c0
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm/clientIF.py
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/18882/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 38822fe..5e20e29 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -27,6 +27,7 @@
from storage.dispatcher import Dispatcher
from storage.hsm import HSM
+from storage import storage_exception as se
import alignmentScan
from vdsm.config import config
import ksm
@@ -380,7 +381,11 @@
for line in out:
aligning[line.partitionName] = line.alignmentScanResult
finally:
- self.teardownVolumePath(drive)
+ try:
+ self.teardownVolumePath(drive)
+ except se.CannotDeactivateLogicalVolume as e:
+ self.log.warning("Cannot deactivate LVs if used by a vm: %s",
+ str(e))
return {'status': doneCode, 'alignment': aligning}
--
To view, visit http://gerrit.ovirt.org/18882
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e22c136d11537d3cd96815ea52ae893b97787c0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
9 years, 4 months