summaryrefslogtreecommitdiffstats
path: root/meta-openstack
diff options
context:
space:
mode:
authorVu Tran <vu.tran@windriver.com>2014-02-28 09:11:12 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-03-17 14:24:31 -0400
commit2c14cdfb9c34c541a1b3a180ad2a625514300977 (patch)
treec4ff7eed6df633a503b9a1c5a7884ca85f3c4534 /meta-openstack
parentb7527a3c0b5ab0849a0c669cb345c6494628da8f (diff)
downloadmeta-cloud-services-2c14cdfb9c34c541a1b3a180ad2a625514300977.tar.gz
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 <vu.tran@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack')
-rw-r--r--meta-openstack/README.setup12
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder/cinder.conf6
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder/glusterfs_setup.sh10
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder_git.bb12
-rw-r--r--meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-compute.bb3
-rw-r--r--meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-controller.bb6
6 files changed, 46 insertions, 3 deletions
diff --git a/meta-openstack/README.setup b/meta-openstack/README.setup
index 8ad892e..0657c9d 100644
--- a/meta-openstack/README.setup
+++ b/meta-openstack/README.setup
@@ -78,6 +78,7 @@ to the bblayers.conf file:
78 /meta-cloud-services/meta-openstack \ 78 /meta-cloud-services/meta-openstack \
79 /meta-openembedded/meta-oe \ 79 /meta-openembedded/meta-oe \
80 /meta-openembedded/meta-networking \ 80 /meta-openembedded/meta-networking \
81 /meta-openembedded/meta-filesystems
81 82
82Package configurations 83Package configurations
83---------------------- 84----------------------
@@ -109,7 +110,12 @@ On compute node, by default openstack-image-compute doesn't include
109initiator iscsi package. If open-iscsi-user recipe exists in layers, 110initiator iscsi package. If open-iscsi-user recipe exists in layers,
110the following can be added to local.conf: 111the following can be added to local.conf:
111 112
112 CINDER_EXTRA_FEATURES += "open-iscsi-user" 113 CINDER_EXTRA_FEATURES += " open-iscsi-user"
114
115If glusterfs recipi exists in layers, the following can be added to
116local.conf:
117
118 CINDER_EXTRA_FEATURES += " glusterfs"
113 119
114Running an image 120Running an image
115---------------- 121----------------
@@ -154,7 +160,7 @@ following steps will validate a simple compute node guest launch:
154 160
155* Cinder Multi-backend * 161* Cinder Multi-backend *
156 162
157Cinder currently is configured to support multi-backend: lvm-iscsi and nfs backends. 163Cinder currently is configured to support multi-backend: lvm-iscsi, nfs, glusterfs backends.
158When a Cinder volume is created, it's needed to be specified which backend its belong 164When a Cinder volume is created, it's needed to be specified which backend its belong
159to through "--volume_type" option passed in "cinder create" command. 165to through "--volume_type" option passed in "cinder create" command.
160 166
@@ -165,6 +171,8 @@ The Cinder volume types for lvm-iscsi and nfs can be created as following steps:
165 % cinder type-key lvm_iscsi set volume_backend_name=LVM_iSCSI 171 % cinder type-key lvm_iscsi set volume_backend_name=LVM_iSCSI
166 % cinder type-create nfs 172 % cinder type-create nfs
167 % cinder type-key nfs set volume_backend_name=Generic_NFS 173 % cinder type-key nfs set volume_backend_name=Generic_NFS
174 % cinder type-create glusterfs
175 % cinder type-key glusterfs set volume_backend_name=GlusterFS
168 176
169For example, to create 1G Cinder volume in lvm-iscsi backend: 177For example, to create 1G Cinder volume in lvm-iscsi backend:
170 178
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
1173 1173
1174# Define the names of the groups for multiple volume backends 1174# Define the names of the groups for multiple volume backends
1175#enabled_backends=fakedriver,lvmdriver 1175#enabled_backends=fakedriver,lvmdriver
1176enabled_backends=lvmdriver,nfsdriver 1176enabled_backends=lvmdriver,nfsdriver,glusterfsdriver
1177 1177
1178# Define the groups as above 1178# Define the groups as above
1179#[fakedriver] 1179#[fakedriver]
@@ -1189,4 +1189,8 @@ volume_group=nfs-group-1
1189volume_driver=cinder.volume.drivers.nfs.NfsDriver 1189volume_driver=cinder.volume.drivers.nfs.NfsDriver
1190volume_backend_name=Generic_NFS 1190volume_backend_name=Generic_NFS
1191 1191
1192[glusterfsdriver]
1193volume_group=glusterfs-group-1
1194volume_driver=cinder.volume.drivers.glusterfs.GlusterfsDriver
1195volume_backend_name=GlusterFS
1192# Total option count: 255 1196# 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 @@
1#! /bin/bash
2
3# Default setup
4if [ "$1" == "1" ]; then
5 mkdir /etc/cinder/glusterfs_volumes
6 /etc/init.d/glusterd start
7 gluster volume create glusterfs_volumes controller:/etc/cinder/glusterfs_volumes force
8 gluster volume start glusterfs_volumes force
9 /etc/init.d/glusterd stop
10fi
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 \
13 file://cinder-volume \ 13 file://cinder-volume \
14 file://0001-run_tests-respect-tools-dir.patch \ 14 file://0001-run_tests-respect-tools-dir.patch \
15 file://nfs_setup.sh \ 15 file://nfs_setup.sh \
16 file://glusterfs_setup.sh \
16 " 17 "
17 18
18SRCREV="8b5fb8409322f61d8b610c97c109a61bf48a940e" 19SRCREV="8b5fb8409322f61d8b610c97c109a61bf48a940e"
@@ -41,6 +42,7 @@ do_install_append() {
41 42
42 install -d ${CINDER_CONF_DIR}/drivers 43 install -d ${CINDER_CONF_DIR}/drivers
43 install -m 600 ${WORKDIR}/nfs_setup.sh ${CINDER_CONF_DIR}/drivers/ 44 install -m 600 ${WORKDIR}/nfs_setup.sh ${CINDER_CONF_DIR}/drivers/
45 install -m 600 ${WORKDIR}/glusterfs_setup.sh ${CINDER_CONF_DIR}/drivers/
44 46
45 install -d ${D}${localstatedir}/log/${SRCNAME} 47 install -d ${D}${localstatedir}/log/${SRCNAME}
46 48
@@ -61,6 +63,8 @@ do_install_append() {
61CINDER_LVM_VOLUME_BACKING_FILE_SIZE ?= "2G" 63CINDER_LVM_VOLUME_BACKING_FILE_SIZE ?= "2G"
62CINDER_NFS_VOLUME_SERVERS_DEFAULT = "controller:/etc/cinder/nfs_volumes" 64CINDER_NFS_VOLUME_SERVERS_DEFAULT = "controller:/etc/cinder/nfs_volumes"
63CINDER_NFS_VOLUME_SERVERS ?= "${CINDER_NFS_VOLUME_SERVERS_DEFAULT}" 65CINDER_NFS_VOLUME_SERVERS ?= "${CINDER_NFS_VOLUME_SERVERS_DEFAULT}"
66CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT = "controller:/glusterfs_volumes"
67CINDER_GLUSTERFS_VOLUME_SERVERS ?= "${CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT}"
64 68
65pkg_postinst_${SRCNAME}-setup () { 69pkg_postinst_${SRCNAME}-setup () {
66 if [ "x$D" != "x" ]; then 70 if [ "x$D" != "x" ]; then
@@ -87,6 +91,14 @@ pkg_postinst_${SRCNAME}-setup () {
87 [[ "x${CINDER_NFS_VOLUME_SERVERS}" == "x${CINDER_NFS_VOLUME_SERVERS_DEFAULT}" ]] && is_default="1" || is_default="0" 91 [[ "x${CINDER_NFS_VOLUME_SERVERS}" == "x${CINDER_NFS_VOLUME_SERVERS_DEFAULT}" ]] && is_default="1" || is_default="0"
88 /bin/bash /etc/cinder/drivers/nfs_setup.sh ${is_default} 92 /bin/bash /etc/cinder/drivers/nfs_setup.sh ${is_default}
89 fi 93 fi
94
95 # Create Cinder glusterfs_share config file with default glusterfs server
96 if [ ! -f /etc/cinder/glusterfs_shares ] && [ -f /usr/sbin/glusterfsd ]; then
97 echo "${CINDER_GLUSTERFS_VOLUME_SERVERS}" > /etc/cinder/glusterfs_shares
98 sed 's/\s\+/\n/g' -i /etc/cinder/glusterfs_shares
99 [[ "x${CINDER_GLUSTERFS_VOLUME_SERVERS}" == "x${CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT}" ]] && is_default="1" || is_default="0"
100 /bin/bash /etc/cinder/drivers/glusterfs_setup.sh ${is_default}
101 fi
90} 102}
91 103
92PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler" 104PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler"
diff --git a/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-compute.bb b/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-compute.bb
index 3787c3b..e2d56ba 100644
--- a/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-compute.bb
+++ b/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-compute.bb
@@ -22,6 +22,8 @@ RDEPENDS_${PN} = " \
22 ${@base_contains('CINDER_EXTRA_FEATURES', 'open-iscsi-user', 'open-iscsi-user', '', d)} \ 22 ${@base_contains('CINDER_EXTRA_FEATURES', 'open-iscsi-user', 'open-iscsi-user', '', d)} \
23 ${@base_contains('CINDER_EXTRA_FEATURES', 'iscsi-initiator-utils', 'iscsi-initiator-utils', '', d)} \ 23 ${@base_contains('CINDER_EXTRA_FEATURES', 'iscsi-initiator-utils', 'iscsi-initiator-utils', '', d)} \
24 nfs-utils-client \ 24 nfs-utils-client \
25 fuse \
26 ${@base_contains('CINDER_EXTRA_FEATURES', 'glusterfs', 'glusterfs glusterfs-fuse', '', d)} \
25 " 27 "
26 28
27RRECOMMENDS_${PN} = " \ 29RRECOMMENDS_${PN} = " \
@@ -33,4 +35,5 @@ RRECOMMENDS_${PN} = " \
33 kernel-module-iscsi-boot-sysfs \ 35 kernel-module-iscsi-boot-sysfs \
34 kernel-module-iscsi-tcp \ 36 kernel-module-iscsi-tcp \
35 kernel-module-libiscsi \ 37 kernel-module-libiscsi \
38 kernel-module-fuse \
36 " 39 "
diff --git a/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-controller.bb b/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-controller.bb
index 6b8ae28..40c1ece 100644
--- a/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-controller.bb
+++ b/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-controller.bb
@@ -43,5 +43,11 @@ RDEPENDS_${PN} = " postgresql-setup \
43 novnc \ 43 novnc \
44 chkconfig \ 44 chkconfig \
45 qemu \ 45 qemu \
46 fuse \
47 ${@base_contains('CINDER_EXTRA_FEATURES', 'glusterfs', 'glusterfs glusterfs-fuse glusterfs-server', '', d)} \
48 "
49
50RRECOMMENDS_${PN} = " \
51 kernel-module-fuse \
46 cloud-init \ 52 cloud-init \
47 " 53 "