blob: f3fcbeff192640c34daa8ec57aea6b02d8b24dc0 [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
Ian Wienand523f4882015-10-13 11:03:03 +110022_XTRACE_CINDER_NFS=$(set +o | grep xtrace)
Dean Troyer09718332014-07-03 10:46:57 -050023set +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"
Rajat Dhasmanaaa47cb32022-12-27 06:11:07 +000035 iniset $CINDER_CONF $be_name nas_host localhost
36 iniset $CINDER_CONF $be_name nas_share_path ${NFS_EXPORT_DIR}
37 iniset $CINDER_CONF $be_name nas_secure_file_operations \
38 ${NFS_SECURE_FILE_OPERATIONS}
39 iniset $CINDER_CONF $be_name nas_secure_file_permissions \
40 ${NFS_SECURE_FILE_PERMISSIONS}
41
42 # NFS snapshot support is currently opt-in only.
43 iniset $CINDER_CONF $be_name nfs_snapshot_support True
Dean Troyer09718332014-07-03 10:46:57 -050044
45 echo "$CINDER_NFS_SERVERPATH" | tee "$CINDER_CONF_DIR/nfs-shares-$be_name.conf"
46}
47
48
49# Restore xtrace
Ian Wienand523f4882015-10-13 11:03:03 +110050$_XTRACE_CINDER_NFS
Dean Troyer09718332014-07-03 10:46:57 -050051
52# Local variables:
53# mode: shell-script
54# End: