Make Glance storage-init flexible per enabled storage backends

This update enhances the Glance storage-init script to properly handle
multiple storage backends.
Backends such as file, cinder, and pvc—commonly used for NetApp
NFS/iSCSI bypass Ceph initialization and emit an informational
message.

The existing Ceph (rbd) bootstrap logic remains unchanged and is
executed only when rbd is the selected backend, ensuring correct
behavior in both single-backend and mixed-backend deployments.

TEST PLAN:
All tests were run on the following environment:
Virtual Environment with AIO-SX + NetApp simulator
PASS - build-pkgs -a -l openstack
PASS - build stx-openstack tarball
PASS - application upload, apply and remove
PASS - apply on Ceph only: ceph bootstrapped, netapp logic skipped and
       an openstack image must be created
PASS - apply on NetApp only: ceph logic skipped, show netapp message
       and an openstack image must be created
PASS - apply on Ceph and NetApp: ceph bootstrapped, show netapp message
       and an openstack image must be created

Story: 2011281
Task: 53510

Related-to: e95311b336
Related-to: f24abb1d2f
Related-to: e95311b336

Change-Id: I876b8687885d5a446d20ded8a187fe9d2a2c1526
Signed-off-by: Thiago Miranda <tmarques@windriver.com>
This commit is contained in:
Thiago Miranda
2025-12-23 08:33:23 -03:00
parent 4aa5675751
commit c7a10d5ffb
2 changed files with 34 additions and 0 deletions
@@ -0,0 +1,33 @@
From dc2d4dae1df45be1d0a6f27b1bd3edf72ae355e2 Mon Sep 17 00:00:00 2001
From: Thiago Miranda <tmarques@windriver.com>
Date: Mon, 22 Dec 2025 18:38:00 -0300
Subject: [PATCH] Add backend checks to skip Ceph init for NetApp storage
Introduce conditional logic to skip Ceph initialization when using
NetApp backends (file, cinder, or pvc).
The script now prints an informational message and only runs the Ceph
bootstrap when the backend is rbd.
Signed-off-by: Thiago Miranda <tmarques@windriver.com>
---
glance/templates/bin/_storage-init.sh.tpl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/glance/templates/bin/_storage-init.sh.tpl b/glance/templates/bin/_storage-init.sh.tpl
index f780ff9e8..53ba9f155 100644
--- a/glance/templates/bin/_storage-init.sh.tpl
+++ b/glance/templates/bin/_storage-init.sh.tpl
@@ -30,8 +30,8 @@ if [[ "$SCHEME" == "https" && -f /etc/ssl/certs/openstack-helm.crt ]]; then
fi
set -ex
-if [ "x$STORAGE_BACKEND" == "xpvc" ]; then
- echo "No action required."
+if [ "x$STORAGE_BACKEND" == "xfile" ] || [ "x$STORAGE_BACKEND" == "xpvc" ]; then
+ echo "INFO: No action required to use $STORAGE_BACKEND backend."
elif [ "x$STORAGE_BACKEND" == "xswift" ]; then
: ${OS_INTERFACE:="internal"}
OS_TOKEN="$(openstack token issue -f value -c id)"
--
2.34.1
@@ -29,3 +29,4 @@
0029-Add-DEX-integration.patch
0030-Add-Netapp-backend-support-to-Cinder.patch
0031-Update-glance-store-config.patch
0032-Add-backend-checks-to-skip-Ceph-init-for-NetApp-stor.patch