Added opportunity to define iscsi_helper and scheduler_default_filters params.
Change-Id: I1175f2e8050c1b979a9ad9fd8bcd3072bcb44f4c
Related-PROD: PROD-25448
diff --git a/README.rst b/README.rst
index ed605ca..824019f 100644
--- a/README.rst
+++ b/README.rst
@@ -843,6 +843,34 @@
strategy: ENCRYPT
secret_key: secret
+Cinder service supports to define iscsi_helper for lvm backend.
+
+.. code-block:: yaml
+
+ cinder:
+ volume:
+ ...
+ backend:
+ lvm:
+ ...
+ engine: lvm
+ iscsi_helper: tgtadm
+
+Cinder service supports to define scheduler_default_filters. Which filter class names
+to use for filtering hosts when not specified in the request.
+
+.. code-block:: yaml
+
+ cinder:
+ volume:
+ ...
+ scheduler_default_filters: (filters)
+
+ cinder:
+ controller:
+ ...
+ scheduler_default_filters: (filters)
+
Upgrades
========
diff --git a/cinder/files/backend/_lvm.conf b/cinder/files/backend/_lvm.conf
index e305056..db24344 100644
--- a/cinder/files/backend/_lvm.conf
+++ b/cinder/files/backend/_lvm.conf
@@ -6,5 +6,5 @@
{%- if backend.lvm_type is defined %}
lvm_type = {{ backend.lvm_type }}
{%- endif %}
-iscsi_helper = tgtadm
-volume_group = {{ backend.volume_group }}
\ No newline at end of file
+iscsi_helper = {{ backend.get('iscsi_helper', 'tgtadm') }}
+volume_group = {{ backend.volume_group }}
diff --git a/cinder/files/pike/cinder.conf.controller.Debian b/cinder/files/pike/cinder.conf.controller.Debian
index e15e46a..5c3ffde 100644
--- a/cinder/files/pike/cinder.conf.controller.Debian
+++ b/cinder/files/pike/cinder.conf.controller.Debian
@@ -8,6 +8,10 @@
{%- endif %}
[DEFAULT]
+{%- if controller.scheduler_default_filters is defined %}
+scheduler_default_filters = {{ controller.scheduler_default_filters }}
+{%- endif %}
+
rootwrap_config = /etc/cinder/rootwrap.conf
api_paste_confg = /etc/cinder/api-paste.ini
diff --git a/cinder/files/pike/cinder.conf.volume.Debian b/cinder/files/pike/cinder.conf.volume.Debian
index 0373859..9fa86fa 100644
--- a/cinder/files/pike/cinder.conf.volume.Debian
+++ b/cinder/files/pike/cinder.conf.volume.Debian
@@ -8,6 +8,10 @@
{%- endif %}
[DEFAULT]
+{%- if volume.scheduler_default_filters is defined %}
+scheduler_default_filters = {{ volume.scheduler_default_filters }}
+{%- endif %}
+
rootwrap_config = /etc/cinder/rootwrap.conf
api_paste_confg = /etc/cinder/api-paste.ini
diff --git a/cinder/files/queens/cinder.conf.controller.Debian b/cinder/files/queens/cinder.conf.controller.Debian
index d72efc1..7c04364 100644
--- a/cinder/files/queens/cinder.conf.controller.Debian
+++ b/cinder/files/queens/cinder.conf.controller.Debian
@@ -557,6 +557,9 @@
# Which filter class names to use for filtering hosts when not specified in the
# request. (list value)
#scheduler_default_filters = AvailabilityZoneFilter,CapacityFilter,CapabilitiesFilter
+{%- if controller.scheduler_default_filters is defined %}
+scheduler_default_filters = {{ controller.scheduler_default_filters }}
+{%- endif %}
# Which weigher class names to use for weighing hosts. (list value)
#scheduler_default_weighers = CapacityWeigher
diff --git a/cinder/files/queens/cinder.conf.volume.Debian b/cinder/files/queens/cinder.conf.volume.Debian
index bdf764d..d1b51a8 100644
--- a/cinder/files/queens/cinder.conf.volume.Debian
+++ b/cinder/files/queens/cinder.conf.volume.Debian
@@ -555,6 +555,9 @@
# Which filter class names to use for filtering hosts when not specified in the
# request. (list value)
#scheduler_default_filters = AvailabilityZoneFilter,CapacityFilter,CapabilitiesFilter
+{%- if volume.scheduler_default_filters is defined %}
+scheduler_default_filters = {{ volume.scheduler_default_filters }}
+{%- endif %}
# Which weigher class names to use for weighing hosts. (list value)
#scheduler_default_weighers = CapacityWeigher
diff --git a/cinder/files/rocky/cinder.conf.controller.Debian b/cinder/files/rocky/cinder.conf.controller.Debian
index 7e8c773..f7555ba 100644
--- a/cinder/files/rocky/cinder.conf.controller.Debian
+++ b/cinder/files/rocky/cinder.conf.controller.Debian
@@ -565,6 +565,9 @@
# Which filter class names to use for filtering hosts when not specified in the
# request. (list value)
#scheduler_default_filters = AvailabilityZoneFilter,CapacityFilter,CapabilitiesFilter
+{%- if controller.scheduler_default_filters is defined %}
+scheduler_default_filters = {{ controller.scheduler_default_filters }}
+{%- endif %}
# Which weigher class names to use for weighing hosts. (list value)
#scheduler_default_weighers = CapacityWeigher
diff --git a/cinder/files/rocky/cinder.conf.volume.Debian b/cinder/files/rocky/cinder.conf.volume.Debian
index 64ba7b0..4b82a8d 100644
--- a/cinder/files/rocky/cinder.conf.volume.Debian
+++ b/cinder/files/rocky/cinder.conf.volume.Debian
@@ -564,6 +564,9 @@
# Which filter class names to use for filtering hosts when not specified in the
# request. (list value)
#scheduler_default_filters = AvailabilityZoneFilter,CapacityFilter,CapabilitiesFilter
+{%- if volume.scheduler_default_filters is defined %}
+scheduler_default_filters = {{ volume.scheduler_default_filters }}
+{%- endif %}
# Which weigher class names to use for weighing hosts. (list value)
#scheduler_default_weighers = CapacityWeigher
diff --git a/tests/pillar/control_single.sls b/tests/pillar/control_single.sls
index a1c6014..cd1f7d9 100644
--- a/tests/pillar/control_single.sls
+++ b/tests/pillar/control_single.sls
@@ -2,6 +2,7 @@
controller:
enabled: true
version: liberty
+ scheduler_default_filters: AvailabilityZoneFilter
osapi:
host: 127.0.0.1
database:
diff --git a/tests/pillar/volume_single.sls b/tests/pillar/volume_single.sls
index 73037ed..086fbfd 100644
--- a/tests/pillar/volume_single.sls
+++ b/tests/pillar/volume_single.sls
@@ -2,6 +2,16 @@
volume:
enabled: true
version: liberty
+ scheduler_default_filters: AvailabilityZoneFilter
+ default_volume_type: defaultVolumeType
+ backend:
+ lvm:
+ host: 127.0.0.1
+ engine: lvm
+ lvm_type: auto
+ type_name: volumeType
+ iscsi_helper: tgtadm
+ volume_group: cinder-volumes
osapi:
host: 127.0.0.1
database: