From 44f5f5bec8c0633ca1c70d75bebbf1847c608df1 Mon Sep 17 00:00:00 2001 From: Mauricio Lima Date: Mon, 10 Oct 2016 13:21:04 -0300 Subject: [PATCH] Add HNAS as Manila backend Co-Authored-By: Denis Cavalcante Co-Authored-By: Francisco Edigleison Barbosa Change-Id: I986623a2753140acad0e2b7f1838356f00ae36b0 Implements: bp add-hnas-as-manila-backend --- ansible/group_vars/all.yml | 8 +--- ansible/roles/manila/defaults/main.yml | 13 ++++++ .../manila/templates/manila-share.conf.j2 | 40 +++++++++---------- etc/kolla/globals.yml | 12 ++++-- 4 files changed, 43 insertions(+), 30 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 55feff1d5a..fdd4b3de92 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -263,6 +263,8 @@ enable_iscsid: "{{ enable_cinder_backend_iscsi | bool or enable_cinder_backend_l enable_kuryr: "no" enable_magnum: "no" enable_manila: "no" +enable_manila_backend_generic: "no" +enable_manila_backend_hnas: "no" enable_mistral: "no" enable_mongodb: "no" enable_multipathd: "no" @@ -412,9 +414,3 @@ ceph_nova_pool_name: "vms" ceph_erasure_profile: "k=4 m=2 ruleset-failure-domain=host" ceph_rule: "default host {{ 'indep' if ceph_pool_type == 'erasure' else 'firstn' }}" ceph_cache_rule: "cache host firstn" - - -####################################### -# Manila - Shared File Systems Options -####################################### -driver_handles_share_servers: "True" diff --git a/ansible/roles/manila/defaults/main.yml b/ansible/roles/manila/defaults/main.yml index 9f68ef5b26..05d7b833ac 100644 --- a/ansible/roles/manila/defaults/main.yml +++ b/ansible/roles/manila/defaults/main.yml @@ -42,3 +42,16 @@ manila_service_instance_user: "manila" manila_service_instance_password: "manila" openstack_manila_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" + +#################### +# Manila +#################### +manila_backends: + - name: "generic" + driver: "generic" + enabled: "{{ enable_manila_backend_generic | bool }}" + - name: "hnas1" + driver: "hnas" + enabled: "{{ enable_manila_backend_hnas | bool }}" + +manila_enabled_backends: "{{ manila_backends|selectattr('enabled', 'equalto', true)|list }}" diff --git a/ansible/roles/manila/templates/manila-share.conf.j2 b/ansible/roles/manila/templates/manila-share.conf.j2 index 1bca31cc80..69322cfbfb 100644 --- a/ansible/roles/manila/templates/manila-share.conf.j2 +++ b/ansible/roles/manila/templates/manila-share.conf.j2 @@ -1,10 +1,8 @@ [DEFAULT] -# Following opt is used for definition of share backends that should be enabled. -# Values are conf groupnames that contain per manila-share service opts. -enabled_share_backends = generic +{% if manila_enabled_backends %} +enabled_share_backends = {{ manila_enabled_backends|map(attribute='name')|join(',') }} +{% endif %} -# Manila requires 'share-type' for share creation. -# So, set here name of some share-type that will be used by default. default_share_type = default_share_type [cinder] @@ -44,33 +42,33 @@ username = {{ neutron_keystone_user }} password = {{ neutron_keystone_password }} memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %} +{% if enable_manila_backend_generic | bool %} [generic] -# This is custom opt group that is used for storing opts of share-service. -# This one is used only when enabled using opt `enabled_share_backends` -# from DEFAULT group. - -# Set usage of Generic driver which uses Cinder as backend. share_driver = manila.share.drivers.generic.GenericShareDriver - -# Vif driver. Used only with Neutron. (string value) {% if neutron_plugin_agent == "openvswitch" %} interface_driver = manila.network.linux.interface.OVSInterfaceDriver {% elif neutron_plugin_agent == "linuxbridge" %} interface_driver = manila.network.linux.interface.BridgeInterfaceDriver {% endif %} -# Generic driver supports both driver modes - with and without handling -# of share servers. So, we need to define explicitly which one we are -# enabling using this driver. -driver_handles_share_servers = {{ driver_handles_share_servers }} +driver_handles_share_servers = True -# Generic driver is the only driver that uses image from Glance for building -# service VMs in Nova. And following are data for some specific image. -# We used one defined in [1] -# [1] https://git.openstack.org/cgit/openstack/manila/tree/devstack/plugin.sh?id=6785cad9#n86 service_instance_password = {{ manila_service_instance_password }} service_instance_user = {{ manila_service_instance_user }} service_image_name = manila-service-image -# Custom name for share backend. share_backend_name = GENERIC +{% endif %} + +{% if enable_manila_backend_hnas | bool %} +[hnas1] +share_backend_name = HNAS1 +share_driver = manila.share.drivers.hitachi.hnas.driver.HitachiHNASDriver +driver_handles_share_servers = False +hitachi_hnas_ip = {{ hnas_ip }} +hitachi_hnas_user = {{ hnas_user }} +hitachi_hnas_password = {{ hnas_password }} +hitachi_hnas_evs_id = {{ hnas_evs_id }} +hitachi_hnas_evs_ip = {{ hnas_evs_ip }} +hitachi_hnas_file_system_name = {{ hnas_file_system_name }} +{% endif %} diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index a4744777f8..89fc974a9e 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -133,6 +133,8 @@ kolla_internal_vip_address: "10.10.10.254" #enable_kuryr: "no" #enable_magnum: "no" #enable_manila: "no" +#enable_manila_backend_generic: "no" +#enable_manila_backend_hnas: "no" #enable_mistral: "no" #enable_mongodb: "no" #enable_murano: "no" @@ -224,9 +226,13 @@ kolla_internal_vip_address: "10.10.10.254" ####################################### # Manila - Shared File Systems Options ####################################### -# Valid options are [ True, False ] -#driver_handles_share_servers: "True" - +# HNAS backend configuration +#hnas_ip: +#hnas_user: +#hnas_password: +#hnas_evs_id: +#hnas_evs_ip: +#hnas_file_system_name: ################################## # Swift - Object Storage Options