Change in vdsm[master]: mom: add mom balloon functional tests for running vms
by wudxw@linux.vnet.ibm.com
Mark Wu has posted comments on this change.
Change subject: mom: add mom balloon functional tests for running vms
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(5 inline comments)
....................................................
File tests/functional/momTests.py
Line 65: self.assertEqual(pages_to_scan, hostStats['ksmPages'])
Line 66:
Line 67: def _filterVmsStats(self, vmsStats, filteredStats):
Line 68: # Filter all vms' statistics to get balloon operation candidates.
Line 69: for Stats in vmsStats:
states is better than States
Line 70: try:
Line 71: if Stats['status'] == 'Running' and Stats['balloonInfo'] \
Line 72: and Stats['memoryStats']:
Line 73: filteredStats.append(Stats)
Line 69: for Stats in vmsStats:
Line 70: try:
Line 71: if Stats['status'] == 'Running' and Stats['balloonInfo'] \
Line 72: and Stats['memoryStats']:
Line 73: filteredStats.append(Stats)
filteredStats is a little bit confusing.
Any reason using a pass in argument instead of return value?
Line 74: except KeyError:
Line 75: pass
Line 76: return
Line 77:
Line 134: Host.mem_available))
Line 135: (if (<= host_free_percent pressure_threshold)
Line 136: (with Guests guest (shrink_guest guest))
Line 137: 0)"""
Line 138:
You could save the policy string in a separate file
Line 139: r = self.s.setMOMPolicy(testPolicyStr)
Line 140: self.assertOK(r)
Line 141:
Line 142: # Wait for the policy taking effect
Line 214: (defvar host_free_percent (/ (Host.StatAvg "mem_free")
Line 215: Host.mem_available))
Line 216: (if (> host_free_percent pressure_threshold)
Line 217: (with Guests guest (grow_guest guest)) 0)"""
Line 218:
the same here as line 138
Line 219: r = self.s.setMOMPolicy(testPolicyStr)
Line 220: self.assertOK(r)
Line 221:
Line 222: # Wait for the policy taking effect
Line 236: self.assertTrue(vmNewStats['balloonInfo']['balloon_cur']
Line 237: <= ceil(balloonMax))
Line 238: self.assertTrue(vmNewStats['balloonInfo']['balloon_cur']
Line 239: >= floor(0.99225 * balloonMax))
Line 240: break
I believe there's a lot of code could be shared between testBalloonGrow and testBalloonShrink. So it's better to exact some functions to reduce the duplicated code.
--
To view, visit http://gerrit.ovirt.org/13156
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I922568233dc769d83e2fdffe1c24439d13d03d7e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
11 years
Change in vdsm[master]: vdsm-logrotate.conf: Add copytruncate
by Douglas Schilling Landgraf
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: vdsm-logrotate.conf: Add copytruncate
......................................................................
vdsm-logrotate.conf: Add copytruncate
Rotating the log files is not enough, VDSM keep it open and
appending entries.
Change-Id: Ie018b2039eac565cfdb5874c664b177d6fad64fa
Bug-URL: https://bugzilla.redhat.com/show_bug.cgi?id=928217
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M vdsm/vdsm-logrotate.conf.in
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/99/13499/1
diff --git a/vdsm/vdsm-logrotate.conf.in b/vdsm/vdsm-logrotate.conf.in
index ce71015..dc05f16 100644
--- a/vdsm/vdsm-logrotate.conf.in
+++ b/vdsm/vdsm-logrotate.conf.in
@@ -1,5 +1,6 @@
/var/log/vdsm/*.log {
rotate 100
+ copytruncate
missingok
size 15M
compress
--
To view, visit http://gerrit.ovirt.org/13499
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie018b2039eac565cfdb5874c664b177d6fad64fa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
11 years
Change in vdsm[master]: testrunner: Add NOSE_COLOR env var
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: testrunner: Add NOSE_COLOR env var
......................................................................
testrunner: Add NOSE_COLOR env var
Allows forcing output of color to non terminal.
Useful for case where the errors are longer then the scrollback:
NOSE_COLOR=1 ./run_tests_local.sh jsonRpcTests | less -R
Change-Id: I4eb684c73f6254a35707fcd7f3f6b30eaaae9f2f
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M tests/testrunner.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/12302/1
diff --git a/tests/testrunner.py b/tests/testrunner.py
index 2c55a51..1880736 100644
--- a/tests/testrunner.py
+++ b/tests/testrunner.py
@@ -115,7 +115,7 @@
def colorWrite(stream, text, color):
- if os.isatty(stream.fileno()):
+ if os.isatty(stream.fileno()) or os.environ.get("NOSE_COLOR", False):
stream.write('\x1b[%s;1m%s\x1b[0m' % (color, text))
else:
stream.write(text)
--
To view, visit http://gerrit.ovirt.org/12302
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4eb684c73f6254a35707fcd7f3f6b30eaaae9f2f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
11 years
Change in vdsm[ovirt-3.2]: Bump up libvirt version to fix network linking.
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: Bump up libvirt version to fix network linking.
......................................................................
Bump up libvirt version to fix network linking.
The libvirt feature leveraged for the Network linking feature had
a bug that made it fail when the vnic had a bootorder set. This was
solved and has been marked for backport (which did not yet happen)
for the version this patch sets).
Change-Id: Ib9e96eb0192fbea35d2723cafbec145b629371fa
Bug-Url: https://bugzilla.redhat.com/906446
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/11600/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 00c1259..a99f543 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -119,7 +119,7 @@
Requires: python >= 2.7.3
Requires: qemu-kvm >= 2:0.15.0-4
Requires: qemu-img >= 2:0.15.0-4
-Requires: libvirt >= 0.10.1-1
+Requires: libvirt >= 0.10.2-4
Requires: iscsi-initiator-utils >= 6.2.0.872-14
Requires: device-mapper-multipath >= 0.4.9-18
Requires: e2fsprogs >= 1.41.14
--
To view, visit http://gerrit.ovirt.org/11600
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9e96eb0192fbea35d2723cafbec145b629371fa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.2
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
11 years
Change in vdsm[ovirt-3.2]: fix storage.fuser
by Dan Kenigsberg
Hello Yaniv Bronhaim,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/13303
to review the following change.
Change subject: fix storage.fuser
......................................................................
fix storage.fuser
Bug-Url: https://bugzilla.redhat.com/922515
Change-Id: Iabd58847db7090f83106d30a763d09c0a7b78741
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13302
Reviewed-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
Tested-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M tests/Makefile.am
A tests/fuserTests.py
M vdsm/storage/fuser.py
3 files changed, 33 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/03/13303/1
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8ad34e2..9aec750 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -27,6 +27,7 @@
capsTests.py \
configNetworkTests.py \
fileUtilTests.py \
+ fuserTests.py \
getAllVolumesTests.py \
glusterTestData.py \
gluster_cli_tests.py \
diff --git a/tests/fuserTests.py b/tests/fuserTests.py
new file mode 100644
index 0000000..7473dde
--- /dev/null
+++ b/tests/fuserTests.py
@@ -0,0 +1,31 @@
+#
+# Copyright 2013 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 os
+from storage import fuser
+
+from testrunner import VdsmTestCase
+
+
+class TestFuser(VdsmTestCase):
+
+ def testSelfExe(self):
+ pid = os.getpid()
+ self.assertTrue(pid in fuser.fuser('/proc/%s/exe' % pid))
diff --git a/vdsm/storage/fuser.py b/vdsm/storage/fuser.py
index d9becbc..135dad6 100644
--- a/vdsm/storage/fuser.py
+++ b/vdsm/storage/fuser.py
@@ -27,7 +27,7 @@
cmd.append("-m")
cmd.append(path)
- (rc, out, err) = misc.execCmd(cmd, sudo=True)
+ (rc, out, err) = misc.execCmd(cmd, raw=True, sudo=True)
if rc != 0:
return []
--
To view, visit http://gerrit.ovirt.org/13303
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iabd58847db7090f83106d30a763d09c0a7b78741
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.2
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
11 years
Change in vdsm[master]: Bump up libvirt version to fix network linking.
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: Bump up libvirt version to fix network linking.
......................................................................
Bump up libvirt version to fix network linking.
The libvirt feature leveraged for the Network linking feature had
a bug that made it fail when the vnic had a bootorder set. This was
solved and has been marked for backport (which did not yet happen)
for the version this patch sets).
Change-Id: Ib9e96eb0192fbea35d2723cafbec145b629371fa
Bug-Url: https://bugzilla.redhat.com/906446
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/99/11599/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index b5be43e..fd1b2df 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -119,7 +119,7 @@
Requires: python >= 2.7.3
Requires: qemu-kvm >= 2:0.15.0-4
Requires: qemu-img >= 2:0.15.0-4
-Requires: libvirt >= 0.10.1-1
+Requires: libvirt >= 0.10.2-4
Requires: iscsi-initiator-utils >= 6.2.0.872-14
Requires: device-mapper-multipath >= 0.4.9-18
Requires: e2fsprogs >= 1.41.14
--
To view, visit http://gerrit.ovirt.org/11599
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9e96eb0192fbea35d2723cafbec145b629371fa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
11 years
Change in vdsm[master]: make vdsmd.init.in adapt to both Fedora and Ubuntu
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: make vdsmd.init.in adapt to both Fedora and Ubuntu
......................................................................
make vdsmd.init.in adapt to both Fedora and Ubuntu
The patch is on going work of porting VDSM to Ubuntu
http://www.ovirt.org/VDSM_on_Ubuntu
Change-Id: I186743ed7fd345bf150047d4005818e1df3c07fc
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M vdsm/vdsmd.init.in
1 file changed, 75 insertions(+), 24 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/13489/1
diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in
index c804ce8..85bc61b 100755
--- a/vdsm/vdsmd.init.in
+++ b/vdsm/vdsmd.init.in
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
#
# Copyright 2006-2010 Red Hat, Inc. and/or its affiliates.
#
@@ -23,6 +23,16 @@
. @LIBEXECDIR(a)/ovirt_functions.sh
+choosePath() {
+ for P in "$@"; do
+ if [ -e "$P" ]; then
+ echo "$P"
+ return 0
+ fi
+ done
+ echo "$1"
+}
+
VDSM_BIN=@VDSMDIR@/vdsm
CONF_FILE=@CONFDIR(a)/vdsm.conf
GETCONFITEM=@VDSMDIR@/get-conf-item
@@ -33,7 +43,24 @@
DOM_METADATA_BACKUP_DIR=/var/log/vdsm/backup
CORE_PATTERN=/proc/sys/kernel/core_pattern
QEMU_DUMP_PATH="/var/log/core"
-NEEDED_SERVICES="iscsid multipathd ntpd wdmd sanlock network"
+SERVICE="$(choosePath /sbin/service /usr/sbin/service)"
+LOCK_PATH="$(choosePath /var/lock/subsys /var/lock)"
+
+ISCSID=iscsid
+LIBVIRTD=libvirtd
+MULTIPATHD=multipathd
+NETWORK=network
+NTPD=ntpd
+SANLOCK=sanlock
+WDMD=wdmd
+if grep -i ubuntu /etc/*-release >/dev/null 2>&1; then
+ ISCSID=open-iscsi
+ LIBVIRTD=libvirt-bin
+ MULTIPATHD=multipath-tools
+ NETWORK=netowking
+ NTPD=ntp
+fi
+NEEDED_SERVICES="$ISCSID $MULTIPATHD $NTPD $WDMD $SANLOCK $NETWORK"
CONFLICTING_SERVICES="libvirt-guests"
# trigger for reconfiguration
@@ -41,7 +68,7 @@
LCONF=/etc/libvirt/libvirtd.conf
QCONF=/etc/libvirt/qemu.conf
-LDCONF=/etc/sysconfig/libvirtd
+LDCONF="$(choosePath /etc/sysconfig/libvirtd /etc/default/libvirt-bin)"
QLCONF=/etc/libvirt/qemu-sanlock.conf
is_coredump=`$GETCONFITEM $CONF_FILE vars core_dump_enable false | tr A-Z a-z`
@@ -49,10 +76,17 @@
SYSTEMCTL_SKIP_REDIRECT=true
-. /etc/init.d/functions
-
-log_failure_msg() { echo -n "$@"; failure "$@"; echo; }
-log_success_msg() { echo -n "$@"; success "$@"; echo; }
+if [ -e /etc/init.d/functions ]; then
+ . /etc/init.d/functions
+ log_failure_msg() { echo -n "$@"; failure "$@"; echo; }
+ log_success_msg() { echo -n "$@"; success "$@"; echo; }
+else
+ . /lib/lsb/init-functions
+ # log_failure_msg and log_success_msg are defined already
+ # in /lib/lsb/init-functions
+ failure() { local rc=$?; log_failure_msg; return "$rc"; }
+ success() { log_success_msg; return 0; }
+fi
mk_data_center() {
local dc
@@ -122,13 +156,13 @@
for srv in $CONFLICTING_SERVICES
do
- /sbin/chkconfig $srv off
- if /sbin/service $srv status > /dev/null 2>&1;
+ disable_service_sysv $srv
+ if "$SERVICE" $srv status > /dev/null 2>&1;
then
if [ "$srv" == "libvirt-guests" ]; then
- /bin/rm -f /var/lock/subsys/libvirt-guests
+ /bin/rm -f "$LOCK_PATH/libvirt-guests"
else
- /sbin/service $srv stop
+ "$SERVICE" $srv stop
fi
fi
done
@@ -145,10 +179,10 @@
for srv in $NEEDED_SERVICES
do
- if ! /sbin/service $srv status > /dev/null 2>&1;
+ if ! "$SERVICE" $srv status > /dev/null 2>&1;
then
echo "Starting $srv..."
- /sbin/service $srv start
+ "$SERVICE" $srv start
ret_val=$?
if [ $ret_val -ne 0 ]
then
@@ -158,7 +192,7 @@
fi
done
- /sbin/service iscsid force-start
+ "$SERVICE" $ISCSID force-start || true
}
test_lo() {
@@ -216,7 +250,7 @@
# Remove configuration created by vdsm (old "# by vdsm" and the new format)
# Argument: configuration file that will be inspected
remove_vdsm_conf() {
- sed -i --copy -e "/${start_conf_section}/,/${end_conf_section}/d" \
+ sed -i -e "/${start_conf_section}/,/${end_conf_section}/d" \
-e "/$by_vdsm/d" "$@"
}
@@ -363,7 +397,7 @@
ovirt_store_config "$lconf" "$qconf" "$ldconf" "$llogr"
if libvirt_should_use_upstart; then
- /sbin/initctl restart libvirtd 2>/dev/null || :
+ /sbin/initctl restart $LIBVIRTD 2>/dev/null || :
else
/bin/systemctl restart libvirtd.service
fi
@@ -394,12 +428,22 @@
configure_libvirt $args
}
+disable_service_sysv() {
+ if [ -e /sbin/chkconfig ]; then
+ /sbin/chkconfig "$1" off
+ elif [ -e /usr/sbin/update-rc.d ]; then
+ /usr/sbin/update-rc.d "$1" disable
+ else
+ false
+ fi
+}
+
stop_libvirtd_sysv() {
# stop libvirt SysV service if we intend to configure upstart
- if libvirt_should_use_upstart && ! [[ -f /etc/init/libvirtd.conf ]]; then
- /sbin/chkconfig libvirtd off
- /sbin/service libvirtd stop
+ if libvirt_should_use_upstart && ! [[ -f /etc/init/"$LIBVIRTD".conf ]]; then
+ disable_service_sysv $LIBVIRTD
+ "$SERVICE" $LIBVIRTD stop
fi
}
@@ -408,7 +452,7 @@
local startout
if ! libvirt_should_use_upstart; then
- /sbin/service libvirtd start
+ "$SERVICE" $LIBVIRTD start
return
fi
@@ -422,7 +466,7 @@
/sbin/initctl reload-configuration
fi
- startout=`/sbin/initctl start libvirtd 2>&1`
+ startout=`/sbin/initctl start $LIBVIRTD 2>&1`
if [[ "$?" -eq 0 || "$startout" =~ .*already\ running.* ]];
then
return 0
@@ -505,12 +549,19 @@
echo $"Starting up vdsm daemon: "
local vdsm_nice=`$GETCONFITEM $CONF_FILE vars vdsm_nice -5`
+ if type daemon >/dev/null 2>&1; then
+ RUNDAEMON="daemon --user=vdsm"
+ elif type start_daemon >/dev/null 2>&1; then
+ RUNDAEMON="start_daemon -n $vdsm_nice -- /usr/bin/sudo -u vdsm"
+ else
+ RUNDAEMON="false"
+ fi
LIBVIRT_LOG_FILTERS=`$GETCONFITEM $CONF_FILE vars libvirt_log_filters "1:libvirt 1:remote"` \
LIBVIRT_LOG_OUTPUTS=`$GETCONFITEM $CONF_FILE vars libvirt_log_outputs "1:file:/var/log/vdsm/libvirt.log"` \
- LC_ALL=C NICELEVEL=$vdsm_nice daemon --user=vdsm @VDSMDIR@/respawn --minlifetime 10 --daemon --masterpid $RESPAWNPIDFILE $VDSM_BIN
+ LC_ALL=C NICELEVEL=$vdsm_nice $RUNDAEMON @VDSMDIR@/respawn --minlifetime 10 --daemon --masterpid $RESPAWNPIDFILE $VDSM_BIN
RETVAL=$?
[ "$RETVAL" -eq 0 ] && log_success_msg $"$prog start" || log_failure_msg $"$prog start"
- [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/vdsmd
+ [ "$RETVAL" -eq 0 ] && touch "$LOCK_PATH/vdsmd"
}
stop() {
@@ -525,7 +576,7 @@
killproc -p $PIDFILE -d 2
RETVAL=$?
[ "$RETVAL" -eq 0 ] && log_success_msg $"$prog stop" || log_failure_msg $"$prog stop"
- [ "$RETVAL" -eq 0 ] && rm -f /var/lock/subsys/vdsmd
+ [ "$RETVAL" -eq 0 ] && rm -f "LOCK_PATH/vdsmd"
fi
python @VDSMDIR(a)/hooks.pyc after_vdsm_stop
return $RETVAL
--
To view, visit http://gerrit.ovirt.org/13489
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I186743ed7fd345bf150047d4005818e1df3c07fc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
11 years
Change in vdsm[master]: blocksd: skip broken images in getAllVolumes
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: blocksd: skip broken images in getAllVolumes
......................................................................
blocksd: skip broken images in getAllVolumes
When one of the images in the storage pool was damaged some operations
were failing for other images too (e.g. deletion).
This lead, for example, to the impossibility of removing VMs (and their
disks) on storage domains containing damaged images.
Change-Id: Ib9bbf7eecdb11873dd5fe9bef2afaa680aecbc32
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/blockSD.py
1 file changed, 11 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/11859/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index cc25417..404c3ef 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -164,18 +164,25 @@
"""
vols = _getVolsTree(sdUUID)
res = {}
+
for volName in vols.iterkeys():
res[volName] = {'imgs': [], 'parent': None}
for volName, vImg, parentVol in vols.itervalues():
res[volName]['parent'] = parentVol
+
if vImg not in res[volName]['imgs']:
res[volName]['imgs'].insert(0, vImg)
+
if (parentVol != sd.BLANK_UUID and
- not volName.startswith(
- sd.REMOVED_IMAGE_PREFIX) and
- vImg not in res[parentVol]['imgs']):
- res[parentVol]['imgs'].append(vImg)
+ not volName.startswith(sd.REMOVED_IMAGE_PREFIX)):
+ try:
+ if vImg not in res[parentVol]['imgs']:
+ res[parentVol]['imgs'].append(vImg)
+ except KeyError:
+ log.warning("Unable to find volume %s on domain %s, image "
+ "%s could be damaged, skipping", parentVol, vImg,
+ sdUUID, exc_info=True)
return dict((k, sd.ImgsPar(tuple(v['imgs']), v['parent']))
for k, v in res.iteritems())
--
To view, visit http://gerrit.ovirt.org/11859
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9bbf7eecdb11873dd5fe9bef2afaa680aecbc32
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
11 years
Change in vdsm[master]: shareVolumeRollback() unique call likes to raise on the unex...
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: shareVolumeRollback() unique call likes to raise on the unexpected.
......................................................................
shareVolumeRollback() unique call likes to raise on the unexpected.
Change-Id: I8f01ff2d30ffecc05b9cfd4978f79003a8032270
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/blockVolume.py
M vdsm/storage/fileVolume.py
2 files changed, 5 insertions(+), 15 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/11422/1
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
index 5dec748..355e961 100644
--- a/vdsm/storage/blockVolume.py
+++ b/vdsm/storage/blockVolume.py
@@ -335,12 +335,7 @@
@classmethod
def shareVolumeRollback(cls, taskObj, volPath):
cls.log.info("Volume rollback for volPath=%s", volPath)
-
- try:
- fileUtils.safeUnlink(volPath)
-
- except Exception:
- cls.log.error("Unexpected error", exc_info=True)
+ fileUtils.safeUnlink(volPath)
@deprecated # valid only for domain version < 3, see volume.setrw
def _setrw(self, rw):
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index d1c465b..e42fbad 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -260,15 +260,10 @@
@classmethod
def shareVolumeRollback(cls, taskObj, volPath):
cls.log.info("Volume rollback for volPath=%s", volPath)
-
- try:
- procPool = oop.getProcessPool(getDomUuidFromVolumePath(volPath))
- procPool.fileUtils.safeUnlink(volPath)
- procPool.fileUtils.safeUnlink(cls.__metaVolumePath(volPath))
- procPool.fileUtils.safeUnlink(cls.__leaseVolumePath(volPath))
-
- except Exception:
- cls.log.error("Unexpected error", exc_info=True)
+ procPool = oop.getProcessPool(getDomUuidFromVolumePath(volPath))
+ procPool.fileUtils.safeUnlink(volPath)
+ procPool.fileUtils.safeUnlink(cls.__metaVolumePath(volPath))
+ procPool.fileUtils.safeUnlink(cls.__leaseVolumePath(volPath))
@deprecated # valid only for domain version < 3, see volume.setrw
def _setrw(self, rw):
--
To view, visit http://gerrit.ovirt.org/11422
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f01ff2d30ffecc05b9cfd4978f79003a8032270
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
11 years
Change in vdsm[master]: getAllVolumes returns partially deleted volumes too.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: getAllVolumes returns partially deleted volumes too.
......................................................................
getAllVolumes returns partially deleted volumes too.
getAllVolumesImages differentiates between legal and remnants.
Added getAllRemnants for garbage detection.
Related to: BZ#905938, BZ#910013, BZ#875708
Change-Id: Ib8514236a5d4793f66709e9daf546fb46047414f
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/blockSD.py
1 file changed, 33 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/12546/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 35282e5..4a00cec 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -171,11 +171,15 @@
res[volName]['parent'] = parentVol
if vImg not in res[volName]['imgs']:
res[volName]['imgs'].insert(0, vImg)
- if (parentVol != sd.BLANK_UUID and
- not volName.startswith(
- sd.REMOVED_IMAGE_PREFIX) and
- vImg not in res[parentVol]['imgs']):
- res[parentVol]['imgs'].append(vImg)
+ if parentVol != sd.BLANK_UUID:
+ try:
+ newImg = vImg not in res[parentVol]['imgs']
+ except KeyError:
+ log.warning("Orphan volume %s/%s: img: %s, parent %s",
+ sdUUID, volName, vImg, parentVol)
+ else:
+ if newImg:
+ res[parentVol]['imgs'].append(vImg)
return dict((k, sd.ImgsPar(tuple(v['imgs']), v['parent']))
for k, v in res.iteritems())
@@ -1003,15 +1007,34 @@
zeroImgVolumes(sdUUID, imgUUID, toZero)
self.rmDCImgDir(imgUUID, volsImgs)
- def getAllVolumes(self):
+ def getAllVolumesImages(self):
"""
Return all the images that depend on a volume.
- TODO: rename to getAllVolumeImages.
-
- Return dict {volUUID: ([imgUUID1, imgUUID2], parentUUID)]}.
+ Return dicts:
+ vols = {volUUID: ([imgUUID1, imgUUID2], parentUUID)]}
+ for complete images.
+ remnants (same) for broken imgs, orphan volumes, etc.
"""
- return getAllVolumes(self.sdUUID)
+ vols = {} # The "legal" volumes: not half deleted/removed volumes.
+ remnants = {} # vols belongs to a partially deleted imgs
+ allVols = getAllVolumes(self.sdUUID)
+ for volName, ip in allVols.iteritems():
+ images, parent = ip
+ if (volName.startswith(sd.REMOVED_IMAGE_PREFIX) or
+ ip.imgs[0].startswith(sd.REMOVED_IMAGE_PREFIX)):
+ remnants[volName] = ip
+ else:
+ vols[volName] = ip
+ return vols, remnants
+
+ def getAllVolumes(self):
+ vols, rems = self.getAllVolumesImages()
+ return vols
+
+ def getAllRemnants(self):
+ vols, rems = self.getAllVolumesImages()
+ return rems
def activateVolumes(self, volUUIDs):
"""
--
To view, visit http://gerrit.ovirt.org/12546
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8514236a5d4793f66709e9daf546fb46047414f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
11 years