From bfa681204f59bf5ea4700dc21f8f29fb1a4a4fdd Mon Sep 17 00:00:00 2001 From: Joel Friedly Date: Thu, 16 Jan 2014 17:19:26 -0800 Subject: [PATCH] Use a mirrored mirror log By default, LVM will sync the two mirrors of a logical volume on creation. This is I/O intensive and it takes a long time though, so we tell it not to with --nosync. The next default behavior is to create a mirror log which says what portions of the mirrors are in sync. But then if a disk backing a mirror log fails, we have to deal with resyncing the mirrors at each reboot. This commit tells LVM to use a mirrored mirror log, which will use approximately 4MB of extra space, but means we'll never have to sync mirrors, ever. Change-Id: I6586ced4e7e66ae79ae134406a4c633f8fbc8602 --- cinder/brick/local_dev/lvm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cinder/brick/local_dev/lvm.py b/cinder/brick/local_dev/lvm.py index 0037632b2..17602e998 100644 --- a/cinder/brick/local_dev/lvm.py +++ b/cinder/brick/local_dev/lvm.py @@ -472,7 +472,8 @@ class LVM(executor.Executor): cmd = ['lvcreate', '-n', name, self.vg_name, '-L', size_str] if mirror_count > 0: - cmd.extend(['-m', mirror_count, '--nosync']) + cmd.extend(['-m', mirror_count, '--nosync', + '--mirrorlog mirrored']) terras = int(size_str[:-1]) / 1024.0 if terras >= 1.5: rsize = int(2 ** math.ceil(math.log(terras) / math.log(2))) -- 2.45.2