From e302cefafc18754a4495ad061062732b97d326ea Mon Sep 17 00:00:00 2001 From: John Griffith Date: Thu, 22 Jan 2015 11:22:25 -0700 Subject: [PATCH] Add retry to lvm snapshot create We have some occasional issues with snapshot-create failing for what looks to be conflicts with udev. It looks like this problem is a status conflict between LVM cache and udev, and in most cases the best way to get around this is to retry the command a few times until the cache and udev are back in sync. This patch uses the newly added retry decorator and for now we're just adding it to the snapshot create call. We're using the default values for interval and retry count but we can certainly adjust this as needed. Change-Id: Ic884b829591361da979fde968f5710237b34565f Closes-Bug: #1335905 --- cinder/brick/local_dev/lvm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cinder/brick/local_dev/lvm.py b/cinder/brick/local_dev/lvm.py index 9776ddf2e31..59ab1313b77 100644 --- a/cinder/brick/local_dev/lvm.py +++ b/cinder/brick/local_dev/lvm.py @@ -29,6 +29,7 @@ from cinder.brick import exception from cinder.brick import executor from cinder.i18n import _, _LE, _LI, _LW from cinder.openstack.common import log as logging +from cinder import utils LOG = logging.getLogger(__name__) @@ -509,6 +510,7 @@ class LVM(executor.Executor): LOG.error(_LE('StdErr :%s') % err.stderr) raise + @utils.retry(putils.ProcessExecutionError) def create_lv_snapshot(self, name, source_lv_name, lv_type='default'): """Creates a snapshot of a logical volume.