diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 19e097eb4f..90495fa7a2 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -279,6 +279,7 @@ enable_ceph: "no" enable_ceph_rgw: "no" enable_cinder: "no" enable_cinder_backend_hnas_iscsi: "no" +enable_cinder_backend_hnas_nfs: "no" enable_cinder_backend_iscsi: "no" enable_cinder_backend_lvm: "no" enable_cinder_backend_nfs: "no" diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml index 7d3dddd644..02a79e9cb2 100644 --- a/ansible/roles/cinder/defaults/main.yml +++ b/ansible/roles/cinder/defaults/main.yml @@ -77,20 +77,32 @@ cinder_backends: - name: "nfs-1" driver: "nfs" enabled: "{{ enable_cinder_backend_nfs | bool }}" - - name: "hnas_iscsi" - driver: "iscsi" + - name: "hnas-iscsi" + driver: "hnas_iscsi" enabled: "{{ enable_cinder_backend_hnas_iscsi | bool }}" + - name: "hnas-nfs" + driver: "hnas_nfs" + enabled: "{{ enable_cinder_backend_hnas_nfs | bool }}" cinder_enabled_backends: "{{ cinder_backends|selectattr('enabled', 'equalto', true)|list }}" -##################### -# HNAS iscsi backend -##################### -hnas_volume_backend_name: "hnas_iscsi_backend" -hnas_username: -hnas_password: -hnas_mgmt_ip0: -hnas_svc0_volume_type: -hnas_svc0_hdp: -hnas_svc0_iscsi_ip: +############################################# +# Hitachi NAS Platform iSCSI and NFS drivers +############################################# +# iscsi +hnas_iscsi_backend: "hnas_iscsi_backend" +hnas_iscsi_username: +hnas_iscsi_password: +hnas_iscsi_mgmt_ip0: +hnas_iscsi_svc0_volume_type: +hnas_iscsi_svc0_hdp: +hnas_iscsi_svc0_ip: + +# nfs +hnas_nfs_backend: "hnas_nfs_backend" +hnas_nfs_username: +hnas_nfs_password: +hnas_nfs_mgmt_ip0: +hnas_nfs_svc0_volume_type: +hnas_nfs_svc0_hdp: diff --git a/ansible/roles/cinder/tasks/config.yml b/ansible/roles/cinder/tasks/config.yml index 49f1879464..db9d42ea13 100644 --- a/ansible/roles/cinder/tasks/config.yml +++ b/ansible/roles/cinder/tasks/config.yml @@ -65,4 +65,4 @@ - "{{ node_custom_config }}/cinder/nfs_shares.j2" - "{{ node_custom_config }}/cinder/cinder-volume/nfs_shares.j2" - "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/nfs_shares.j2" - skip: "{{ not enable_cinder_backend_nfs | bool }}" + skip: "{{ not enable_cinder_backend_nfs | bool and not enable_cinder_backend_hnas_nfs | bool }}" diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index a3a7cf22fe..e873cef400 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -126,15 +126,28 @@ nfs_shares_config = /etc/cinder/nfs_shares {% if enable_cinder_backend_hnas_iscsi | bool %} [hnas-iscsi] volume_driver = cinder.volume.drivers.hitachi.hnas_iscsi.HNASISCSIDriver -volume_backend_name = {{ hnas_volume_backend_name }} -hnas_username = {{ hnas_username }} -hnas_password = {{ hnas_password }} -hnas_mgmt_ip0 = {{ hnas_mgmt_ip0 }} +volume_backend_name = {{ hnas_iscsi_backend }} +hnas_username = {{ hnas_iscsi_username }} +hnas_password = {{ hnas_iscsi_password }} +hnas_mgmt_ip0 = {{ hnas_iscsi_mgmt_ip0 }} hnas_chap_enabled = True -hnas_svc0_volume_type = {{ hnas_svc0_volume_type }} -hnas_svc0_hdp = {{ hnas_svc0_hdp }} -hnas_svc0_iscsi_ip = {{ hnas_svc0_iscsi_ip }} +hnas_svc0_volume_type = {{ hnas_iscsi_svc0_volume_type }} +hnas_svc0_hdp = {{ hnas_iscsi_svc0_hdp }} +hnas_svc0_iscsi_ip = {{ hnas_iscsi_svc0_ip }} +{% endif %} + +{% if enable_cinder_backend_hnas_nfs | bool %} +[hnas-nfs] +volume_driver = cinder.volume.drivers.hitachi.hnas_nfs.HNASNFSDriver +nfs_shares_config = /home/cinder/nfs_shares +volume_backend_name = {{ hnas_nfs_backend }} +hnas_username = {{ hnas_nfs_username }} +hnas_password = {{ hnas_nfs_password }} +hnas_mgmt_ip0 = {{ hnas_nfs_mgmt_ip0 }} + +hnas_svc0_volume_type = {{ hnas_nfs_svc0_volume_type }} +hnas_svc0_hdp = {{ hnas_nfs_svc0_hdp }} {% endif %} [privsep_entrypoint] diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 5f6470eae8..2fea2e80c4 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -124,6 +124,7 @@ kolla_internal_vip_address: "10.10.10.254" #enable_ceph_rgw: "no" #enable_cinder: "no" #enable_cinder_backend_hnas_iscsi: "no" +#enable_cinder_backend_hnas_nfs: "no" #enable_cinder_backend_iscsi: "no" #enable_cinder_backend_lvm: "no" #enable_cinder_backend_nfs: "no" diff --git a/releasenotes/notes/add-hnas-nfs-as-cinder-volume-backend-7b860e17c70dcb2c.yaml b/releasenotes/notes/add-hnas-nfs-as-cinder-volume-backend-7b860e17c70dcb2c.yaml new file mode 100644 index 0000000000..2baa88375f --- /dev/null +++ b/releasenotes/notes/add-hnas-nfs-as-cinder-volume-backend-7b860e17c70dcb2c.yaml @@ -0,0 +1,3 @@ +--- +features: + - Allow cinder-volume to be configured to use HNAS nfs.