diff --git a/extraconfig/tasks/pacemaker_common_functions.sh b/extraconfig/tasks/pacemaker_common_functions.sh index 367f50d76f..eb004070f1 100755 --- a/extraconfig/tasks/pacemaker_common_functions.sh +++ b/extraconfig/tasks/pacemaker_common_functions.sh @@ -383,3 +383,65 @@ worfklow. Exiting." exit 1 fi } + +# This function tries to resolve an RPM dependency issue that can arise when +# updating ceph packages on nodes that do not run the ceph-osd service. These +# nodes do not require the ceph-osd package, and updates will fail if the +# ceph-osd package cannot be updated because it's not available in any enabled +# repo. The dependency issue is resolved by removing the ceph-osd package from +# nodes that don't require it. +# +# No change is made to nodes that use the ceph-osd service (e.g. ceph storage +# nodes, and hyperconverged nodes running ceph-osd and compute services). The +# ceph-osd package is left in place, and the currently enabled repos will be +# used to update all ceph packages. +function yum_pre_update { + echo "Checking for ceph-osd dependency issues" + + # No need to proceed if the ceph-osd package isn't installed + if ! rpm -q ceph-osd >/dev/null 2>&1; then + echo "ceph-osd package is not installed" + return + fi + + # Do not proceed if there's any sign that the ceph-osd package is in use: + # - Are there OSD entries in /var/lib/ceph/osd? + # - Are any ceph-osd processes running? + # - Are there any ceph data disks (as identified by 'ceph-disk') + if [ -n "$(ls -A /var/lib/ceph/osd 2>/dev/null)" ]; then + echo "ceph-osd package is required (there are OSD entries in /var/lib/ceph/osd)" + return + fi + + if [ "$(pgrep -xc ceph-osd)" != "0" ]; then + echo "ceph-osd package is required (there are ceph-osd processes running)" + return + fi + + if ceph-disk list |& grep -q "ceph data"; then + echo "ceph-osd package is required (ceph data disks detected)" + return + fi + + # Get a list of all ceph packages available from the currently enabled + # repos. Use "--showduplicates" to ensure the list includes installed + # packages that happen to be up to date. + local ceph_pkgs="$(yum list available --showduplicates 'ceph-*' |& awk '/^ceph/ {print $1}' | sort -u)" + + # No need to proceed if no ceph packages are available from the currently + # enabled repos. + if [ -z "$ceph_pkgs" ]; then + echo "ceph packages are not available from any enabled repo" + return + fi + + # No need to proceed if the ceph-osd package *is* available + if [[ $ceph_pkgs =~ ceph-osd ]]; then + echo "ceph-osd package is available from an enabled repo" + return + fi + + echo "ceph-osd package is not required, but is preventing updates to other ceph packages" + echo "Removing ceph-osd package to allow updates to other ceph packages" + yum -y remove ceph-osd +} diff --git a/extraconfig/tasks/yum_update.sh b/extraconfig/tasks/yum_update.sh index a2a04e8e41..c0c92a601a 100755 --- a/extraconfig/tasks/yum_update.sh +++ b/extraconfig/tasks/yum_update.sh @@ -85,6 +85,9 @@ fi # special case https://bugs.launchpad.net/tripleo/+bug/1635205 +bug/1669714 special_case_ovs_upgrade_if_needed +# Resolve any RPM dependency issues before attempting the update +yum_pre_update + if [[ "$pacemaker_status" == "active" ]] ; then echo "Pacemaker running, stopping cluster node and doing full package update" node_count=$(pcs status xml | grep -o "" | grep -o 'number="[0-9]*"' | grep -o "[0-9]*") diff --git a/puppet/services/ceph-base.yaml b/puppet/services/ceph-base.yaml index f6573f6cd7..8debf8c74b 100644 --- a/puppet/services/ceph-base.yaml +++ b/puppet/services/ceph-base.yaml @@ -99,7 +99,6 @@ outputs: ceph::params::packages: - ceph-base - ceph-mon - - ceph-osd # NOTE: bind IP is found in Heat replacing the network name with the local node IP # for the given network; replacement examples (eg. for internal_api): # internal_api -> IP @@ -152,3 +151,9 @@ outputs: list_join: ['.', ['client', {get_param: CephClientUserName}]] MANILA_CLIENT_KEY: list_join: ['.', ['client', {get_param: ManilaCephFSNativeCephFSAuthId}]] + service_config_settings: + ceph_osd: + ceph::params::packages: + - ceph-base + - ceph-mon + - ceph-osd