summaryrefslogtreecommitdiff
path: root/devstack
diff options
context:
space:
mode:
authorRamana Raja <rraja@redhat.com>2017-03-18 17:19:48 +0530
committerRamana Raja <rraja@redhat.com>2017-04-06 14:13:12 +0530
commita53eaba74783eeb6fb91ef94ca2498a8c6c4fe0b (patch)
treed65c35a88b307c411ff4b91a86ba712a6f0141ce /devstack
parentcf3215dfef91e275f2619333ac4dd1f169b83615 (diff)
Add support to setup CephFS NFS-Ganesha driver
... for Manila. Tested to work in Ubuntu Xenial and CentOS 7 environments. Co-Authored-By: Tom Barron <tpb@dyncloud.net> Change-Id: Ib2e806fefdd0548b06ff6aadd4b6a8e62001ea33
Notes
Notes (review): Code-Review+2: Sébastien Han <seb@redhat.com> Workflow+1: Sébastien Han <seb@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 06 Apr 2017 09:52:05 +0000 Reviewed-on: https://review.openstack.org/447389 Project: openstack/devstack-plugin-ceph Branch: refs/heads/master
Diffstat (limited to 'devstack')
-rw-r--r--devstack/lib/ceph74
-rw-r--r--devstack/settings52
2 files changed, 102 insertions, 24 deletions
diff --git a/devstack/lib/ceph b/devstack/lib/ceph
index ace5e25..f95ab9e 100644
--- a/devstack/lib/ceph
+++ b/devstack/lib/ceph
@@ -336,6 +336,9 @@ function cleanup_ceph_embedded {
336 336
337function cleanup_ceph_general { 337function cleanup_ceph_general {
338 _undefine_virsh_secret 338 _undefine_virsh_secret
339 if is_ceph_enabled_for_service manila && [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
340 cleanup_nfs_ganesha
341 fi
339} 342}
340 343
341function cleanup_containerized_ceph { 344function cleanup_containerized_ceph {
@@ -702,10 +705,32 @@ function configure_ceph_manila {
702 client mount gid = 0 705 client mount gid = 0
703EOF 706EOF
704 707
708 if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
709 configure_nfs_ganesha
710 # NFS-Ganesha server cannot run alongwith with other kernel NFS server.
711 sudo systemctl stop nfs-server
712 sudo systemctl disable nfs-server
713 sudo systemctl enable nfs-ganesha
714 sudo systemctl start nfs-ganesha
715 fi
716
705# RESTART DOCKER CONTAINER 717# RESTART DOCKER CONTAINER
706 718
707} 719}
708 720
721function configure_nfs_ganesha {
722 # Configure NFS-Ganesha to work with Manila's CephFS driver
723 sudo mkdir -p /etc/ganesha/export.d
724 sudo touch /etc/ganesha/export.d/INDEX.conf
725 echo "%include /etc/ganesha/export.d/INDEX.conf" | sudo tee /etc/ganesha/ganesha.conf
726}
727
728function cleanup_nfs_ganesha {
729 sudo systemctl stop nfs-ganesha
730 sudo systemctl disable nfs-ganesha
731 sudo uninstall_package nfs-ganesha nfs-ganesha-ceph
732}
733
709function configure_ceph_embedded_manila { 734function configure_ceph_embedded_manila {
710 if [[ $CEPH_REPLICAS -ne 1 ]]; then 735 if [[ $CEPH_REPLICAS -ne 1 ]]; then
711 sudo $DOCKER_EXEC ceph -c ${CEPH_CONF_FILE} osd pool set ${CEPHFS_DATA_POOL} \ 736 sudo $DOCKER_EXEC ceph -c ${CEPH_CONF_FILE} osd pool set ${CEPHFS_DATA_POOL} \
@@ -806,18 +831,29 @@ function install_ceph {
806 install_package software-properties-common 831 install_package software-properties-common
807 832
808 if is_ceph_enabled_for_service manila; then 833 if is_ceph_enabled_for_service manila; then
809 if ! [[ $os_CODENAME =~ (xenial|trusty) ]]; then
810 die $LINENO "Need Ubuntu trusty or xenial to setup Manila with CephFS"
811 fi
812 # The 'apt' package manager needs the following package to access 834 # The 'apt' package manager needs the following package to access
813 # HTTPS enabled repositories such as the Ceph repos hosted by the 835 # HTTPS enabled repositories such as the Ceph repos hosted by the
814 # shaman/chacra system. 836 # shaman/chacra system.
815 install_package apt-transport-https 837 install_package apt-transport-https
816 838
817 curl -L https://shaman.ceph.com/api/repos/ceph/jewel/latest/ubuntu/$os_CODENAME/repo | \ 839 if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
818 sudo tee /etc/apt/sources.list.d/ceph.list 840 if [ $os_CODENAME != 'xenial' ]; then
819 841 die $LINENO "Need Ubuntu xenial to setup Manila with CephFS NFS-Ganesha driver"
820 CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs1" 842 fi
843 # TODO(rraja): Switch to LTS luminous after spring 2017 release.
844 curl -L https://shaman.ceph.com/api/repos/ceph/kraken/latest/ubuntu/$os_CODENAME/repo | \
845 sudo tee /etc/apt/sources.list.d/ceph.list
846 curl -L https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/ubuntu/$os_CODENAME/flavors/ceph_kraken/repo | \
847 sudo tee /etc/apt/sources.list.d/ext-nfs-ganesha.list
848 CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs2 nfs-ganesha nfs-ganesha-ceph"
849 else
850 if ! [[ $os_CODENAME =~ (xenial|trusty) ]]; then
851 die $LINENO "Need Ubuntu trusty or xenial to setup Manila with CephFS native driver"
852 fi
853 curl -L https://shaman.ceph.com/api/repos/ceph/jewel/latest/ubuntu/$os_CODENAME/repo | \
854 sudo tee /etc/apt/sources.list.d/ceph.list
855 CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs1"
856 fi
821 857
822 elif [ -f "$APT_REPOSITORY_FILE" ]; then 858 elif [ -f "$APT_REPOSITORY_FILE" ]; then
823 # Opt into Openstack CI provided package repo mirror 859 # Opt into Openstack CI provided package repo mirror
@@ -851,8 +887,29 @@ function install_ceph {
851 REPOS_UPDATED=False 887 REPOS_UPDATED=False
852 install_package ${CEPH_PACKAGES} 888 install_package ${CEPH_PACKAGES}
853 else 889 else
890 DISTRO_TYPE=${os_VENDOR,,}
891 RELEASE=$(echo $os_RELEASE | awk -F . '{print $1}')
892
854 CEPH_PACKAGES="ceph" 893 CEPH_PACKAGES="ceph"
855 894
895 if is_ceph_enabled_for_service manila; then
896 if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
897 if [ $DISTRO_TYPE == 'centos' ] && [ $RELEASE == 7 ]; then
898 # TODO(rraja): Switch to LTS luminous after spring 2017 release.
899 curl -L https://shaman.ceph.com/api/repos/ceph/kraken/latest/$DISTRO_TYPE/$RELEASE/repo | \
900 sudo tee /etc/yum.repos.d/ext-ceph.repo
901 curl -L https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/$DISTRO_TYPE/$RELEASE/flavors/ceph_kraken/repo | \
902 sudo tee /etc/yum.repos.d/ext-ganesha.repo
903 fi
904 CEPH_PACKAGES="${CEPH_PACKAGES} nfs-ganesha nfs-ganesha-ceph"
905 else
906 if [ $DISTRO_TYPE == 'centos' ] && [ $RELEASE == 7 ]; then
907 curl -L https://shaman.ceph.com/api/repos/ceph/jewel/latest/$DISTRO_TYPE/$RELEASE/repo | \
908 sudo tee /etc/yum.repos.d/ext-ceph.repo
909 fi
910 fi
911 fi
912
856 if [ "$ENABLE_CEPH_RGW" = "True" ]; then 913 if [ "$ENABLE_CEPH_RGW" = "True" ]; then
857 install_package ceph-radosgw 914 install_package ceph-radosgw
858 CEPH_PACKAGES="${CEPH_PACKAGES} ceph-radosgw" 915 CEPH_PACKAGES="${CEPH_PACKAGES} ceph-radosgw"
@@ -905,6 +962,9 @@ function stop_ceph {
905 fi 962 fi
906 if is_ceph_enabled_for_service manila; then 963 if is_ceph_enabled_for_service manila; then
907 sudo systemctl stop ceph-mds@${MDS_ID} 964 sudo systemctl stop ceph-mds@${MDS_ID}
965 if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
966 sudo systemctl stop nfs-ganesha
967 fi
908 fi 968 fi
909 # if mon is dead or unhealthy we won't get the list 969 # if mon is dead or unhealthy we won't get the list
910 # of osds but should continue anyways. 970 # of osds but should continue anyways.
diff --git a/devstack/settings b/devstack/settings
index 4f38a22..74c71e3 100644
--- a/devstack/settings
+++ b/devstack/settings
@@ -23,21 +23,39 @@ TEMPEST_VOLUME_MANAGE_SNAPSHOT=False
23source $CEPH_PLUGIN_DIR/lib/ceph 23source $CEPH_PLUGIN_DIR/lib/ceph
24 24
25# Set Manila related global variables used by Manila's DevStack plugin. 25# Set Manila related global variables used by Manila's DevStack plugin.
26if (is_ceph_enabled_for_service manila) && \ 26if (is_ceph_enabled_for_service manila); then
27[[ $MANILA_CEPH_DRIVER == 'cephfsnative' ]]; then 27 if [[ $MANILA_CEPH_DRIVER == 'cephfsnative' ]]; then
28 MANILA_DHSS=$(trueorfalse False MANILA_DHSS) 28 MANILA_DHSS=$(trueorfalse False MANILA_DHSS)
29 MANILA_ENABLED_SHARE_PROTOCOLS=CEPHFS 29 MANILA_ENABLED_SHARE_PROTOCOLS=CEPHFS
30 MANILA_DEFAULT_SHARE_TYPE=cephfstype 30 MANILA_DEFAULT_SHARE_TYPE=cephfstype
31 # CephFSNative Driver does not yet support creation of shares from 31 # CephFSNative Driver does not yet support creation of shares from
32 # snapshot. 32 # snapshot.
33 MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS='snapshot_support=False' 33 MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS='snapshot_support=False'
34 34
35 MANILA_ENABLED_BACKENDS=cephfsnative1 35 MANILA_ENABLED_BACKENDS=cephfsnative1
36 MANILA_CONFIGURE_GROUPS=cephfsnative1 36 MANILA_CONFIGURE_GROUPS=cephfsnative1
37 37
38 MANILA_OPTGROUP_cephfsnative1_share_driver=manila.share.drivers.cephfs.cephfs_native.CephFSNativeDriver 38 MANILA_OPTGROUP_cephfsnative1_share_driver=manila.share.drivers.cephfs.cephfs_native.CephFSNativeDriver
39 MANILA_OPTGROUP_cephfsnative1_driver_handles_share_servers=$MANILA_DHSS 39 MANILA_OPTGROUP_cephfsnative1_driver_handles_share_servers=$MANILA_DHSS
40 MANILA_OPTGROUP_cephfsnative1_share_backend_name=CEPHFSNATIVE1 40 MANILA_OPTGROUP_cephfsnative1_share_backend_name=CEPHFSNATIVE1
41 MANILA_OPTGROUP_cephfsnative1_cephfs_conf_path=${CEPH_CONF_FILE} 41 MANILA_OPTGROUP_cephfsnative1_cephfs_conf_path=${CEPH_CONF_FILE}
42 MANILA_OPTGROUP_cephfsnative1_cephfs_auth_id=${MANILA_CEPH_USER} 42 MANILA_OPTGROUP_cephfsnative1_cephfs_auth_id=${MANILA_CEPH_USER}
43 elif [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
44 MANILA_DHSS=$(trueorfalse False MANILA_DHSS)
45 MANILA_ENABLED_SHARE_PROTOCOLS=NFS
46 MANILA_DEFAULT_SHARE_TYPE=cephfsnfstype
47 # CephFS Driver does not yet support creation of shares from
48 # snapshot.
49 MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS='snapshot_support=False'
50
51 MANILA_ENABLED_BACKENDS=cephfsnfs1
52 MANILA_CONFIGURE_GROUPS=cephfsnfs1
53
54 MANILA_OPTGROUP_cephfsnfs1_share_driver=manila.share.drivers.cephfs.driver.CephFSDriver
55 MANILA_OPTGROUP_cephfsnfs1_driver_handles_share_servers=$MANILA_DHSS
56 MANILA_OPTGROUP_cephfsnfs1_share_backend_name=CEPHFSNFS1
57 MANILA_OPTGROUP_cephfsnfs1_cephfs_conf_path=${CEPH_CONF_FILE}
58 MANILA_OPTGROUP_cephfsnfs1_cephfs_auth_id=${MANILA_CEPH_USER}
59 MANILA_OPTGROUP_cephfsnfs1_cephfs_protocol_helper_type=NFS
60 fi
43fi 61fi