From e8317a646fd2bafe540e3a226fbb7454d73a63f0 Mon Sep 17 00:00:00 2001 From: OpenStack Release Bot Date: Thu, 14 Mar 2024 11:59:30 +0000 Subject: [PATCH 1/7] Update .gitreview for stable/2024.1 Change-Id: I02b5e02430efd88403a82cef29366122caa8ea3b --- .gitreview | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitreview b/.gitreview index 64aebd2..0ba5cb7 100644 --- a/.gitreview +++ b/.gitreview @@ -2,3 +2,4 @@ host=review.opendev.org port=29418 project=openstack/devstack-plugin-ceph.git +defaultbranch=stable/2024.1 From 48d633fbdbac56dee713ec1071977778758fae07 Mon Sep 17 00:00:00 2001 From: OpenStack Release Bot Date: Thu, 14 Mar 2024 11:59:32 +0000 Subject: [PATCH 2/7] Update TOX_CONSTRAINTS_FILE for stable/2024.1 Update the URL to the upper-constraints file to point to the redirect rule on releases.openstack.org so that anyone working on this branch will switch to the correct upper-constraints list automatically when the requirements repository branches. Until the requirements repository has as stable/2024.1 branch, tests will continue to use the upper-constraints list on master. Change-Id: I2fae83ae2e3d156c41a872e5a6ca497a9cdafb28 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index fe80eb7..3a97c89 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,7 @@ commands = bash -c "find {toxinidir} \ [testenv:docs] deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.1} -r{toxinidir}/doc/requirements.txt commands = rm -rf doc/build From 3516de40406247d24cd6289aa5c5fa512bcb4145 Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Thu, 20 Jun 2024 18:24:36 -0700 Subject: [PATCH 3/7] Skip slow marked tests in devstack-plugin-ceph-tempest-py3 devstack-plugin-ceph-tempest-py3 is timeout consistently and one of the reason can be it run the slow marked tests also. All integrated jobs runs slow marked tests in separate job. Skipping the slow tests in this job and devstack-plugin-ceph-multinode-tempest-py3 already cover them so no need to add a separate job. Change-Id: I0a80a107dfbe9690bc173a8a2ed872de53dcf995 (cherry picked from commit 3683eb293c1a7f72f8f7c92f66738ace447b1d82) --- .zuul.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.zuul.yaml b/.zuul.yaml index c8aaff9..71011ed 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -31,9 +31,11 @@ devstack_services: # Disable horizon (inherited from the parent, not needed by the tests executed here) horizon: false + # The regex below is used to select which tests to run and exclude the slow tag and + # tests listed in tempest_skiplist.txt file: tox_envlist: all tempest_test_regex: | - (^tempest\.(api|scenario\.test_encrypted_cinder_volumes|scenario\.test_volume|scenario\.test_shelve_instance)|(^cinder_tempest_plugin)) + ((?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario\.test_encrypted_cinder_volumes|scenario\.test_volume|scenario\.test_shelve_instance)|(^cinder_tempest_plugin))) tempest_test_exclude_list: '{{ ansible_user_dir }}/{{ zuul.projects["opendev.org/openstack/devstack-plugin-ceph"].src_dir }}/tempest_skiplist.txt' - job: From f6dc57864dab9e9e183044fd80bc4cf273c5adbc Mon Sep 17 00:00:00 2001 From: ashrod98 Date: Wed, 5 Jun 2024 11:00:10 -0400 Subject: [PATCH 4/7] Fix ingress deamon Fixes ingress deamon, for 18.0+ Ceph versions by setting correct VIP. Ingress daemon was added in Caracal, and when backported to Bobcat encountered CI failures. In this patch I've added verbose MDS logging capabilities, and fixed the failures that were present in Bobcat stable CI, cephfs-nfs-cephadm job. History is in patchset 908940. Resubmititng starting at master to backport to stable branches in the correct order. Depends-On: I5b7fd5b2b557203189c25fa2a988d790e7fda3eb Change-Id: Ia1671de5c770d1cf5a3cd58e05fe5204f5bbc3c6 (cherry picked from commit ca3784609fbc045ea7f06c4b8c031cbeece95b27) --- .zuul.yaml | 5 +++++ devstack/lib/cephadm | 33 +++++++++++++++++++++++++++++++-- devstack/plugin.sh | 3 +++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index c8aaff9..a39cad1 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -98,6 +98,11 @@ name: devstack-plugin-ceph-multinode-cephfs-nfs-cephadm parent: manila-tempest-plugin-multinode-cephfs-nfs-cephadm description: Test CephFS NFS (DHSS=False) in a Multinode devstack env + vars: + devstack_localrc: + MDS_LOGS: True + CEPH_INGRESS_IP: "{{hostvars['controller'].ansible_default_ipv6.address}}" + - job: name: devstack-plugin-ceph-multinode-tempest-py3 diff --git a/devstack/lib/cephadm b/devstack/lib/cephadm index c4a591f..8b36fcc 100755 --- a/devstack/lib/cephadm +++ b/devstack/lib/cephadm @@ -61,6 +61,8 @@ CEPH_CONF_FILE=${CEPH_CONF_FILE:-$CEPH_CONF_DIR/ceph.conf} # LOG(s) and EXPORTED CONFIG FILES EXPORT=$HOME/ceph_export.yml RBD_CLIENT_LOG=/var/log/ceph/qemu-guest-\$pid.log +MDS_LOG_FILE="$HOME/mds_log.conf" +MDS_LOGS=${MDS_LOGS:-"False"} # MANILA DEFAULTS MANILA_CEPH_USER=${MANILA_CEPH_USER:-manila} @@ -72,7 +74,7 @@ CEPHFS_CLIENT=0 CEPHFS_CLIENT_NAME="client.$MANILA_CEPH_USER" CEPHFS_CLIENT_LOG="/var/log/ceph-$CEPHFS_CLIENT_NAME.log" CEPHFS_MULTIPLE_FILESYSTEMS=${CEPHFS_MULTIPLE_FILESYSTEMS:-False} -VIP=$HOST_IP +VIP=$CEPH_INGRESS_IP # GLANCE DEFAULTS @@ -109,6 +111,33 @@ function set_debug { fi } +function enable_verbose_mds_logging { + $SUDO "$CEPHADM" shell --fsid $FSID --config $CEPH_CONFIG \ + --keyring $CEPH_KEYRING -- ceph config set mds debug_mds 20 + $SUDO "$CEPHADM" shell --fsid $FSID --config $CEPH_CONFIG \ + --keyring $CEPH_KEYRING -- ceph config set mds debug_ms 20 + $SUDO "$CEPHADM" shell --fsid $FSID --config $CEPH_CONFIG \ + --keyring $CEPH_KEYRING -- ceph config set mds debug_client 20 + $SUDO "$CEPHADM" shell --fsid $FSID --config $CEPH_CONFIG \ + --keyring $CEPH_KEYRING -- ceph config set mds log_to_file true + $SUDO "$CEPHADM" shell --fsid $FSID --config $CEPH_CONFIG \ + --keyring $CEPH_KEYRING -- ceph config set global mon_cluster_log_to_file true + $SUDO "$CEPHADM" shell --fsid $FSID --config $CEPH_CONFIG \ + --keyring $CEPH_KEYRING -- ceph config set global log_to_file true + touch "$MDS_LOG_FILE" + cat < "$MDS_LOG_FILE" +LOG { + COMPONENTS { + ALL = FULL_DEBUG; + } +} +EOF + $SUDO "$CEPHADM" shell --fsid $FSID --config $CEPH_CONFIG \ + --keyring $CEPH_KEYRING -m $MDS_LOG_FILE -- ceph nfs cluster config set "$FSNAME" \ + -i /mnt/mds_log.conf + +} + # Admin: check ceph cluster status function check_cluster_status { $SUDO "$CEPHADM" shell --fsid $FSID --config $CEPH_CONFIG \ @@ -340,7 +369,7 @@ function ceph_nfs_config { $SUDO "$CEPHADM" shell --fsid $FSID --config $CEPH_CONFIG \ --keyring $CEPH_KEYRING -- ceph nfs cluster create \ "$FSNAME" "$HOSTNAME" --port $NFS_PORT --ingress \ - --ingress-mode haproxy-protocol --virtual_ip $HOST_IP + --ingress-mode haproxy-protocol --virtual_ip $VIP else echo "[CEPHADM] Ingress service is not deployed \ to preserve the ability to apply client restrictions." diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 8e3453d..8d746a3 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -118,6 +118,9 @@ elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then fi fi fi + if [[ "$MDS_LOGS" == "True" ]]; then + enable_verbose_mds_logging + fi elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then if is_service_enabled tempest; then iniset $TEMPEST_CONFIG compute-feature-enabled swap_volume False From 3a2fa5b8c8bf82d11988c3d0ecb56ceca07d2b47 Mon Sep 17 00:00:00 2001 From: ashrod98 Date: Thu, 25 Jul 2024 13:58:00 -0400 Subject: [PATCH 5/7] Follow Up Patch Fix Ingress Deamon Remove MDS_LOG=True in job declaration Change-Id: Ie0e174ae8cc21ce42c6d672e397028703357c4aa --- .zuul.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.zuul.yaml b/.zuul.yaml index a39cad1..3379470 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -100,7 +100,6 @@ description: Test CephFS NFS (DHSS=False) in a Multinode devstack env vars: devstack_localrc: - MDS_LOGS: True CEPH_INGRESS_IP: "{{hostvars['controller'].ansible_default_ipv6.address}}" From af28bdab3919eb2dc714a87ef0625717b5bfa938 Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Mon, 1 Apr 2024 17:11:05 -0700 Subject: [PATCH 6/7] Standalone nfs-ganesha with cephadm deployment Manila supports using a standalone NFS-Ganesha server as well as a ceph orchestrator deployed NFS-Ganesha cluster ("ceph nfs service"). We've only ever allowed using ceph orch deployed NFS with ceph orch deployed clusters through this devstack plugin. With this change, the plugin can optionally deploy a standalone NFS-Ganesha service with a ceph orch deployed ceph cluster. This will greatly simplify testing when we sunset the package based installation/deployment of ceph. Depends-On: I2198eee3892b2bb0eb835ec66e21b708152b33a9 Change-Id: If983bb5d5a5fc0c16c1cead84b5fa30ea961d21b Implements: bp/cephadm-deploy Signed-off-by: Goutham Pacha Ravi (cherry picked from commit ca2486efb408094683848b3f4cd1e551ea266872) --- .zuul.yaml | 7 +- devstack/lib/ceph | 130 ++----------------------------------- devstack/lib/cephadm | 66 +++++++++++++------ devstack/lib/common | 149 +++++++++++++++++++++++++++++++++++++++++++ devstack/settings | 16 ++--- 5 files changed, 212 insertions(+), 156 deletions(-) create mode 100755 devstack/lib/common diff --git a/.zuul.yaml b/.zuul.yaml index a39cad1..57ee983 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -88,10 +88,11 @@ parent: manila-tempest-plugin-cephfs-native-cephadm - job: - name: devstack-plugin-ceph-cephfs-nfs + name: devstack-plugin-ceph-cephfs-nfs-standalone description: | Runs manila tempest plugin tests with CephFS via NFS-Ganesha as a manila - back end (DHSS=False) + back end (DHSS=False). The Ceph cluster is created with cephadm + while nfs-ganesha is installed "standalone" via a package. parent: manila-tempest-plugin-cephfs-nfs - job: @@ -172,7 +173,7 @@ - devstack-plugin-ceph-cephfs-native: irrelevant-files: *irrelevant-files voting: false - - devstack-plugin-ceph-cephfs-nfs: + - devstack-plugin-ceph-cephfs-nfs-standalone: irrelevant-files: *irrelevant-files voting: false # - devstack-plugin-ceph-master-tempest: diff --git a/devstack/lib/ceph b/devstack/lib/ceph index 7939a87..98b78f1 100755 --- a/devstack/lib/ceph +++ b/devstack/lib/ceph @@ -21,6 +21,7 @@ # Save trace setting XTRACE=$(set +o | grep xtrace) set +o xtrace +source $CEPH_PLUGIN_DIR/lib/common # Defaults @@ -30,20 +31,6 @@ TEST_MASTER=$(trueorfalse False TEST_MASTER) CEPH_RELEASE=${CEPH_RELEASE:-quincy} -GANESHA_RELEASE=${GANESHA_RELEASE:-'unspecified'} -# Remove "v" and "-stable" prefix/suffix tags -GANESHA_RELEASE=$(echo $GANESHA_RELEASE | sed -e "s/^v//" -e "s/-stable$//") - -if [[ "$MANILA_CEPH_DRIVER" == "cephfsnfs" && "$GANESHA_RELEASE" == "unspecified" ]]; then - # default ganesha release based on ceph release - case $CEPH_RELEASE in - pacific) - GANESHA_RELEASE='3.5' ;; - *) - GANESHA_RELEASE='4.0' ;; - esac -fi - # Deploy a Ceph demo container instead of a non-containerized version CEPH_CONTAINERIZED=$(trueorfalse False CEPH_CONTAINERIZED) @@ -111,10 +98,6 @@ CEPHFS_DATA_POOL=${CEPHFS_DATA_POOL:-cephfs_data} MANILA_CEPH_DRIVER=${MANILA_CEPH_DRIVER:-cephfsnative} MANILA_CEPH_USER=${MANILA_CEPH_USER:-manila} -# Allows driver to store NFS-Ganesha exports and export counter as -# RADOS objects in CephFS's data pool. This needs NFS-Ganesha v2.5.4 or later, -# Ceph v12.2.2 or later, and OpenStack Queens or later. -MANILA_CEPH_GANESHA_RADOS_STORE=${MANILA_CEPH_GANESHA_RADOS_STORE:-True} # Set ``CEPH_REPLICAS`` to configure how many replicas are to be # configured for your Ceph cluster. By default we are configuring @@ -757,67 +740,13 @@ function configure_ceph_manila { if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then configure_nfs_ganesha - # NFS-Ganesha server cannot run alongwith with other kernel NFS server. - sudo systemctl stop nfs-server || true - sudo systemctl disable nfs-server || true - sudo systemctl enable nfs-ganesha - sudo systemctl start nfs-ganesha || ( - echo "Ganesha didn't start. Let's debug..." >&2 - sudo systemctl status nfs-ganesha || true - echo "**Ganesha conf file**" >&2 - sudo cat /etc/ganesha/ganesha.conf || true - echo "**Ganesha log file**" >&2 - sudo cat /var/log/ganesha/ganesha.log || true - echo "**Exiting**" >&2 - exit 1 - ) - echo "Ganesha started successfully!" >&2 + start_nfs_ganesha fi # RESTART DOCKER CONTAINER } -function configure_nfs_ganesha { - # Configure NFS-Ganesha to work with Manila's CephFS driver - sudo mkdir -p /etc/ganesha/export.d - if [ $MANILA_CEPH_GANESHA_RADOS_STORE == 'True' ]; then - # Create an empty placeholder ganesha export index object - echo | sudo rados -p ${CEPHFS_DATA_POOL} put ganesha-export-index - - cat </dev/null -RADOS_URLS { - ceph_conf = ${CEPH_CONF_FILE}; - userid = admin; -} - -CACHEINODE { - Dir_Max = 1; - Dir_Chunk = 0; - - Cache_FDs = false; - - NParts = 1; - Cache_Size = 1; -} - -EXPORT_DEFAULTS { - Attr_Expiration_Time = 0; -} - -%url rados://${CEPHFS_DATA_POOL}/ganesha-export-index -EOF - else - sudo touch /etc/ganesha/export.d/INDEX.conf - echo "%include /etc/ganesha/export.d/INDEX.conf" | sudo tee /etc/ganesha/ganesha.conf - fi -} - -function cleanup_nfs_ganesha { - sudo systemctl stop nfs-ganesha - sudo systemctl disable nfs-ganesha - sudo uninstall_package nfs-ganesha nfs-ganesha-ceph libntirpc3 nfs-ganesha-rados-urls nfs-ganesha-vfs -} - function configure_ceph_embedded_manila { if [[ $CEPH_REPLICAS -ne 1 ]]; then sudo $DOCKER_EXEC ceph -c ${CEPH_CONF_FILE} osd pool set ${CEPHFS_DATA_POOL} \ @@ -958,19 +887,6 @@ EOF sudo dnf config-manager --add-repo ceph.repo } -function dnf_add_repository_nfsganesha { - local repo="" - - case $ganesha_release in - 3.*) - repo="centos-release-nfs-ganesha30" ;; - *) - repo="centos-release-nfs-ganesha4" ;; - esac - - sudo dnf -y install ${repo} -} - # configure_repo_ceph() - Configure Ceph repositories # Usage: configure_repo_ceph # - package_release: to override the os_RELEASE variable @@ -1009,44 +925,11 @@ function cleanup_repo_ceph { fi } -# configure_repo_nfsganesha() - Configure NFS Ganesha repositories -function configure_repo_nfsganesha { - if is_ubuntu; then - # NOTE(gouthamr): Ubuntu PPAs contain the latest build from each major - # version; we can't use a build microversion unlike el8/el9 builds - if [[ $GANESHA_RELEASE =~ 3 ]]; then - sudo add-apt-repository -y ppa:nfs-ganesha/libntirpc-3.0 - sudo add-apt-repository -y ppa:nfs-ganesha/nfs-ganesha-3.0 - elif [[ $GANESHA_RELEASE =~ 4 ]]; then - sudo add-apt-repository -y ppa:nfs-ganesha/libntirpc-4 - sudo add-apt-repository -y ppa:nfs-ganesha/nfs-ganesha-4 - else - die $LINENO "NFS-Ganesha $GANESHA_RELEASE is not supported by the Ceph plugin for Devstack" - fi - sudo apt-get -y update - elif is_fedora; then - dnf_add_repository_nfsganesha - fi -} - -# cleanup_repo_nfsganesha() - Remove NFS Ganesha repositories -# Usage: cleanup_repo_nfsganesha -function cleanup_repo_nfsganesha { - if is_ubuntu; then - sudo rm -rf "/etc/apt/sources.list.d/nfs-ganesha-ubuntu*" - elif is_fedora; then - sudo rm -rf /etc/yum.repos.d/nfs-ganesha.repo - fi -} - function setup_packages_for_manila_on_ubuntu { CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs2" if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then - configure_repo_nfsganesha - LIBNTIRPC_PACKAGE="libntirpc${GANESHA_RELEASE:0:1}" - CEPH_PACKAGES="${CEPH_PACKAGES} $LIBNTIRPC_PACKAGE \ - nfs-ganesha nfs-ganesha-ceph nfs-ganesha-rados-urls nfs-ganesha-vfs" + install_nfs_ganesha fi if python3_enabled; then @@ -1056,9 +939,7 @@ function setup_packages_for_manila_on_ubuntu { function setup_packages_for_manila_on_fedora_family { if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then - configure_repo_nfsganesha - CEPH_PACKAGES="${CEPH_PACKAGES} nfs-ganesha nfs-ganesha-ceph \ - nfs-ganesha-rados-urls nfs-ganesha-vfs" + install_nfs_ganesha fi } @@ -1175,8 +1056,7 @@ function stop_ceph { fi if is_ceph_enabled_for_service manila; then if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then - sudo systemctl stop nfs-ganesha - sudo systemctl disable nfs-ganesha + stop_nfs_ganesha fi sudo systemctl stop ceph-mds@${MDS_ID} sudo systemctl disable ceph-mds@${MDS_ID} diff --git a/devstack/lib/cephadm b/devstack/lib/cephadm index 8b36fcc..85f823d 100755 --- a/devstack/lib/cephadm +++ b/devstack/lib/cephadm @@ -67,7 +67,11 @@ MDS_LOGS=${MDS_LOGS:-"False"} # MANILA DEFAULTS MANILA_CEPH_USER=${MANILA_CEPH_USER:-manila} -# NFS OPTIONS +# NFS OPTIONS: Only apply when ENABLE_CEPH_MANILA=True +# Whether or not cephadm should deploy/manage NFS-Ganesha? If set to False, +# we'll deploy a "standalone" NFS Ganesha instead, not managed by cephadm. +CEPHADM_DEPLOY_NFS=${CEPHADM_DEPLOY_NFS:-True} +# Clustered NFS Options FSNAME=${FSNAME:-'cephfs'} NFS_PORT=2049 CEPHFS_CLIENT=0 @@ -153,7 +157,7 @@ function export_spec { # Pre-install ceph: install required dependencies function install_deps { - if [[ "$REMOTE_CEPH" == "False" ]]; then + if [[ "$REMOTE_CEPH" = "False" ]]; then install_package python3-cephfs python3-prettytable python3-rados python3-rbd python3-requests fi } @@ -218,16 +222,16 @@ function start_ceph { --skip-mon-network \ --mon-ip "$HOST_IP" - test -e $CEPH_CONFIG - test -e $CEPH_KEYRING + test -e $CEPH_CONFIG + test -e $CEPH_KEYRING - if [ "$CEPHADM_DEV_OSD" == 'True' ]; then - create_osd_dev - fi - # Wait cephadm backend to be operational - # and add osds via drivegroups - sleep "$SLEEP" - add_osds + if [ "$CEPHADM_DEV_OSD" == 'True' ]; then + create_osd_dev + fi + # Wait cephadm backend to be operational + # and add osds via drivegroups + sleep "$SLEEP" + add_osds fi } @@ -271,7 +275,7 @@ function add_osds { while [ "$ATTEMPTS" -ne 0 ]; do num_osds=$($SUDO "$CEPHADM" shell --fsid $FSID --config $CEPH_CONFIG \ - --keyring $CEPH_KEYRING -- ceph -s -f json | jq '.osdmap | .num_up_osds') + --keyring $CEPH_KEYRING -- ceph -s -f json | jq '.osdmap | .num_up_osds') if [ "$num_osds" -ge "$MIN_OSDS" ]; then break; fi @@ -342,8 +346,8 @@ function create_keys { # Install ceph: add MDS function cephfs_config { # Two pools are generated by this action - # - $FSNAME.FSNAME.data - # - $FSNAME.FSNAME.meta + # - cephfs.$FSNAME.data + # - cephfs.$FSNAME.meta # and the mds daemon is deployed $SUDO "$CEPHADM" shell --fsid $FSID --config $CEPH_CONFIG \ --keyring $CEPH_KEYRING -- ceph fs volume create "$FSNAME" @@ -359,8 +363,7 @@ function _get_ceph_version { echo $ceph_version_str } -# Install ceph: add NFS -function ceph_nfs_config { +function _install_and_configure_clustered_nfs { local ceph_version ceph_version=$(_get_ceph_version) @@ -379,6 +382,23 @@ function ceph_nfs_config { fi } +function _install_and_configure_standalone_nfs { + source $CEPH_PLUGIN_DIR/lib/common + install_nfs_ganesha + configure_nfs_ganesha + start_nfs_ganesha +} + +# Install ceph: add NFS +function ceph_nfs_config { + if [[ "$CEPHADM_DEPLOY_NFS" == "True" ]]; then + _install_and_configure_clustered_nfs + else + _install_and_configure_standalone_nfs + fi + +} + function _create_swift_endpoint { local swift_service @@ -482,17 +502,17 @@ function configure_ceph_manila { function enable_services { for item in "${SERVICES[@]}"; do case "$item" in - cephfs|CEPHFS) + cephfs|CEPHFS) echo "[CEPHADM] Config cephfs volume on node $HOSTNAME" cephfs_config CEPHFS_CLIENT=1 ;; - nfs|NFS) + nfs|NFS) echo "[CEPHADM] Deploying NFS on node $HOSTNAME" ceph_nfs_config CEPHFS_CLIENT=1 ;; - rgw|RGW) + rgw|RGW) echo "[CEPHADM] Deploying RGW on node $HOSTNAME" rgw ;; @@ -735,8 +755,14 @@ function cleanup_ceph { # purge ceph config file and keys $SUDO rm -f ${CEPH_CONF_DIR}/* if is_ceph_enabled_for_service nova; then - _undefine_virsh_secret + _undefine_virsh_secret fi + if [[ "$CEPHADM_DEPLOY_NFS" != "True" ]]; then + stop_nfs_ganesha + cleanup_nfs_ganesha + cleanup_repo_nfs_ganesha + fi + } function disable_cephadm { diff --git a/devstack/lib/common b/devstack/lib/common new file mode 100755 index 0000000..1b7b665 --- /dev/null +++ b/devstack/lib/common @@ -0,0 +1,149 @@ +#!/bin/bash + +# Allows driver to store NFS-Ganesha exports and export counter as +# RADOS objects in CephFS's data pool. This needs NFS-Ganesha v2.5.4 or later, +# Ceph v12.2.2 or later, and OpenStack Queens or later. +MANILA_CEPH_GANESHA_RADOS_STORE=${MANILA_CEPH_GANESHA_RADOS_STORE:-True} +GANESHA_RELEASE=${GANESHA_RELEASE:-'unspecified'} +# Remove "v" and "-stable" prefix/suffix tags +GANESHA_RELEASE=$(echo $GANESHA_RELEASE | sed -e "s/^v//" -e "s/-stable$//") +if [[ "$CEPHADM_DEPLOY" = "True" ]]; then + FSNAME=${FSNAME:-'cephfs'} + CEPHFS_DATA_POOL="cephfs.$FSNAME.data" +else + CEPHFS_DATA_POOL=${CEPHFS_DATA_POOL:-cephfs_data} +fi + +if [[ "$MANILA_CEPH_DRIVER" == "cephfsnfs" && "$GANESHA_RELEASE" == "unspecified" ]]; then + # default ganesha release based on ceph release + case $CEPH_RELEASE in + pacific) + GANESHA_RELEASE='3.5' + ;; + *) + GANESHA_RELEASE='5.0' + ;; + esac +fi + +# configure_repo_nfsganesha - Configure NFS Ganesha repositories +function configure_repo_nfsganesha { + if is_ubuntu; then + # NOTE(gouthamr): Ubuntu PPAs contain the latest build from each major + # version; we can't use a build microversion unlike el8/el9 builds + case $GANESHA_RELEASE in + 3.*) + sudo add-apt-repository -y ppa:nfs-ganesha/libntirpc-3.0 + sudo add-apt-repository -y ppa:nfs-ganesha/nfs-ganesha-3.0 + ;; + *) + GANESHA_PPA_VERSION="${GANESHA_RELEASE:0:1}" + sudo add-apt-repository -y ppa:nfs-ganesha/libntirpc-"$GANESHA_PPA_VERSION" + sudo add-apt-repository -y ppa:nfs-ganesha/nfs-ganesha-"$GANESHA_PPA_VERSION" + ;; + esac + sudo apt-get -y update + elif is_fedora; then + local repo="" + case $GANESHA_RELEASE in + 3.*) + repo="centos-release-nfs-ganesha30" + ;; + *) + repo="centos-release-nfs-ganesha5" + ;; + esac + sudo dnf -y install ${repo} + fi +} + +function install_nfs_ganesha { + configure_repo_nfsganesha + NFS_GANESHA_PACKAGES="nfs-ganesha nfs-ganesha-ceph \ + nfs-ganesha-rados-urls nfs-ganesha-vfs" + if is_ubuntu; then + LIBNTIRPC_PACKAGE="libntirpc${GANESHA_RELEASE:0:1}" + NFS_GANESHA_PACKAGES="${LIBNTIRPC_PACKAGE} ${NFS_GANESHA_PACKAGES}" + fi + install_package $NFS_GANESHA_PACKAGES +} + +function configure_nfs_ganesha { + # Configure NFS-Ganesha to work with Manila's CephFS driver + rados_cmd="sudo rados -p ${CEPHFS_DATA_POOL}" + if [[ "$CEPHADM_DEPLOY" = "True" ]]; then + CEPHADM=${TARGET_BIN}/cephadm + rados_cmd="sudo $CEPHADM shell rados -p ${CEPHFS_DATA_POOL}" + fi + + + sudo mkdir -p /etc/ganesha/export.d + if [ $MANILA_CEPH_GANESHA_RADOS_STORE == 'True' ]; then + # Create an empty placeholder ganesha export index object + echo | $rados_cmd put ganesha-export-index - + cat </dev/null + RADOS_URLS { + ceph_conf = ${CEPH_CONF_FILE}; + userid = admin; +} + +CACHEINODE { + Dir_Max = 1; + Dir_Chunk = 0; + + Cache_FDs = false; + + NParts = 1; + Cache_Size = 1; +} + +EXPORT_DEFAULTS { + Attr_Expiration_Time = 0; +} + +%url rados://${CEPHFS_DATA_POOL}/ganesha-export-index +EOF + else + sudo touch /etc/ganesha/export.d/INDEX.conf + echo "%include /etc/ganesha/export.d/INDEX.conf" | sudo tee /etc/ganesha/ganesha.conf + fi +} + +function start_nfs_ganesha { + # NFS-Ganesha server cannot run alongwith with other kernel NFS server. + sudo systemctl stop nfs-server || true + sudo systemctl disable nfs-server || true + sudo systemctl enable nfs-ganesha + sudo systemctl start nfs-ganesha || ( + echo "Ganesha didn't start. Let's debug..." >&2 + sudo systemctl status nfs-ganesha || true + echo "**Ganesha conf file**" >&2 + sudo cat /etc/ganesha/ganesha.conf || true + echo "**Ganesha log file**" >&2 + sudo cat /var/log/ganesha/ganesha.log || true + echo "**Exiting**" >&2 + exit 1 + ) + echo "Standalone NFS-Ganesha started successfully!" >&2 +} + +function stop_nfs_ganesha { + sudo systemctl stop nfs-ganesha + sudo systemctl disable nfs-ganesha +} + +function cleanup_nfs_ganesha { + sudo systemctl stop nfs-ganesha + sudo systemctl disable nfs-ganesha + sudo uninstall_package nfs-ganesha nfs-ganesha-ceph libntirpc3 nfs-ganesha-rados-urls nfs-ganesha-vfs +} + +# cleanup_repo_nfsganesha() - Remove NFS Ganesha repositories +# Usage: cleanup_repo_nfsganesha +function cleanup_repo_nfsganesha { + if is_ubuntu; then + sudo rm -rf "/etc/apt/sources.list.d/nfs-ganesha-ubuntu*" + elif is_fedora; then + sudo rm -rf /etc/yum.repos.d/nfs-ganesha.repo + fi +} diff --git a/devstack/settings b/devstack/settings index 01f74a7..ef9e4db 100644 --- a/devstack/settings +++ b/devstack/settings @@ -62,16 +62,16 @@ if (is_ceph_enabled_for_service manila); then MANILA_OPTGROUP_cephfsnfs1_cephfs_conf_path=${CEPH_CONF_FILE} MANILA_OPTGROUP_cephfsnfs1_cephfs_auth_id=${MANILA_CEPH_USER} MANILA_OPTGROUP_cephfsnfs1_cephfs_protocol_helper_type=NFS - MANILA_OPTGROUP_cephfsnfs1_cephfs_ganesha_server_ip=$HOST_IP - MANILA_CEPH_GANESHA_RADOS_STORE=$(trueorfalse False MANILA_CEPH_GANESHA_RADOS_STORE) - if [ "$MANILA_CEPH_GANESHA_RADOS_STORE" = "True" ]; then - MANILA_OPTGROUP_cephfsnfs1_ganesha_rados_store_enable=${MANILA_CEPH_GANESHA_RADOS_STORE} - MANILA_OPTGROUP_cephfsnfs1_ganesha_rados_store_pool_name=${CEPHFS_DATA_POOL} - fi - - if [ "$CEPHADM_DEPLOY" = "True" ]; then + if [[ $CEPHADM_DEPLOY_NFS == "True" ]]; then MANILA_OPTGROUP_cephfsnfs1_cephfs_nfs_cluster_id=${FSNAME} + else + MANILA_OPTGROUP_cephfsnfs1_cephfs_ganesha_server_ip=$HOST_IP + MANILA_CEPH_GANESHA_RADOS_STORE=$(trueorfalse False MANILA_CEPH_GANESHA_RADOS_STORE) + if [ "$MANILA_CEPH_GANESHA_RADOS_STORE" = "True" ]; then + MANILA_OPTGROUP_cephfsnfs1_ganesha_rados_store_enable=${MANILA_CEPH_GANESHA_RADOS_STORE} + MANILA_OPTGROUP_cephfsnfs1_ganesha_rados_store_pool_name=${CEPHFS_DATA_POOL} + fi fi fi fi From 1ec8a65ede4fc413a5b2933d50251659ca338170 Mon Sep 17 00:00:00 2001 From: OpenStack Release Bot Date: Fri, 31 Oct 2025 11:55:08 +0000 Subject: [PATCH 7/7] Update .gitreview for unmaintained/2024.1 Change-Id: Ia0ee7e3b2cd2d25e8924771a0033e3a33872fbe7 Signed-off-by: OpenStack Release Bot Generated-By: openstack/project-config:roles/copy-release-tools-scripts/files/release-tools/functions --- .gitreview | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitreview b/.gitreview index 0ba5cb7..95ca1fe 100644 --- a/.gitreview +++ b/.gitreview @@ -2,4 +2,4 @@ host=review.opendev.org port=29418 project=openstack/devstack-plugin-ceph.git -defaultbranch=stable/2024.1 +defaultbranch=unmaintained/2024.1