From adafee99798f561d2ca75683d23efd881833abf2 Mon Sep 17 00:00:00 2001 From: jgilaber Date: Fri, 10 Oct 2025 09:30:39 +0200 Subject: [PATCH] [DNM] Configure nfs server with 2 backends for tests Configure two different backends with different backend_volume_name to be able to run migration tests and check if they will work without assuming that multiple pools are placed within the same cinder backend. Depends-On: https://review.opendev.org/c/openstack/watcher/+/963857 Depends-On: https://review.opendev.org/c/openstack/watcher-tempest-plugin/+/963860 --- ci/playbooks/cinder-nfs-enable.yaml | 10 +++++++--- .../templates/cinder-volume-nfs-secrets.yaml.j2 | 2 +- ci/playbooks/templates/nfs_backend.yaml.j2 | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ci/playbooks/cinder-nfs-enable.yaml b/ci/playbooks/cinder-nfs-enable.yaml index f683375e..3bf4b109 100644 --- a/ci/playbooks/cinder-nfs-enable.yaml +++ b/ci/playbooks/cinder-nfs-enable.yaml @@ -7,6 +7,9 @@ _cinder_nfs_secret_files: - cinder-volume-nfs-secrets.yaml - cinder-volume-nfs-secrets-2.yaml + _cinder_nfs_backends: + - nfs + - nfs-2 tasks: - name: Ensure the kustomizations dir exists ansible.builtin.file: @@ -39,16 +42,17 @@ ansible.builtin.template: dest: "{{ cifmw_controlplane_kustomizations_path }}/cinder-backup-nfs-sercrets.yaml" src: "cinder-backup-nfs-secrets.yaml.j2" - mode: '640' + mode: "640" - name: Create the definition of the secrets vars: share: "{{ cifmw_nfs_shares[indx] }}" name: "{{ filename | splitext | first }}" + backend_name: "{{ _cinder_nfs_backends[indx] }}" ansible.builtin.template: dest: "{{ cifmw_controlplane_kustomizations_path }}/{{ filename }}" src: "cinder-volume-nfs-secrets.yaml.j2" - mode: '640' + mode: "640" loop: "{{ _cinder_nfs_secret_files }}" loop_control: loop_var: filename @@ -70,7 +74,7 @@ ansible.builtin.template: dest: "{{ cifmw_controlplane_kustomizations_path }}/nfs_backend.yaml" src: "nfs_backend.yaml.j2" - mode: '640' + mode: "640" # FIXME: copy with inline content does not support templating, so this should be reworked - name: Create kustomization to really enable NFS shares as backends for cinder and cinder-backup diff --git a/ci/playbooks/templates/cinder-volume-nfs-secrets.yaml.j2 b/ci/playbooks/templates/cinder-volume-nfs-secrets.yaml.j2 index 10d9e507..de9e061c 100644 --- a/ci/playbooks/templates/cinder-volume-nfs-secrets.yaml.j2 +++ b/ci/playbooks/templates/cinder-volume-nfs-secrets.yaml.j2 @@ -9,6 +9,6 @@ metadata: type: Opaque stringData: {{ name }}: | - [nfs] + [{{ backend_name }}] nas_host={{ cifmw_nfs_ip }} nas_share_path={{ '/data/' + share }} diff --git a/ci/playbooks/templates/nfs_backend.yaml.j2 b/ci/playbooks/templates/nfs_backend.yaml.j2 index d21354e2..2548d2fa 100644 --- a/ci/playbooks/templates/nfs_backend.yaml.j2 +++ b/ci/playbooks/templates/nfs_backend.yaml.j2 @@ -29,8 +29,8 @@ spec: networkAttachments: - storage customServiceConfig: | - [nfs] - volume_backend_name=nfs + [nfs-2] + volume_backend_name=nfs-2 volume_driver=cinder.volume.drivers.nfs.NfsDriver nfs_snapshot_support=true nas_secure_file_operations=false