From 4150df42e2ca57c1e2ee47b3498571488058c36f Mon Sep 17 00:00:00 2001 From: Serguei Bezverkhi Date: Mon, 9 May 2016 11:13:12 -0400 Subject: [PATCH] Adding variables for Cinder iSCSI backend configuration This fix adds several variables required for Cinder iSCSI backend configutation. Change-Id: I2f709f8589fdbf62e3d0b265452fd58f413bee65 Closes-Bug: #1579800 --- ansible/group_vars/all.yml | 8 ++++++-- ansible/roles/cinder/templates/cinder.conf.j2 | 15 ++++++++------- etc/kolla/globals.yml | 10 ++++++++++ 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index ab63645052..0257f844e8 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -230,8 +230,12 @@ kibana_user: "kibana" ################################# # Cinder - Block Storage options ################################# -cinder_volume_driver: "{{ 'ceph' if enable_ceph | bool else 'lvm' }}" - +cinder_volume_driver: "{{ 'ceph' if enable_ceph | bool }}" +cinder_volume_driver: "{{ 'lvm' if enable_iscsi | bool }}" +cinder_volume_group: "{{ 'cinder-volumes' if enable_iscsi | bool }}" +cinder_volume_backend_name: "{{ 'cinder-volumes' if enable_iscsi | bool }}" +cinder_iscsi_helper: "{{ 'tgtadm' if enable_iscsi | bool }}" +cinder_iscsi_protocol: "{{ 'iscsi' if enable_iscsi | bool }}" ################### # Ceph options diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index 8fff2104cf..d1ff2b33bc 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -9,7 +9,7 @@ use_forwarded_for = true use_stderr = False enable_v1_api=false -volume_name_template = %s +volume_name_template = volume-%s glance_api_servers = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ glance_api_port }} glance_api_version = 2 @@ -17,8 +17,7 @@ glance_api_version = 2 os_region_name = {{ openstack_region_name }} {% if cinder_volume_driver == "lvm" %} -default_volume_type = lvmdriver-1 -enabled_backends = lvmdriver-1 +enabled_backends = {{ cinder_volume_backend_name }} {% elif cinder_volume_driver == "ceph" %} default_volume_type = rbd-1 enabled_backends = rbd-1 @@ -73,11 +72,13 @@ rabbit_hosts = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' {% if cinder_volume_driver == "lvm" %} -[lvmdriver-1] -lvm_type = default -volume_group = cinder-volumes +[{{ cinder_volume_backend_name }}] +volume_group = {{ cinder_volume_group }} volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver -volume_backend_name = lvmdriver-1 +volume_backend_name = {{ cinder_volume_backend_name }} +iscsi_ip_address = {{ cinder_iscsi_ip_address }} +iscsi_helper = {{ cinder_iscsi_helper }} +iscsi_protocol = {{ cinder_iscsi_protocol }} {% elif cinder_volume_driver == "ceph" %} [rbd-1] volume_driver = cinder.volume.drivers.rbd.RBDDriver diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 475bbc9e23..c4ac83820c 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -134,6 +134,16 @@ neutron_external_interface: "eth1" #ceph_pool_type: "replicated" +####################### +# Cinder iSCSI options +####################### +# Cinder's iSCSI backend !!!REQUIRES!!! two parameters: +# 1 - IP address of the server hosting LVM Volume group +# 2 - The name of Volume group which Cinder will use. +#cinder_iscsi_ip_address: +#cinder_volume_group: + + ####################################### # Manila - Shared File Systems Options #######################################