permit to use multiple cinder nfs_share

Bug #2012784 reported by Cyril Lopez
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
kolla-ansible
Triaged
Low
Unassigned

Bug Description

If we want to setup several different NFS backend like netapp ontap NFS and a vanilla NFS, we will need several different nfs_shares file

By default kolla-ansible set in backend configuration nfs_shares_config = /etc/cinder/nfs_shares [1]. This can be override but only /etc/kolla/cinder-volume/nfs_shares [2] is copied in the container.

If we set all NFS share in this file, each backend driver will try to manage both NFS share and it doesn't work

I propose to copy each file *_share set in config/cinder to let user use several NFS backend.

[1] https://docs.openstack.org/cinder/queens/configuration/block-storage/drivers/nfs-volume-driver.html
[2] https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/cinder/templates/cinder-volume.json.j2#L25

Changed in kolla-ansible:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Evgeny Zhuravlev (ezhuravlev) wrote :

The same problem.
We need several NetApp backends on the single host.
Kolla can't handle this scenario.

Wrote a WA for that

## /usr/local/share/kolla-ansible/ansible/roles/cinder/tasks/config.yml
--------------------------------

- name: Find all nfs_shares config files
  become: true
  find:
    paths:
      - "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/"
    pattern: "nfs_shares*"
    file_type: file
  delegate_to: localhost
  register: "shares_config_files"

- name: Copying over nfs_shares files for cinder_volume
  become: true
  template:
    src: "{{ item.path }}"
    dest: "{{ node_config_directory }}/cinder-volume/"
    mode: "0660"
  loop: "{{ shares_config_files.files }}"
  when: inventory_hostname in groups['cinder-volume']
  notify:
    - Restart cinder-volume container

## /usr/local/share/kolla-ansible/ansible/roles/cinder/templates/cinder-volume.json.j2
--------------------------------
        {
            "source": "{{ container_config_directory }}/nfs_shares*",
            "dest": "/etc/cinder/",
            "owner": "cinder",
            "perm": "0600",
            "optional": {{ (not enable_cinder_backend_nfs | bool) | string | lower }}
        }

It will copy all nfs_shares* from deploy host /etc/kolla/cinder/<host>/ to cinder-volume container /etc/cinder

It works for our purposes fine.

Hope kolla dev team will find some useful here and include this options in some of future releases.

Regards :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.