summaryrefslogtreecommitdiff
path: root/devstack
diff options
context:
space:
mode:
authorRamana Raja <rraja@redhat.com>2017-11-19 15:24:46 +0530
committerTom Barron <tpb@dyncloud.net>2017-12-04 21:28:26 +0000
commit6ed64665cb9d98a4595774c4cceadd45358ad75f (patch)
tree52514e76baa183588557f573282f0c5578a0acea /devstack
parent9f1f729d6053b2f9fd92e3ff28aa6df3ec6678fe (diff)
[manila] allow cephfs-nfs driver to store ganesha exports
... and export counter in RADOS pool. Change-Id: I192a0aebdd7cad11c9aa2e8e6b3c4e814f55a12d
Notes
Notes (review): Code-Review+2: Tom Barron <tpb@dyncloud.net> Workflow+1: Tom Barron <tpb@dyncloud.net> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 04 Dec 2017 22:55:27 +0000 Reviewed-on: https://review.openstack.org/521358 Project: openstack/devstack-plugin-ceph Branch: refs/heads/master
Diffstat (limited to 'devstack')
-rw-r--r--devstack/lib/ceph32
-rw-r--r--devstack/settings6
2 files changed, 35 insertions, 3 deletions
diff --git a/devstack/lib/ceph b/devstack/lib/ceph
index 73405fe..b371a1b 100644
--- a/devstack/lib/ceph
+++ b/devstack/lib/ceph
@@ -92,6 +92,10 @@ CEPHFS_DATA_POOL=${CEPHFS_DATA_POOL:-cephfs_data}
92 92
93MANILA_CEPH_DRIVER=${MANILA_CEPH_DRIVER:-cephfsnative} 93MANILA_CEPH_DRIVER=${MANILA_CEPH_DRIVER:-cephfsnative}
94MANILA_CEPH_USER=${MANILA_CEPH_USER:-manila} 94MANILA_CEPH_USER=${MANILA_CEPH_USER:-manila}
95# Allows driver to store NFS-Ganesha exports and export counter as
96# RADOS objects in CephFS's data pool. This needs NFS-Ganesha v2.5.4 or later,
97# Ceph v12.2.2 or later, and OpenStack Queens or later.
98MANILA_CEPH_GANESHA_RADOS_STORE=${MANILA_CEPH_GANESHA_RADOS_STORE:-True}
95 99
96# Set ``CEPH_REPLICAS`` to configure how many replicas are to be 100# Set ``CEPH_REPLICAS`` to configure how many replicas are to be
97# configured for your Ceph cluster. By default we are configuring 101# configured for your Ceph cluster. By default we are configuring
@@ -715,7 +719,17 @@ EOF
715 sudo systemctl stop nfs-server 719 sudo systemctl stop nfs-server
716 sudo systemctl disable nfs-server 720 sudo systemctl disable nfs-server
717 sudo systemctl enable nfs-ganesha 721 sudo systemctl enable nfs-ganesha
718 sudo systemctl start nfs-ganesha 722 sudo systemctl start nfs-ganesha || (
723 echo "Ganesha didn't start. Let's debug..." >&2
724 sudo systemctl status nfs-ganesha || true
725 echo "**Ganesha conf file**" >&2
726 sudo cat /etc/ganesha/ganesha.conf || true
727 echo "**Ganesha log file**" >&2
728 sudo cat /var/log/ganesha/ganesha.log || true
729 echo "**Exiting**" >&2
730 exit 1
731 )
732 echo "Ganesha started successfully!" >&2
719 fi 733 fi
720 734
721# RESTART DOCKER CONTAINER 735# RESTART DOCKER CONTAINER
@@ -725,8 +739,20 @@ EOF
725function configure_nfs_ganesha { 739function configure_nfs_ganesha {
726 # Configure NFS-Ganesha to work with Manila's CephFS driver 740 # Configure NFS-Ganesha to work with Manila's CephFS driver
727 sudo mkdir -p /etc/ganesha/export.d 741 sudo mkdir -p /etc/ganesha/export.d
728 sudo touch /etc/ganesha/export.d/INDEX.conf 742 if [ $MANILA_CEPH_GANESHA_RADOS_STORE == 'True' ]; then
729 echo "%include /etc/ganesha/export.d/INDEX.conf" | sudo tee /etc/ganesha/ganesha.conf 743 # Create an empty placeholder ganesha export index object
744 echo | sudo rados -p ${CEPHFS_DATA_POOL} put ganesha-export-index -
745 cat <<EOF | sudo tee -a /etc/ganesha/ganesha.conf>/dev/null
746RADOS_URLS {
747 ceph_conf = ${CEPH_CONF_FILE};
748 userid = admin;
749}
750%url rados://${CEPHFS_DATA_POOL}/ganesha-export-index
751EOF
752 else
753 sudo touch /etc/ganesha/export.d/INDEX.conf
754 echo "%include /etc/ganesha/export.d/INDEX.conf" | sudo tee -a /etc/ganesha/ganesha.conf
755 fi
730} 756}
731 757
732function cleanup_nfs_ganesha { 758function cleanup_nfs_ganesha {
diff --git a/devstack/settings b/devstack/settings
index 74c71e3..9e8d7a1 100644
--- a/devstack/settings
+++ b/devstack/settings
@@ -57,5 +57,11 @@ if (is_ceph_enabled_for_service manila); then
57 MANILA_OPTGROUP_cephfsnfs1_cephfs_conf_path=${CEPH_CONF_FILE} 57 MANILA_OPTGROUP_cephfsnfs1_cephfs_conf_path=${CEPH_CONF_FILE}
58 MANILA_OPTGROUP_cephfsnfs1_cephfs_auth_id=${MANILA_CEPH_USER} 58 MANILA_OPTGROUP_cephfsnfs1_cephfs_auth_id=${MANILA_CEPH_USER}
59 MANILA_OPTGROUP_cephfsnfs1_cephfs_protocol_helper_type=NFS 59 MANILA_OPTGROUP_cephfsnfs1_cephfs_protocol_helper_type=NFS
60
61 MANILA_OPTGROUP_cephfsnfs1_ganesha_rados_store_enable=${MANILA_CEPH_GANESHA_RADOS_STORE}
62 if [ $MANILA_CEPH_GANESHA_RADOS_STORE == 'True' ]; then
63 MANILA_OPTGROUP_cephfsnfs1_ganesha_rados_store_enable=${MANILA_CEPH_GANESHA_RADOS_STORE}
64 MANILA_OPTGROUP_cephfsnfs1_ganesha_rados_store_pool_name=${CEPHFS_DATA_POOL}
65 fi
60 fi 66 fi
61fi 67fi