Files
openstack-armada-app/openstack-helm/debian/deb_folder/patches/0013-Support-ceph-dev-version-during-pool-creation.patch
Daniel Caires 5b3917befd Upversion base OSH to Caracal-3013cbc9
This task aims to Upversion base OSH to Caracal (3013cbc9)

This change upversions the base commit SHA for openstack-helm
to the Caracal version. Because upstream OSH does not track
versions the same way Openstack does, the base commit [1] was
chosen after the caracal release date and the stability of the
changes in the upstream repo.

It also ports all StarlingX specific patches on top of it,
dropping the patches that are no longer necessary and updating
what needs to be updated in order to be applied on top of the
new base SHA.

Patches 0002, 0009, 0019 and 0022 had their changes merged
on the upstream OSH repo, therefore they were dropped in this
upversion.

Patch 0003 was also removed since a similar job was created
upstream. It remains a point of attention because altough
a similar job was created upstream there are some differences
between them. Patch 0012 was dropped as it only modified the
file created by the patch 0003.

Most of patch 0020 was merged upstream, because of that the size
of the patch was significantly reduced.

All static overrides had the dep_check image added, this image
was already present on the values file upstream but was not being
exposed on the static overrides.

In the Neutron Helm chart, some additional images were added. Most
of the images that were not previously used by STX-O were set as "null"
in the static overrides. The rpc_server proved to be necessary for the
deployment. Similarly, the Nova Helm chart had some images added and
deleted. The static overrides was updated accordingly.

Test Plan:
PASS - Run downloader to get new OSH version
PASS - Run build-pkgs -c -a -l openstack to rebuild all packages
PASS - OSH is on the Caracal version
PASS - All OSH patches are applied
PASS - STX-O is built

With this change STX-Openstack will stop applying until the all
reviews in the relation chain are merged as well. Because of that,
the Test Plan does not include the apply and proper functioning of
the application. The last review of the relation chain will have a
more torough test plan. In order for the build not to be broken, all
reviews in the relation chain should be merged together.

Story: 2011303
Task: 51429

[1] - 3013cbc94a

Change-Id: I988051a73c405c0df810cd24e9dc08fa1051faac
Signed-off-by: Daniel Caires <DanielMarques.Caires@windriver.com>
2025-02-17 18:59:31 +00:00

165 lines
7.1 KiB
Diff

