From: Joel Friedly Date: Fri, 17 Jan 2014 01:19:26 +0000 (-0800) Subject: Use a mirrored mirror log X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=bfa681204f59bf5ea4700dc21f8f29fb1a4a4fdd;p=openstack-build%2Fcinder-build.git 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 --- 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)))