Update LVM autoextend config for RHEL6
Cinder clones are slightly larger due to some extra metadata. RHEL6
will not allow auto-extending of LV's without this, leading to clones
giving hard-to-track disk I/O errors.
See https://bugzilla.redhat.com/show_bug.cgi?id=975052
Change-Id: I09a5e061a9665c5310383f9f9eb281bfdc8e416d
diff --git a/lib/cinder b/lib/cinder
index c572db4..f691b38 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -276,6 +276,19 @@
echo "$CINDER_GLUSTERFS_SHARES" > $CINDER_CONF_DIR/glusterfs_shares
fi
fi
+
+ if [[ is_fedora && $DISTRO =~ (rhel6) ]]; then
+ # Cinder clones are slightly larger due to some extra
+ # metadata. RHEL6 will not allow auto-extending of LV's
+ # without this, leading to clones giving hard-to-track disk
+ # I/O errors.
+ # see https://bugzilla.redhat.com/show_bug.cgi?id=975052
+ sudo sed -i~ \
+ -e 's/snapshot_autoextend_threshold =.*/snapshot_autoextend_threshold = 80/' \
+ -e 's/snapshot_autoextend_percent =.*/snapshot_autoextend_percent = 20/' \
+ /etc/lvm/lvm.conf
+ fi
+
}
# create_cinder_accounts() - Set up common required cinder accounts