Browse code

Add support for GlusterFS Cinder driver

The GlusterFS volume driver can be used with Cinder by setting the
following in localrc:

CINDER_DRIVER=glusterfs
CINDER_GLUSTERFS_SHARES="127.0.0.1:/vol1;127.0.0.1:/vol2"

Shares are <host>:<volume> and separated by semicolons.

Change-Id: Iaa105233c9fce8d8fda0a9ea447e045b8d010db7

Eric Harney authored on 2013/04/11 01:48:09
Showing 1 changed files
... ...
@@ -234,6 +234,19 @@ function configure_cinder() {
234 234
         )
235 235
     elif [ "$CINDER_DRIVER" == "sheepdog" ]; then
236 236
         iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.sheepdog.SheepdogDriver"
237
+    elif [ "$CINDER_DRIVER" == "glusterfs" ]; then
238
+        # To use glusterfs, set the following in localrc:
239
+        # CINDER_DRIVER=glusterfs
240
+        # CINDER_GLUSTERFS_SHARES="127.0.0.1:/vol1;127.0.0.1:/vol2"
241
+        # Shares are <host>:<volume> and separated by semicolons.
242
+
243
+        iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.glusterfs.GlusterfsDriver"
244
+        iniset $CINDER_CONF DEFAULT glusterfs_shares_config "$CINDER_CONF_DIR/glusterfs_shares"
245
+        touch $CINDER_CONF_DIR/glusterfs_shares
246
+        if [ ! -z "$CINDER_GLUSTERFS_SHARES" ]; then
247
+            CINDER_GLUSTERFS_SHARES=$(echo $CINDER_GLUSTERFS_SHARES | tr ";" "\n")
248
+            echo "$CINDER_GLUSTERFS_SHARES" > $CINDER_CONF_DIR/glusterfs_shares
249
+        fi
237 250
     fi
238 251
 }
239 252