devstack/lib/cinder_backends/nfs
Rajat Dhasmana aa47cb34ae Add config options for cinder nfs backend
Currently the cinder nfs backend leaves out few options in a
multi backend deployment. It works in single nfs backend deployment
as devstack-plugin-nfs correctly configures all options[1].
We can clearly see the difference between what devstack-plugin-nfs
configures[1] and what devstack nfs configures[2].

Following options are missing which are added by this patch.
* nas_host
* nas_share_path
* nas_secure_file_operations
* nas_secure_file_permissions
* nfs_snapshot_support

[1] dd12367f90/devstack/plugin.sh (L60-L68)
[2] a52041cd3f/lib/cinder_backends/nfs (L32-L34)

Change-Id: I03cad66abb3c6f2ae1d5cf943ac952a30961f783
2022-12-27 06:16:55 +00:00

55 lines
1.4 KiB
Bash

#!/bin/bash
#
# lib/cinder_backends/nfs
# Configure the nfs backend
# Enable with:
#
# CINDER_ENABLED_BACKENDS+=,nfs:<volume-type-name>
# Dependencies:
#
# - ``functions`` file
# - ``cinder`` configurations
# CINDER_CONF
# CINDER_CONF_DIR
# CINDER_NFS_SERVERPATH - contents of nfs shares config file
# configure_cinder_backend_nfs - Configure Cinder for NFS backends
# Save trace setting
_XTRACE_CINDER_NFS=$(set +o | grep xtrace)
set +o xtrace
# Entry Points
# ------------
# configure_cinder_backend_nfs - Set config files, create data dirs, etc
function configure_cinder_backend_nfs {
local be_name=$1
iniset $CINDER_CONF $be_name volume_backend_name $be_name
iniset $CINDER_CONF $be_name volume_driver "cinder.volume.drivers.nfs.NfsDriver"
iniset $CINDER_CONF $be_name nfs_shares_config "$CINDER_CONF_DIR/nfs-shares-$be_name.conf"
iniset $CINDER_CONF $be_name nas_host localhost
iniset $CINDER_CONF $be_name nas_share_path ${NFS_EXPORT_DIR}
iniset $CINDER_CONF $be_name nas_secure_file_operations \
${NFS_SECURE_FILE_OPERATIONS}
iniset $CINDER_CONF $be_name nas_secure_file_permissions \
${NFS_SECURE_FILE_PERMISSIONS}
# NFS snapshot support is currently opt-in only.
iniset $CINDER_CONF $be_name nfs_snapshot_support True
echo "$CINDER_NFS_SERVERPATH" | tee "$CINDER_CONF_DIR/nfs-shares-$be_name.conf"
}
# Restore xtrace
$_XTRACE_CINDER_NFS
# Local variables:
# mode: shell-script
# End: