blob: 329dd6c64920f8a489c0661da93112dbbb30fb35 [file] [log] [blame]
Sean Daguee263c822014-12-05 14:25:28 -05001#!/bin/bash
2#
john-griffithd0860cc2014-01-23 11:31:10 -07003# lib/cinder_plugins/glusterfs
4# Configure the glusterfs driver
5
6# Enable with:
7#
8# CINDER_DRIVER=glusterfs
9
10# Dependencies:
11#
12# - ``functions`` file
13# - ``cinder`` configurations
14
15# configure_cinder_driver - make configuration changes, including those to other services
16
17# Save trace setting
Ian Wienand523f4882015-10-13 11:03:03 +110018_XTRACE_CINDER_GLUSTERFS=$(set +o | grep xtrace)
john-griffithd0860cc2014-01-23 11:31:10 -070019set +o xtrace
20
21
22# Defaults
23# --------
24
25# Set up default directories
26
27
28# Entry Points
29# ------------
30
31# configure_cinder_driver - Set config files, create data dirs, etc
Ian Wienandaee18c72014-02-21 15:35:08 +110032function configure_cinder_driver {
john-griffithd0860cc2014-01-23 11:31:10 -070033 # To use glusterfs, set the following in localrc:
34 # CINDER_DRIVER=glusterfs
35 # CINDER_GLUSTERFS_SHARES="127.0.0.1:/vol1;127.0.0.1:/vol2"
36 # Shares are <host>:<volume> and separated by semicolons.
37
38 iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.glusterfs.GlusterfsDriver"
39 iniset $CINDER_CONF DEFAULT glusterfs_shares_config "$CINDER_CONF_DIR/glusterfs_shares"
40 touch $CINDER_CONF_DIR/glusterfs_shares
41 if [ ! -z "$CINDER_GLUSTERFS_SHARES" ]; then
42 CINDER_GLUSTERFS_SHARES=$(echo $CINDER_GLUSTERFS_SHARES | tr ";" "\n")
43 echo "$CINDER_GLUSTERFS_SHARES" > $CINDER_CONF_DIR/glusterfs_shares
44 fi
45}
46
47# Restore xtrace
Ian Wienand523f4882015-10-13 11:03:03 +110048$_XTRACE_CINDER_GLUSTERFS
john-griffithd0860cc2014-01-23 11:31:10 -070049
50# Local variables:
51# mode: shell-script
52# End: