Skip to content

Commit

Permalink
Add Manila CephNFS support
Browse files Browse the repository at this point in the history
This patch introduces a set of basic tasks to perform the adoption of
Manila with a CephNFS backend.
Before performing the actual adoption, a new CephNFS cephadm based
cluster must be created. For this reason, the manila_nfs tasks require a
few parameters as input:

1. A new CephNFS VIP where the CephIngress daemon (made by Haproxy and
   keepalived) is created;
2. A set of target nodes where the "nfs" label is added: these nodes are
   supposed to host the new CephNFS cluster and must be different from
   controller nodes that are going to be decommisioned;
3. The TripleO managed Ganesha VIP: this input can be actually retrieved
   by the existing TripleO deployment, but we can gather this input as
   part of the next iteration on this patch

After the new CephNFS cluster is created, it is possible to build
manila-share with the proper configuration.

Signed-off-by: Francesco Pantano <[email protected]>
  • Loading branch information
fmount committed Oct 1, 2024
1 parent c591442 commit 0cf057c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/roles/manila_adoption/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# manila_backend can be 'cephfs' or 'cephnfs'
manila_backend: cephfs
ganesha_default_path: "/etc/ganesha/ganesha.conf"
31 changes: 27 additions & 4 deletions tests/roles/manila_adoption/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
- name: Check the required input when manila_backend is NFS
when: manila_backend == "cephnfs"
block:
- name: set shell vars to connect to controller1
no_log: "{{ use_no_log }}"
ansible.builtin.set_fact:
controller_ssh: |
CONTROLLER1_SSH="{{ controller1_ssh }}"
- name: Get ceph-nfs IP Address
become: true
ansible.builtin.shell: |
{{ shell_header }}
{{ controller_ssh }}
${CONTROLLER1_SSH} awk -F '[=;]' '/Bind_Addr/ {gsub(/ /, "", $2); print $2}' {{ ganesha_default_path }}
register: cephnfs_vip

- name: Fail if the OLD Ganesha VIP is not a good input value
when:
- not (cephnfs_vip | ansible.builtin.ipaddr)
ansible.builtin.fail:
msg: "The (TRIPLEO) gathered Ganesha server IP is malformed"

- name: Deploy Podified Manila
when: manila_backend == "cephfs" or manila_backend == "cephnfs"
block:
- name: generate CR config based on the selected backend
- name: Generate CR config based on the selected backend
ansible.builtin.template:
src: manila_cephfs.yaml.j2
dest: /tmp/manila_cephfs.yaml
mode: "0600"

- name: deploy podified Manila with cephfs backend
- name: Deploy podified Manila with cephfs backend
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc patch openstackcontrolplane openstack --type=merge --patch-file=/tmp/manila_cephfs.yaml
- name: wait for Manila to start up
- name: Wait for Manila to start up
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
Expand All @@ -25,7 +48,7 @@
retries: 60
delay: 2

- name: check that Manila is reachable and its endpoints are defined
- name: Check that Manila is reachable and its endpoints are defined
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
Expand Down

0 comments on commit 0cf057c

Please sign in to comment.