
This is needed to ensure: "enable_plugin devstack-plugin-glusterfs <source> [<ref>]" is placed after "enable_plugin manila <source> [<ref>]" in local.conf files where applicable. This was mis-named in the previous attempt. Change-Id: I2fa1a61400cd14f8a3c5c2f6b4b6d7bcd82d5f1a
139 lines
5.8 KiB
Plaintext
139 lines
5.8 KiB
Plaintext
# Devstack settings
|
|
|
|
# Defaults
|
|
# --------
|
|
|
|
define_plugin devstack-plugin-glusterfs
|
|
# line below lets scripts place manila plugin before glusterfs in local.conf
|
|
plugin_requires devstack-plugin-glusterfs manila
|
|
|
|
######### Plugin Specific #########
|
|
|
|
# GLUSTERFS_PLUGIN_DIR contains the path to devstack-plugin-glusterfs/devstack directory
|
|
GLUSTERFS_PLUGIN_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]}))
|
|
|
|
# Set ``GLUSTERFS_DATA_DIR`` to the location of GlusterFS drives.
|
|
# Default is /var/lib/glusterfs.
|
|
GLUSTERFS_DATA_DIR=${GLUSTERFS_DATA_DIR:-/var/lib/glusterfs}
|
|
GLUSTERFS_DISK_IMAGE=${DATA_DIR}/glusterfs.img
|
|
|
|
# DevStack will create a loop-back disk formatted as XFS to store the
|
|
# GlusterFS data. Set ``GLUSTERFS_LOOPBACK_DISK_SIZE`` to the disk size in GB.
|
|
# Default is 8 gigabyte. But we can configure through localrc.
|
|
GLUSTERFS_LOOPBACK_DISK_SIZE=${GLUSTERFS_LOOPBACK_DISK_SIZE:-8G}
|
|
|
|
|
|
# GlusterFS repo for CentOS/RHEL 7 platform
|
|
if [[ ${DISTRO} =~ rhel7 ]] && [[ ! -f /etc/yum.repos.d/glusterfs-epel.repo ]]; then
|
|
GLUSTERFS_CENTOS_REPO=${GLUSTERFS_CENTOS_REPO:-"http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo"}
|
|
fi
|
|
|
|
# Official Heketi 1.0.* binary
|
|
HEKETI_V1_PACKAGE="https://github.com/heketi/heketi/releases/download/1.0.2/heketi-1.0.2-release-1.0.0.linux.amd64.tar.gz"
|
|
|
|
TEMPEST_STORAGE_PROTOCOL=glusterfs
|
|
|
|
######### Glance Specific Configuration #########
|
|
|
|
# Set CONFIGURE_GLUSTERFS_GLANCE to true, to configure GlusterFS as a backend for Glance.
|
|
CONFIGURE_GLUSTERFS_GLANCE=${CONFIGURE_GLUSTERFS_GLANCE:-False}
|
|
|
|
if [ "$CONFIGURE_GLUSTERFS_GLANCE" == "True" ]; then
|
|
# Glance GlusterFS share
|
|
GLANCE_GLUSTERFS_SHARE=${GLANCE_GLUSTERFS_SHARE:-"127.0.0.1:/glance-vol"}
|
|
fi
|
|
|
|
######### Nova Specific Configuration #########
|
|
|
|
# Set CONFIGURE_GLUSTERFS_NOVA to true, to configure GlusterFS as a backend for Nova.
|
|
CONFIGURE_GLUSTERFS_NOVA=${CONFIGURE_GLUSTERFS_NOVA:-False}
|
|
|
|
if [ "$CONFIGURE_GLUSTERFS_NOVA" == "True" ]; then
|
|
# Glance Nova share
|
|
NOVA_GLUSTERFS_SHARE=${NOVA_GLUSTERFS_SHARE:-"127.0.0.1:/nova-vol"}
|
|
fi
|
|
|
|
######### Cinder Specific Configuration #########
|
|
|
|
# Set CONFIGURE_GLUSTERFS_CINDER to true, to enable GlusterFS as a backend for Cinder.
|
|
CONFIGURE_GLUSTERFS_CINDER=${CONFIGURE_GLUSTERFS_CINDER:-False}
|
|
|
|
if [ "$CONFIGURE_GLUSTERFS_CINDER" == "True" ]; then
|
|
CINDER_ENABLED_BACKENDS=${CINDER_ENABLED_BACKENDS:-glusterfs:glusterfs,lvm:lvm1}
|
|
|
|
# Devstack will create GlusterFS shares to store Cinder volumes.
|
|
# Those shares can be configured by seting CINDER_GLUSTERFS_SHARES.
|
|
# By default CINDER_GLUSTERFS_SHARES="127.0.0.1:/vol1"
|
|
CINDER_GLUSTERFS_SHARES=${CINDER_GLUSTERFS_SHARES:-"127.0.0.1:/cinder-vol1;127.0.0.1:/cinder-vol2"}
|
|
|
|
# Set default volume prov type to thick as we don't yet support backup for thin (qcow2) files
|
|
GLUSTERFS_VOLUME_PROV_TYPE=${GLUSTERFS_VOLUME_PROV_TYPE:-thick}
|
|
|
|
# Cinder encrypted volume tests are not supported with a GlusterFS
|
|
# backend due to bug 1473363
|
|
ATTACH_ENCRYPTED_VOLUME_AVAILABLE=False
|
|
fi
|
|
|
|
######### Cinder Backup Specific Configuration #########
|
|
|
|
# Set CONFIGURE_GLUSTERFS_CINDER_BACKUP to true, to configure GlusterFS as a backup driver for Cinder.
|
|
CONFIGURE_GLUSTERFS_CINDER_BACKUP=${CONFIGURE_GLUSTERFS_CINDER_BACKUP:-$CONFIGURE_GLUSTERFS_CINDER}
|
|
|
|
if [ "$CONFIGURE_GLUSTERFS_CINDER_BACKUP" == "True" ]; then
|
|
# GlusterFS shares for Cinder backup
|
|
CINDER_GLUSTERFS_BACKUP_SHARE=${CINDER_GLUSTERFS_BACKUP_SHARE:-"127.0.0.1:/backup_vol"}
|
|
fi
|
|
|
|
######### Manila Specific Configuration #########
|
|
|
|
# Set CONFIGURE_GLUSTERFS_MANILA to true, to configure GlusterFS as a backend for Manila.
|
|
CONFIGURE_GLUSTERFS_MANILA=${CONFIGURE_GLUSTERFS_MANILA:-False}
|
|
|
|
if [ "$CONFIGURE_GLUSTERFS_MANILA" == "True" ]; then
|
|
# Set GLUSTERFS_MANILA_DRIVER_TYPE to one of 'glusterfs-{nfs{,-heketi},native}.
|
|
GLUSTERFS_MANILA_DRIVER_TYPE=${GLUSTERFS_MANILA_DRIVER_TYPE:-glusterfs}
|
|
|
|
# Set GLUSTERFS_VG_NAME to the name of volume group.
|
|
GLUSTERFS_VG_NAME=${GLUSTERFS_VG_NAME:-glusterfs-vg}
|
|
|
|
# Set GLUSTERFS_THIN_POOL_NAME to the name of thinpool.
|
|
GLUSTERFS_THIN_POOL_NAME=${GLUSTERFS_THIN_POOL_NAME:-glusterfs-thinpool}
|
|
fi
|
|
|
|
|
|
# Validation
|
|
# ----------
|
|
|
|
# Error out when devstack-plugin-glusterfs is enabled, but not selected as a
|
|
# backend for Cinder, Glance or Nova.
|
|
if [ "$CONFIGURE_GLUSTERFS_CINDER" == "False" ] && [ "$CONFIGURE_GLUSTERFS_GLANCE" == "False" ] && [ "$CONFIGURE_GLUSTERFS_NOVA" == "False" ] && [ "$CONFIGURE_GLUSTERFS_MANILA" == "False" ] && [ "$CONFIGURE_GLUSTERFS_CINDER_BACKUP" == "False" ]; then
|
|
echo "GlusterFS plugin enabled but not selected as a backend for Cinder, Glance, Nova or Manila."
|
|
echo "Please set CONFIGURE_GLUSTERFS_CINDER, CONFIGURE_GLUSTERFS_CINDER_BACKUP, CONFIGURE_GLUSTERFS_GLANCE, CONFIGURE_GLUSTERFS_NOVA and/or CONFIGURE_GLUSTERFS_MANILA to True in localrc."
|
|
exit 1
|
|
fi
|
|
|
|
# When CONFIGURE_GLUSTERFS_CINDER is true, CINDER_ENABLED_BACKENDS should have
|
|
# at least one backend of type 'glusterfs', error out otherwise.
|
|
local is_gluster_backend_configured=False
|
|
for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
|
|
if [ "${be%%:*}" == "glusterfs" ]; then
|
|
is_gluster_backend_configured=True
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [ "$CONFIGURE_GLUSTERFS_CINDER" == "True" ] && [ "$is_gluster_backend_configured" == "False" ]; then
|
|
echo "CONFIGURE_GLUSTERFS_CINDER is set to True, to configure GlusterFS as a backend for Cinder."
|
|
echo "But, glusterfs backend type not present in CINDER_ENABLED_BACKENDS."
|
|
echo "So please set one backend of type glusterfs to CINDER_ENABLED_BACKENDS."
|
|
exit 1
|
|
elif [ "$CONFIGURE_GLUSTERFS_CINDER" == "False" ] && [ "$is_gluster_backend_configured" == "True" ]; then
|
|
echo "Configured Glusterfs as backend type in CINDER_ENABLED_BACKENDS. But CONFIGURE_GLUSTERFS_CINDER set to False."
|
|
exit 1
|
|
fi
|
|
|
|
# Initializing gluster specific functions
|
|
# ---------------------------------------
|
|
|
|
source $GLUSTERFS_PLUGIN_DIR/gluster-functions.sh
|