From 2c14cdfb9c34c541a1b3a180ad2a625514300977 Mon Sep 17 00:00:00 2001 From: Vu Tran Date: Fri, 28 Feb 2014 09:11:12 -0500 Subject: cinder: enable glusterfs backend This patch adds glusterfs backend into multi-backend cinder support (total of lvm-iscsi, nfs, and glusterfs). This including changing cinder.conf, creating missing glusterfs_shares config file, and adding glusterfs-client into compute/controller node and gluster-server into controller node. Also meta-filesystems is included to pickup fuse filesytem which is needed by glusterfs. Signed-off-by: Vu Tran Signed-off-by: Bruce Ashfield --- .../recipes-devtools/python/python-cinder/cinder.conf | 6 +++++- .../recipes-devtools/python/python-cinder/glusterfs_setup.sh | 10 ++++++++++ meta-openstack/recipes-devtools/python/python-cinder_git.bb | 12 ++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 meta-openstack/recipes-devtools/python/python-cinder/glusterfs_setup.sh (limited to 'meta-openstack/recipes-devtools/python') diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf b/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf index aa0eba5..6190ec5 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf +++ b/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf @@ -1173,7 +1173,7 @@ rabbit_port=5672 # Define the names of the groups for multiple volume backends #enabled_backends=fakedriver,lvmdriver -enabled_backends=lvmdriver,nfsdriver +enabled_backends=lvmdriver,nfsdriver,glusterfsdriver # Define the groups as above #[fakedriver] @@ -1189,4 +1189,8 @@ volume_group=nfs-group-1 volume_driver=cinder.volume.drivers.nfs.NfsDriver volume_backend_name=Generic_NFS +[glusterfsdriver] +volume_group=glusterfs-group-1 +volume_driver=cinder.volume.drivers.glusterfs.GlusterfsDriver +volume_backend_name=GlusterFS # Total option count: 255 diff --git a/meta-openstack/recipes-devtools/python/python-cinder/glusterfs_setup.sh b/meta-openstack/recipes-devtools/python/python-cinder/glusterfs_setup.sh new file mode 100644 index 0000000..30997d1 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-cinder/glusterfs_setup.sh @@ -0,0 +1,10 @@ +#! /bin/bash + +# Default setup +if [ "$1" == "1" ]; then + mkdir /etc/cinder/glusterfs_volumes + /etc/init.d/glusterd start + gluster volume create glusterfs_volumes controller:/etc/cinder/glusterfs_volumes force + gluster volume start glusterfs_volumes force + /etc/init.d/glusterd stop +fi diff --git a/meta-openstack/recipes-devtools/python/python-cinder_git.bb b/meta-openstack/recipes-devtools/python/python-cinder_git.bb index e9cc27d..6fb27f8 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder_git.bb +++ b/meta-openstack/recipes-devtools/python/python-cinder_git.bb @@ -13,6 +13,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ file://cinder-volume \ file://0001-run_tests-respect-tools-dir.patch \ file://nfs_setup.sh \ + file://glusterfs_setup.sh \ " SRCREV="8b5fb8409322f61d8b610c97c109a61bf48a940e" @@ -41,6 +42,7 @@ do_install_append() { install -d ${CINDER_CONF_DIR}/drivers install -m 600 ${WORKDIR}/nfs_setup.sh ${CINDER_CONF_DIR}/drivers/ + install -m 600 ${WORKDIR}/glusterfs_setup.sh ${CINDER_CONF_DIR}/drivers/ install -d ${D}${localstatedir}/log/${SRCNAME} @@ -61,6 +63,8 @@ do_install_append() { CINDER_LVM_VOLUME_BACKING_FILE_SIZE ?= "2G" CINDER_NFS_VOLUME_SERVERS_DEFAULT = "controller:/etc/cinder/nfs_volumes" CINDER_NFS_VOLUME_SERVERS ?= "${CINDER_NFS_VOLUME_SERVERS_DEFAULT}" +CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT = "controller:/glusterfs_volumes" +CINDER_GLUSTERFS_VOLUME_SERVERS ?= "${CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT}" pkg_postinst_${SRCNAME}-setup () { if [ "x$D" != "x" ]; then @@ -87,6 +91,14 @@ pkg_postinst_${SRCNAME}-setup () { [[ "x${CINDER_NFS_VOLUME_SERVERS}" == "x${CINDER_NFS_VOLUME_SERVERS_DEFAULT}" ]] && is_default="1" || is_default="0" /bin/bash /etc/cinder/drivers/nfs_setup.sh ${is_default} fi + + # Create Cinder glusterfs_share config file with default glusterfs server + if [ ! -f /etc/cinder/glusterfs_shares ] && [ -f /usr/sbin/glusterfsd ]; then + echo "${CINDER_GLUSTERFS_VOLUME_SERVERS}" > /etc/cinder/glusterfs_shares + sed 's/\s\+/\n/g' -i /etc/cinder/glusterfs_shares + [[ "x${CINDER_GLUSTERFS_VOLUME_SERVERS}" == "x${CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT}" ]] && is_default="1" || is_default="0" + /bin/bash /etc/cinder/drivers/glusterfs_setup.sh ${is_default} + fi } PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler" -- cgit v1.2.3-54-g00ecf