diff --git a/ansible/roles/manila/defaults/main.yml b/ansible/roles/manila/defaults/main.yml index 48b703b995..5beabe1351 100644 --- a/ansible/roles/manila/defaults/main.yml +++ b/ansible/roles/manila/defaults/main.yml @@ -276,6 +276,13 @@ manila_ks_users: password: "{{ manila_keystone_password }}" role: "admin" + +#################### +# CephFS +#################### +manila_cephfs_filesystem_name: "" + + #################### # Glusterfs #################### diff --git a/ansible/roles/manila/tasks/deploy.yml b/ansible/roles/manila/tasks/deploy.yml index 7f092432bf..0e342217f5 100644 --- a/ansible/roles/manila/tasks/deploy.yml +++ b/ansible/roles/manila/tasks/deploy.yml @@ -12,8 +12,3 @@ - name: Flush handlers meta: flush_handlers - -- include_tasks: fix_cephfs_owner.yml - when: - - enable_manila_backend_cephfs_native | bool - - inventory_hostname in groups['manila-share'] diff --git a/ansible/roles/manila/tasks/fix_cephfs_owner.yml b/ansible/roles/manila/tasks/fix_cephfs_owner.yml deleted file mode 100644 index 17c8de2188..0000000000 --- a/ansible/roles/manila/tasks/fix_cephfs_owner.yml +++ /dev/null @@ -1,85 +0,0 @@ ---- -- name: Check /tmp/cephfs path - become: true - command: "docker exec -u 0 {{ manila_services['manila-share']['container_name'] }} ls /tmp/cephfs/" - register: check_cephfs - changed_when: False - failed_when: check_cephfs.rc != 0 and check_cephfs.stderr.find('No such file or directory') == -1 - run_once: True - -- name: Create /tmp/cephfs path - become: true - command: "docker exec -u 0 {{ manila_services['manila-share']['container_name'] }} mkdir -p /tmp/cephfs" - run_once: True - when: check_cephfs.rc != 0 - -- name: Get monitor dump - become: true - command: docker exec "{{ manila_services['manila-share']['container_name'] }}" ceph mon dump -c /etc/ceph/ceph.conf --name client.manila -f json - register: ceph_monitor_dump - changed_when: False - run_once: True - -- name: Get cephfs addr - vars: - query: mons[*].public_addr - # take only ip and port from public_addr, e.g from public_addr: 10.66.1.5:6789/0 - # use 10.66.1.5:6789 - regex: "[^/]*" - set_fact: - cephfs_addr: "{{ ceph_monitor_dump.stdout | from_json | json_query(query) | map('regex_search', regex) | join(',') }}:/" - run_once: true - -- name: Get cephfs secret - become: true - command: docker exec "{{ manila_services['manila-share']['container_name'] }}" ceph-authtool -p /etc/ceph/ceph.client.manila.keyring -n client.manila - register: manila_keyring - changed_when: False - run_once: True - -- name: Umount cephfs - become: true - command: "docker exec -u 0 {{ manila_services['manila-share']['container_name'] }} umount /tmp/cephfs/" - register: umount_cephfs - changed_when: False - failed_when: False - run_once: True - -- name: Mount cephfs - become: true - command: > - docker exec -u 0 {{ manila_services['manila-share']['container_name'] }} - mount -t ceph {{ cephfs_addr }} /tmp/cephfs -o name=manila,secret={{ manila_keyring.stdout }} - register: mount_cephfs - changed_when: False - run_once: True - -- name: Check volumes path - become: true - command: "docker exec -u 0 {{ manila_services['manila-share']['container_name'] }} ls /tmp/cephfs/volumes" - register: check_volume - changed_when: False - failed_when: False - run_once: True - -- name: Create /tmp/cephfs/volumes path - become: true - command: "docker exec -u 0 {{ manila_services['manila-share']['container_name'] }} mkdir /tmp/cephfs/volumes" - register: create_volume - run_once: True - when: check_volume.rc != 0 - -- name: Change the owner and group of /tmp/cephfs/volumes - become: true - command: "docker exec -u 0 {{ manila_services['manila-share']['container_name'] }} chown manila:manila /tmp/cephfs/volumes" - register: chown_volume - run_once: True - when: check_volume.rc != 0 and create_volume.rc == 0 - -- name: Umount cephfs - become: true - command: "docker exec -u 0 {{ manila_services['manila-share']['container_name'] }} umount /tmp/cephfs" - changed_when: False - register: umount_cephfs - run_once: True - when: mount_cephfs.rc == 0 diff --git a/ansible/roles/manila/templates/manila-share.conf.j2 b/ansible/roles/manila/templates/manila-share.conf.j2 index 5b9a528293..b36bfa8513 100644 --- a/ansible/roles/manila/templates/manila-share.conf.j2 +++ b/ansible/roles/manila/templates/manila-share.conf.j2 @@ -113,7 +113,9 @@ share_driver = manila.share.drivers.cephfs.driver.CephFSDriver cephfs_conf_path = /etc/ceph/ceph.conf cephfs_auth_id = {{ ceph_manila_user }} cephfs_cluster_name = ceph -cephfs_enable_snapshots = False +{% if manila_cephfs_filesystem_name | length %} +cephfs_filesystem_name = {{ manila_cephfs_filesystem_name }} +{% endif %} {% endif %} {% if enable_manila_backend_cephfs_nfs | bool %} @@ -125,7 +127,9 @@ cephfs_protocol_helper_type = NFS cephfs_conf_path = /etc/ceph/ceph.conf cephfs_auth_id = {{ ceph_manila_user }} cephfs_cluster_name = ceph -cephfs_enable_snapshots = False +{% if manila_cephfs_filesystem_name | length %} +cephfs_filesystem_name = {{ manila_cephfs_filesystem_name }} +{% endif %} cephfs_ganesha_server_is_remote= False cephfs_ganesha_server_ip = {{ api_interface_address }} {% endif %} diff --git a/doc/source/reference/storage/external-ceph-guide.rst b/doc/source/reference/storage/external-ceph-guide.rst index b12e569039..ca5c877015 100644 --- a/doc/source/reference/storage/external-ceph-guide.rst +++ b/doc/source/reference/storage/external-ceph-guide.rst @@ -218,6 +218,13 @@ for Ceph includes following steps: #. Copy Ceph configuration file to ``/etc/kolla/config/manila/ceph.conf`` #. Copy Ceph keyring to ``/etc/kolla/config/manila/`` + +#. If using multiple filesystems (Ceph Pacific+), set + ``manila_cephfs_filesystem_name`` in ``/etc/kolla/globals.yml`` to the + name of the Ceph filesystem Manila should use. + By default, Manila will use the first filesystem returned by + the ``ceph fs volume ls`` command. + #. Setup Manila in the usual way For more details on the rest of the Manila setup, such as creating the share diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index c813782549..02c0ac67a8 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -622,6 +622,11 @@ #hnas_evs_ip: #hnas_file_system_name: +# CephFS backend configuration. +# External Ceph FS name. +# By default this is empty to allow Manila to auto-find the first FS available. +#manila_cephfs_filesystem_name: + # Gluster backend configuration # The option of glusterfs share layout can be directory or volume # The default option of share layout is 'volume' diff --git a/releasenotes/notes/support-manila-wallaby-2e29e866af0d6287.yaml b/releasenotes/notes/support-manila-wallaby-2e29e866af0d6287.yaml new file mode 100644 index 0000000000..5502ca3226 --- /dev/null +++ b/releasenotes/notes/support-manila-wallaby-2e29e866af0d6287.yaml @@ -0,0 +1,15 @@ +--- +features: + - | + Adds "manila_cephfs_filesystem_name" variable to support multi-fs + Ceph Pacific+ deloyments. +fixes: + - | + Removes "fix_cephfs_owner.yaml" which related to pre-wallaby Manila's + use of subfolders. Post-wallaby Manila now uses cephfs volumes instead, + as such this file is no longer required. + `LP#1938285 `__ + `LP#1935784 `__ + - | + Removes use of "cephfs_enable_snapshots" in Manila config as this + option was removed from Manila in the Wallaby release.