From 8ca2d9e9e65845687214b0e661352a78f1049d98 Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Tue, 20 Aug 2024 18:39:35 -0700 Subject: [PATCH] Fix default volume type configuration --- etc/kolla/config/cinder/cinder-api.conf | 2 ++ etc/kolla/config/cinder/cinder-volume.conf | 2 ++ etc/kolla/config/cinder/cinder.conf | 2 -- install.sh | 1 + scripts/cinder.sh | 24 ++++++++++++++++++++++ 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 etc/kolla/config/cinder/cinder-api.conf create mode 100644 etc/kolla/config/cinder/cinder-volume.conf delete mode 100644 etc/kolla/config/cinder/cinder.conf create mode 100755 scripts/cinder.sh diff --git a/etc/kolla/config/cinder/cinder-api.conf b/etc/kolla/config/cinder/cinder-api.conf new file mode 100644 index 000000000..b6a7eb46e --- /dev/null +++ b/etc/kolla/config/cinder/cinder-api.conf @@ -0,0 +1,2 @@ +[DEFAULT] +default_volume_type = lvm-1 diff --git a/etc/kolla/config/cinder/cinder-volume.conf b/etc/kolla/config/cinder/cinder-volume.conf new file mode 100644 index 000000000..b6a7eb46e --- /dev/null +++ b/etc/kolla/config/cinder/cinder-volume.conf @@ -0,0 +1,2 @@ +[DEFAULT] +default_volume_type = lvm-1 diff --git a/etc/kolla/config/cinder/cinder.conf b/etc/kolla/config/cinder/cinder.conf deleted file mode 100644 index 1c7b407db..000000000 --- a/etc/kolla/config/cinder/cinder.conf +++ /dev/null @@ -1,2 +0,0 @@ -[DEFAULT] -default_volume_type = iscsi diff --git a/install.sh b/install.sh index 7a288b6e4..67d039636 100755 --- a/install.sh +++ b/install.sh @@ -146,6 +146,7 @@ if [ "${OS_KOLLA_RUN_INIT:-true}" == "true" ]; then source /etc/kolla/admin-openrc.sh curl -fsSL "https://raw.githubusercontent.com/openstack/kolla-ansible/${OS_KOLLA_VERSION:-stable/2024.1}/tools/init-runonce" | bash + [ "${OS_KOLLA_ENABLE_CINDER:-yes}" == "yes" ] && ./scripts/cinder.sh [ "${OS_KOLLA_ENABLE_MAGNUM:-no}" == "yes" ] && ./scripts/magnum.sh [ "${OS_KOLLA_ENABLE_NEUTRON_TRUNK:-yes}" == "yes" ] && ./scripts/neutron_trunk.sh fi diff --git a/scripts/cinder.sh b/scripts/cinder.sh new file mode 100755 index 000000000..6ac834a26 --- /dev/null +++ b/scripts/cinder.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2024 +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +set -o nounset +set -o pipefail +set -o errexit +if [[ ${OS_DEBUG:-false} == "true" ]]; then + export PKG_DEBUG=true + set -o xtrace +fi + +os_cinder_volume_type="lvm-1" + +if ! openstack volume type list | grep -q "$os_cinder_volume_type"; then + openstack volume type create "$os_cinder_volume_type" \ + --property volume_backend_name="$os_cinder_volume_type" +fi