Skip to content

Commit

Permalink
cephadm_adopt: create a 'nfs-ganesha' pool
Browse files Browse the repository at this point in the history
When migrating from a cluster with no MDS nodes deployed,
`{{ cephfs_data_pool.name }}` doesn't exist so we need to create a pool
for storing nfs export objects.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1950403

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit bb7d37f)
  • Loading branch information
guits committed May 6, 2021
1 parent 13c02fe commit 610da6f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions infrastructure-playbooks/cephadm-adopt.yml
Expand Up @@ -798,16 +798,26 @@
{{ nfs_file_gw_export | default('') }}
{{ nfs_obj_gw_export | default('') }}
- name: create nfs exports pool
ceph_pool:
name: "{{ nfs_ganesha_export_pool_name | default('nfs-ganesha') }}"
cluster: "{{ cluster }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"

- name: push the new exports in a rados object
command: "{{ rados_cmd }} -p {{ cephfs_data_pool.name }} -N {{ cephfs_data_pool.name }} put conf-nfs.{{ nfs_group_name | default('nfss') }} -"
command: "{{ rados_cmd }} -p {{ nfs_ganesha_export_pool_name | default('nfs-ganesha') }} -N {{ nfs_ganesha_export_namespace | default('nfs-ganesha') }} put conf-nfs.{{ nfs_group_name | default('nfss') }} -"
args:
stdin: "{{ new_export }}"
stdin_add_newline: no
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"

- name: update the placement of nfs hosts
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply nfs {{ nfs_group_name | default('nfss') }} {{ cephfs_data_pool.name }} {{ cephfs_data_pool.name }} --placement='{{ groups.get(nfs_group_name, []) | length }} label:{{ nfs_group_name }}'"
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply nfs {{ nfs_group_name | default('nfss') }} {{ nfs_ganesha_export_pool_name | default('nfs-ganesha') }} {{ nfs_ganesha_export_namespace | default('nfs-ganesha') }} --placement='{{ groups.get(nfs_group_name, []) | length }} label:{{ nfs_group_name }}'"
run_once: true
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
Expand Down

0 comments on commit 610da6f

Please sign in to comment.