From 26a1ed3f2dd64e9d8baa80857c236770915f7350 Mon Sep 17 00:00:00 2001
From: Luan Nunes Utimura <LuanNunes.Utimura@windriver.com>
Date: Mon, 29 May 2023 20:15:58 -0300
Subject: [PATCH] Support ceph dev version during pool creation
It has been observed that, right after applying stx-openstack, an alarm
related to Ceph is being triggered by the platform due to pools not
being associated with the applications using them.
According the official documentation, the pool/application association
is mandatory for Ceph releases equal to or greater than the Luminous
release (12.2.13).
In theory, this is already handled in openstack-helm's helm charts, such
as in Cinder's `storage-init` job. One can even see that it only
performs the association for Ceph major versions >= 12, which matches
the official documentation's requirements.
However, the code in these `storage-init` jobs assumes that `ceph mgr
versions` will always report a numeric version, e.g.:
- `ceph version 14.2.15-2-g7407245e7b \
(7407245e7b329ac9d475f61e2cbf9f8c616505d6) nautilus (stable)`
The problem is that this is not always the case, especially after the
platform was migrated to Debian, which Ceph started to report:
- `ceph version Development (no_version) nautilus (stable)`
As a result, version checks like the one done in Cinder's `storage-init`
job are failing and consequently pools are being created without the
necessary associations.
Therefore, this change updates the storage init scripts for Cinder and
Glance to account for the scenario where a development version of Ceph
is used.
Signed-off-by: Luan Nunes Utimura <LuanNunes.Utimura@windriver.com>
Change-Id: I464f8a1f8dcb0a5c6523647690723517dd1281b4
---
.../templates/bin/_backup-storage-init.sh.tpl | 26 +++++++++++++++++-
cinder/templates/bin/_storage-init.sh.tpl | 26 +++++++++++++++++-
glance/templates/bin/_storage-init.sh.tpl | 27 +++++++++++++++++--
3 files changed, 75 insertions(+), 4 deletions(-)
diff --git a/cinder/templates/bin/_backup-storage-init.sh.tpl b/cinder/templates/bin/_backup-storage-init.sh.tpl
index a50ecb74..1601172a 100644
--- a/cinder/templates/bin/_backup-storage-init.sh.tpl
+++ b/cinder/templates/bin/_backup-storage-init.sh.tpl
@@ -32,8 +32,32 @@ elif [[ $STORAGE_BACKEND =~ 'cinder.backup.drivers.ceph' ]]; then
ceph -s
function ensure_pool () {
ceph osd pool stats $1 || ceph osd pool create $1 $2
- if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -ge 12 ]]; then
+
+ # As of the Luminous release, it is mandatory to enable applications on pools.
+ # To find out if the release is greater than (or equal to) Luminous, just check
+ # if Ceph's major version is >= 12.
+ CEPH_MAJOR_VERSION=$(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1)
+ if [[ $CEPH_MAJOR_VERSION -ge 12 ]]; then
+ ceph osd pool application enable $1 $3
+ else
+ # If Ceph's major version shows as "Development", there is chance that it is
+ # still greater than (or equal to) Luminous. In this case, just check the
+ # release name against the name of releases prior to Luminous.
+ CEPH_RELEASE_NAME=$(ceph mgr versions | awk '/version/{print $5}')
+ CEPH_RELEASES_PRIOR_TO_LUMINOUS=(
+ kraken
+ jewel
+ infernalis
+ hammer
+ giant
+ firefly
+ emperor
+ dumpling
+ )
+ if [[ $CEPH_MAJOR_VERSION -eq "Development" && \
+ !(" ${CEPH_RELEASES_PRIOR_TO_LUMINOUS[*]} " =~ " $CEPH_RELEASE_NAME ") ]]; then
ceph osd pool application enable $1 $3
+ fi
fi
size_protection=$(ceph osd pool get $1 nosizechange | cut -f2 -d: | tr -d '[:space:]')
ceph osd pool set $1 nosizechange 0
diff --git a/cinder/templates/bin/_storage-init.sh.tpl b/cinder/templates/bin/_storage-init.sh.tpl
index 4f945e2c..4d1c28e4 100644
--- a/cinder/templates/bin/_storage-init.sh.tpl
+++ b/cinder/templates/bin/_storage-init.sh.tpl
@@ -29,8 +29,32 @@ if [ "x$STORAGE_BACKEND" == "xcinder.volume.drivers.rbd.RBDDriver" ]; then
ceph -s
function ensure_pool () {
ceph osd pool stats $1 || ceph osd pool create $1 $2
- if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -ge 12 ]]; then
+
+ # As of the Luminous release, it is mandatory to enable applications on pools.
+ # To find out if the release is greater than (or equal to) Luminous, just check
+ # if Ceph's major version is >= 12.
+ CEPH_MAJOR_VERSION=$(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1)
+ if [[ $CEPH_MAJOR_VERSION -ge 12 ]]; then
+ ceph osd pool application enable $1 $3
+ else
+ # If Ceph's major version shows as "Development", there is chance that it is
+ # still greater than (or equal to) Luminous. In this case, just check the
+ # release name against the name of releases prior to Luminous.
+ CEPH_RELEASE_NAME=$(ceph mgr versions | awk '/version/{print $5}')
+ CEPH_RELEASES_PRIOR_TO_LUMINOUS=(
+ kraken
+ jewel
+ infernalis
+ hammer
+ giant
+ firefly
+ emperor
+ dumpling
+ )
+ if [[ $CEPH_MAJOR_VERSION -eq "Development" && \
+ !(" ${CEPH_RELEASES_PRIOR_TO_LUMINOUS[*]} " =~ " $CEPH_RELEASE_NAME ") ]]; then
ceph osd pool application enable $1 $3
+ fi
fi
size_protection=$(ceph osd pool get $1 nosizechange | cut -f2 -d: | tr -d '[:space:]')
ceph osd pool set $1 nosizechange 0
diff --git a/glance/templates/bin/_storage-init.sh.tpl b/glance/templates/bin/_storage-init.sh.tpl
index 0d291fd2..97880d3c 100644
--- a/glance/templates/bin/_storage-init.sh.tpl
+++ b/glance/templates/bin/_storage-init.sh.tpl
@@ -45,9 +45,32 @@ elif [ "x$STORAGE_BACKEND" == "xrbd" ]; then
ceph -s
function ensure_pool () {
ceph osd pool stats "$1" || ceph osd pool create "$1" "$2"
- local test_version
- if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -ge 12 ]]; then
+
+ # As of the Luminous release, it is mandatory to enable applications on pools.
+ # To find out if the release is greater than (or equal to) Luminous, just check
+ # if Ceph's major version is >= 12.
+ CEPH_MAJOR_VERSION=$(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1)
+ if [[ $CEPH_MAJOR_VERSION -ge 12 ]]; then
+ ceph osd pool application enable $1 $3
+ else
+ # If Ceph's major version shows as "Development", there is chance that it is
+ # still greater than (or equal to) Luminous. In this case, just check the
+ # release name against the name of releases prior to Luminous.
+ CEPH_RELEASE_NAME=$(ceph mgr versions | awk '/version/{print $5}')
+ CEPH_RELEASES_PRIOR_TO_LUMINOUS=(
+ kraken
+ jewel
+ infernalis
+ hammer
+ giant
+ firefly
+ emperor
+ dumpling
+ )
+ if [[ $CEPH_MAJOR_VERSION -eq "Development" && \
+ !(" ${CEPH_RELEASES_PRIOR_TO_LUMINOUS[*]} " =~ " $CEPH_RELEASE_NAME ") ]]; then
ceph osd pool application enable $1 $3
+ fi
fi
ceph osd pool set "$1" size "${RBD_POOL_REPLICATION}" --yes-i-really-mean-it
ceph osd pool set "$1" crush_rule "${RBD_POOL_CRUSH_RULE}"
--
2.25.1