Add support to configure Huawei backends in Cinder

This change adds the ability to configure Huawei backends in Cinder
as described in [1] by adding the additional configuration XML files
to the cinder-volume containers. However, this change does not
provide the default configuration options for the cinder.conf due to
the wide range of Huawei hardware that is supported. Operators may
also wish to configure multiple backends, so they should use the
standard method of overriding backend sections to use these XML
files, as described in [2].

1. https://docs.openstack.org/cinder/latest/configuration/block-storage/drivers/huawei-storage-driver.html
2. https://docs.openstack.org/kolla-ansible/latest/admin/advanced-configuration.html#openstack-service-configuration-in-kolla

Implements: blueprint cinder-huawei-backend
Co-Authored-By: Juan Pablo Suazo <jsuazo@whitestack.com>
Co-Authored-By: Maksim Malchuk <maksim.malchuk@gmail.com>
Change-Id: Ic8624b2e956b1f48f5fb96d6d8a0150b67236d20
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
This commit is contained in:
Maksim Malchuk 2024-09-22 01:53:11 +03:00
parent 7a9b0db708
commit 8dccbeee1f
5 changed files with 38 additions and 2 deletions

View File

@ -1050,6 +1050,8 @@ gnocchi_metric_datadir_volume: "gnocchi"
# Cinder options
#################################
cinder_backend_ceph: "no"
cinder_backend_huawei: "no"
cinder_backend_huawei_xml_files: []
cinder_backend_vmwarevc_vmdk: "no"
cinder_backend_vmware_vstorage_object: "no"
cinder_volume_group: "cinder-volumes"

View File

@ -9,6 +9,12 @@
become: true
with_dict: "{{ cinder_services | select_services_enabled_and_mapped_to_host }}"
- include_tasks: external_huawei.yml
when:
- cinder_backend_huawei | bool
- cinder_backend_huawei_xml_files | length > 0
- inventory_hostname in groups['cinder-volume']
- include_tasks: external_ceph.yml
when:
- cinder_backend_ceph | bool

View File

@ -0,0 +1,11 @@
---
- name: Copying over Huawei XML files
copy:
src: "{{ node_custom_config }}/cinder/{{ item }}"
dest: "{{ node_config_directory }}/cinder-volume/{{ item }}"
mode: "0660"
become: true
with_items:
- "{{ cinder_backend_huawei_xml_files }}"
notify:
- Restart cinder-volume container

View File

@ -6,13 +6,20 @@
"dest": "/etc/cinder/cinder.conf",
"owner": "cinder",
"perm": "0600"
}{% if cinder_backend_ceph | bool %},
},{% if cinder_backend_huawei | bool and cinder_backend_huawei_xml_files | length > 0 %}{% for file in cinder_backend_huawei_xml_files %}
{
"source": "{{ container_config_directory }}/{{ file }}",
"dest": "/etc/cinder/{{ file }}",
"owner": "cinder",
"perm": "0600",
"optional": {{ (not cinder_backend_huawei | bool) | string | lower }}
},{% endfor%}{% endif %}{% if cinder_backend_ceph | bool %}
{
"source": "{{ container_config_directory }}/ceph",
"dest": "/etc/ceph",
"owner": "cinder",
"perm": "0600"
}{% endif %},
},{% endif %}
{
"source": "{{ container_config_directory }}/nfs_shares",
"dest": "/etc/cinder/nfs_shares",

View File

@ -0,0 +1,10 @@
---
features:
- |
Add support to configure Huawei backends in Cinder.
The extra configuration XML files provided by
``cinder_backend_huawei_xml_files`` copied into cinder-volume containers
during deploy when ``cinder_backend_huawei`` is true.
`Blueprint cinder-huawei-backend
<https://blueprints.launchpad.net/kolla-ansible/+spec/cinder-huawei-backend>`__