From 8b93e9d69ddcb2656d3ceb03e308a1a300c8207e Mon Sep 17 00:00:00 2001 From: Mauricio Lima Date: Thu, 5 Jan 2017 13:56:39 -0300 Subject: [PATCH] Allow cinder-volume to be configured to use HNAS nfs Change-Id: I5910da875eba9f9b9a18d27fcb69bb38ad67bad0 --- ansible/group_vars/all.yml | 1 + ansible/roles/cinder/defaults/main.yml | 36 ++++++++++++------- ansible/roles/cinder/tasks/config.yml | 2 +- ansible/roles/cinder/templates/cinder.conf.j2 | 27 ++++++++++---- etc/kolla/globals.yml | 1 + ...inder-volume-backend-7b860e17c70dcb2c.yaml | 3 ++ 6 files changed, 50 insertions(+), 20 deletions(-) create mode 100644 releasenotes/notes/add-hnas-nfs-as-cinder-volume-backend-7b860e17c70dcb2c.yaml diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index f20bcef4c9..f37484112a 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -266,6 +266,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 fb41803d67..80a7a7d452 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -125,15 +125,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 b0c27f1f0f..aa53aa4da8 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.