Control ceph loopback devices path

This PS adds control over location of Ceph loopback devices path.

Change-Id: Ib0738c1127ff37633cdd035b3978cc137c5eaf71
This commit is contained in:
Sergiy Markin 2023-10-25 19:30:27 +00:00
parent cdfb3ce6a4
commit a430d16bd5
7 changed files with 15 additions and 21 deletions

View File

@ -33,20 +33,4 @@
EXTRA_VOLUME_MOUNT_POINT: "{{ extra_volume.mount_point }}"
EXTRA_VOLUME_SIZE: "{{ extra_volume.size }}"
EXTRA_VOLUME_TYPE: "{{ extra_volume.type }}"
- name: Print configured docker root path
debug:
msg: "Docker root_path: {{ docker.root_path }}"
- name: Print configured containerd root path
debug:
msg: "containerd root_path: {{ containerd.root_path }}"
- name: Create mountpoints
shell: |
sudo mkdir -pv "${DOCKER_ROOT_PATH}"
sudo mkdir -pv "${CONTAINERD_ROOT_PATH}"
environment:
DOCKER_ROOT_PATH: "{{ docker.root_path }}"
CONTAINERD_ROOT_PATH: "{{ containerd.root_path }}"
...

View File

@ -11,6 +11,8 @@
# limitations under the License.
---
ceph:
loopback_path: "/var/lib/openstack-helm"
osh_params:
container_distro_name: ubuntu
container_distro_version: focal

View File

@ -23,6 +23,7 @@
args:
chdir: "{{ zuul.project.src_dir }}/{{ gate_scripts_relative_path }}"
environment:
CEPH_LOOPBACK_PATH: "{{ ceph.loopback_path }}"
zuul_site_mirror_fqdn: "{{ zuul_site_mirror_fqdn }}"
OSH_EXTRA_HELM_ARGS: "{{ zuul_osh_extra_helm_args_relative_path | default('') }}"
OSH_PATH: "{{ zuul_osh_relative_path | default('../openstack-helm/') }}"

View File

@ -11,6 +11,8 @@
# limitations under the License.
---
ceph:
loopback_path: "/var/lib/openstack-helm"
osh_params:
container_distro_name: ubuntu
container_distro_version: focal

View File

@ -20,6 +20,7 @@
args:
chdir: "{{ zuul.project.src_dir }}/{{ gate_scripts_relative_path }}"
environment:
CEPH_LOOPBACK_PATH: "{{ ceph.loopback_path }}"
zuul_site_mirror_fqdn: "{{ zuul_site_mirror_fqdn }}"
OSH_EXTRA_HELM_ARGS: "{{ zuul_osh_extra_helm_args_relative_path | default('') }}"
OSH_PATH: "{{ zuul_osh_relative_path | default('../openstack-helm/') }}"

View File

@ -2,13 +2,15 @@
set -ex
: ${CEPH_LOOPBACK_PATH:="/var/lib/openstack-helm"}
function setup_loopback_devices() {
osd_data_device="$1"
osd_wal_db_device="$2"
namespace=${CEPH_NAMESPACE}
sudo mkdir -p /var/lib/openstack-helm/$namespace
sudo truncate -s 10G /var/lib/openstack-helm/$namespace/ceph-osd-data-loopbackfile.img
sudo truncate -s 8G /var/lib/openstack-helm/$namespace/ceph-osd-db-wal-loopbackfile.img
sudo mkdir -p ${CEPH_LOOPBACK_PATH}/$namespace
sudo truncate -s 10G ${CEPH_LOOPBACK_PATH}/$namespace/ceph-osd-data-loopbackfile.img
sudo truncate -s 8G ${CEPH_LOOPBACK_PATH}/$namespace/ceph-osd-db-wal-loopbackfile.img
sudo -E bash -c "cat <<EOF > /etc/systemd/system/loops-setup.service
[Unit]
Description=Setup loop devices
@ -20,8 +22,8 @@ Requires=systemd-udevd.service
[Service]
Type=oneshot
ExecStart=/sbin/losetup $osd_data_device '/var/lib/openstack-helm/$namespace/ceph-osd-data-loopbackfile.img'
ExecStart=/sbin/losetup $osd_wal_db_device '/var/lib/openstack-helm/$namespace/ceph-osd-db-wal-loopbackfile.img'
ExecStart=/sbin/losetup $osd_data_device '${CEPH_LOOPBACK_PATH}/$namespace/ceph-osd-data-loopbackfile.img'
ExecStart=/sbin/losetup $osd_wal_db_device '${CEPH_LOOPBACK_PATH}/$namespace/ceph-osd-db-wal-loopbackfile.img'
ExecStop=/sbin/losetup -d $osd_data_device
ExecStop=/sbin/losetup -d $osd_wal_db_device
TimeoutSec=60

View File

@ -91,6 +91,8 @@
root_path: "/opt/ext_vol/docker"
containerd:
root_path: "/opt/ext_vol/containerd"
ceph:
loopback_path: "/opt/ext_vol/openstack-helm"
# the k8s package versions are available here
# https://packages.cloud.google.com/apt/dists/kubernetes-xenial/main/binary-amd64/Packages
kube_version: "1.26.3-00"