blob: fc51b2b440609f97d17cebd51bf5e9f1d0ab09f8 [file] [log] [blame]
Sean Daguee263c822014-12-05 14:25:28 -05001#!/bin/bash
2#
Dean Troyer09718332014-07-03 10:46:57 -05003# lib/cinder_backends/nfs
4# Configure the nfs backend
5
6# Enable with:
7#
8# CINDER_ENABLED_BACKENDS+=,nfs:<volume-type-name>
9
10# Dependencies:
11#
12# - ``functions`` file
13# - ``cinder`` configurations
14
15# CINDER_CONF
16# CINDER_CONF_DIR
17# CINDER_NFS_SERVERPATH - contents of nfs shares config file
18
19# configure_cinder_backend_nfs - Configure Cinder for NFS backends
20
21# Save trace setting
22NFS_XTRACE=$(set +o | grep xtrace)
23set +o xtrace
24
25
26# Entry Points
27# ------------
28
29# configure_cinder_backend_nfs - Set config files, create data dirs, etc
30function configure_cinder_backend_nfs {
31 local be_name=$1
32 iniset $CINDER_CONF $be_name volume_backend_name $be_name
33 iniset $CINDER_CONF $be_name volume_driver "cinder.volume.drivers.nfs.NfsDriver"
34 iniset $CINDER_CONF $be_name nfs_shares_config "$CINDER_CONF_DIR/nfs-shares-$be_name.conf"
35
36 echo "$CINDER_NFS_SERVERPATH" | tee "$CINDER_CONF_DIR/nfs-shares-$be_name.conf"
37}
38
39
40# Restore xtrace
41$NFS_XTRACE
42
43# Local variables:
44# mode: shell-script
45# End: