complete redesign for cinder storage to enable multiple storage backends and types
diff --git a/README.rst b/README.rst
index 04bed67..4c338f4 100644
--- a/README.rst
+++ b/README.rst
@@ -178,12 +178,12 @@
cinder:
controller:
enabled: true
- types:
- - name: HUS100
- backend: hus100_backend
- storage:
- engine: hitachi_vsp
- connection: FC
+ backend:
+ hus100_backend:
+ name: HUS100
+ backend: hus100_backend
+ engine: hitachi_vsp
+ connection: FC
Cinder setup with CEPH
@@ -192,15 +192,15 @@
cinder:
controller:
enabled: true
- types:
- - name: ceph
- backend: ceph_backend
- pool: volumes
- storage:
- engine: ceph
- user: cinder
- secret_uuid: da74ccb7-aa59-1721-a172-0006b1aa4e3e
- client_cinder_key: AQDOavlU6BsSJhAAnpFR906mvdgdfRqLHwu0Uw==
+ backend:
+ ceph_backend:
+ name: standard-iops
+ backend: ceph_backend
+ pool: volumes
+ engine: ceph
+ user: cinder
+ secret_uuid: da74ccb7-aa59-1721-a172-0006b1aa4e3e
+ client_cinder_key: AQDOavlU6BsSJhAAnpFR906mvdgdfRqLHwu0Uw==
http://ceph.com/docs/master/rbd/rbd-openstack/
@@ -212,19 +212,19 @@
cinder:
controller:
enabled: true
- types:
- - name: hp3par
- backend: hp3par_backend
- storage:
- user: hp3paruser
- password: something
- url: http://10.10.10.10/api/v1
- cpg: OpenStackCPG
- host: 10.10.10.10
- login: hp3paradmin
- sanpassword: something
- debug: True
- snapcpg: OpenStackSNAPCPG
+ backend:
+ hp3par_backend:
+ name: hp3par
+ backend: hp3par_backend
+ user: hp3paruser
+ password: something
+ url: http://10.10.10.10/api/v1
+ cpg: OpenStackCPG
+ host: 10.10.10.10
+ login: hp3paradmin
+ sanpassword: something
+ debug: True
+ snapcpg: OpenStackSNAPCPG
Cinder setup with Fujitsu Eternus
@@ -233,20 +233,25 @@
cinder:
volume:
enabled: true
- types:
- - name: 10kThinPro
- engine: fujitsu
- pool: 10kThinPro
- - name: 10k_SAS
- pool: SAS10K
- engine: fujitsu
- storage:
- engine: fujitsu
- host: 192.168.0.1
- port: 5988
- user: username
- password: pass
- connection: FC/iSCSI
+ backend:
+ 10kThinPro:
+ name: 10kThinPro
+ engine: fujitsu
+ pool: 10kThinPro
+ host: 192.168.0.1
+ port: 5988
+ user: username
+ password: pass
+ connection: FC/iSCSI
+ 10k_SAS:
+ name: 10k_SAS
+ pool: SAS10K
+ engine: fujitsu
+ host: 192.168.0.1
+ port: 5988
+ user: username
+ password: pass
+ connection: FC/iSCSI
Cinder setup with IBM GPFS filesystem
@@ -255,16 +260,16 @@
cinder:
volume:
enabled: true
- types:
- - name: GPFS-GOLD
- engine: gpfs
- mount_point: '/mnt/gpfs-openstack/cinder/gold'
- - name: GPFS-SILVER
- engine: gpfs
- mount_point: '/mnt/gpfs-openstack/cinder/silver'
- storage:
- engine: gpfs
-
+ backend:
+ GPFS-GOLD:
+ name: GPFS-GOLD
+ engine: gpfs
+ mount_point: '/mnt/gpfs-openstack/cinder/gold'
+ GPFS-SILVER
+ name: GPFS-SILVER
+ engine: gpfs
+ mount_point: '/mnt/gpfs-openstack/cinder/silver'
+
## Read more
* https://wiki.openstack.org/wiki/Cinder
diff --git a/cinder/files/backend/_ceph.conf b/cinder/files/backend/_ceph.conf
new file mode 100644
index 0000000..75730a1
--- /dev/null
+++ b/cinder/files/backend/_ceph.conf
@@ -0,0 +1,47 @@
+
+[{{ backend_name }}]
+volume_backend_name={{ backend.get('name', backend_name) }}
+volume_driver = cinder.volume.drivers.rbd.RBDDriver
+#
+# Options defined in cinder.volume.drivers.rbd
+#
+# The RADOS pool where rbd volumes are stored (string value)
+#rbd_pool=volumes
+rbd_pool={{ backend.pool }}
+
+# The RADOS client name for accessing rbd volumes - only set
+# when using cephx authentication (string value)
+#rbd_user=cinder
+rbd_user={{ backend.user }}
+
+# Path to the ceph configuration file (string value)
+#rbd_ceph_conf=
+rbd_ceph_conf=/etc/ceph/ceph.conf
+
+# Flatten volumes created from snapshots to remove dependency
+# from volume to snapshot (boolean value)
+#rbd_flatten_volume_from_snapshot=false
+
+# The libvirt uuid of the secret for the rbd_user volumes
+# (string value)
+#rbd_secret_uuid=da74ccb7-aa59-1721-a172-0006b1aa4e3e
+rbd_secret_uuid={{ backend.secret_uuid }}
+
+# Directory where temporary image files are stored when the
+# volume driver does not write them directly to the volume.
+# (string value)
+#volume_tmp_dir=<None>
+
+# Maximum number of nested volume clones that are taken before
+# a flatten occurs. Set to 0 to disable cloning. (integer
+# value)
+#rbd_max_clone_depth=5
+
+# Volumes will be chunked into objects of this size (in
+# megabytes). (integer value)
+#rbd_store_chunk_size=4
+
+# Timeout value (in seconds) used when connecting to ceph
+# cluster. If value < 0, no timeout is set and default
+# librados value is used. (integer value)
+#rados_connect_timeout=-1
\ No newline at end of file
diff --git a/cinder/files/backend/_fujitsu.conf b/cinder/files/backend/_fujitsu.conf
new file mode 100644
index 0000000..f1bb7ec
--- /dev/null
+++ b/cinder/files/backend/_fujitsu.conf
@@ -0,0 +1,5 @@
+
+[{{ backend_name }}]
+volume_backend_name={{ backend.get('name', backend_name) }}
+volume_driver=cinder.volume.drivers.fujitsu.fujitsu_eternus_dx_fc.FJDXFCDriver
+cinder_eternus_config_file=/etc/cinder/cinder_fujitsu_eternus_dx_{{ backend.backend }}.xml
\ No newline at end of file
diff --git a/cinder/files/backend/_gpfs.conf b/cinder/files/backend/_gpfs.conf
new file mode 100644
index 0000000..6d6381f
--- /dev/null
+++ b/cinder/files/backend/_gpfs.conf
@@ -0,0 +1,9 @@
+
+[{{ backend_name }}]
+volume_backend_name={{ backend.get('name', backend_name) }}
+volume_driver = cinder.volume.drivers.ibm.gpfs.GPFSDriver
+gpfs_mount_point_base={{ backend.mount_point }}
+#gpfs_mount_point_base=/mnt/gpfs-openstack/cinder/gold
+gpfs_max_clone_depth=3
+gpfs_sparse_volumes=true
+gpfs_storage_pool=system
\ No newline at end of file
diff --git a/cinder/files/backend/_hitachi_vsp.conf b/cinder/files/backend/_hitachi_vsp.conf
new file mode 100644
index 0000000..c87990a
--- /dev/null
+++ b/cinder/files/backend/_hitachi_vsp.conf
@@ -0,0 +1,64 @@
+
+[{{ backend_name }}]
+
+volume_backend_name={{ backend.get('name', backend_name) }}
+volume_driver = cinder.volume.drivers.hitachi.hbsd.hbsd_fc.HBSDFCDriver
+
+#
+# Options defined in cinder.volume.drivers.hitachi.hbsd_common
+#
+# Serial number of storage system (string value)
+#hitachi_serial_number=<None>
+#hitachi_serial_number=86644
+hitachi_storage_id={{ backend.storage_id }}
+
+# Pool ID of storage system (integer value)
+#hitachi_pool_id=<None>
+hitachi_pool={{ backend.pool_id }}
+
+# Thin pool ID of storage system (integer value)
+hitachi_thin_pool={{ backend.thin_pool_id }}
+
+# Default copy method of storage system (string value)
+#hitachi_default_copy_method=FULL
+hitachi_default_copy_method=THIN
+
+# Control port names for HostGroup or iSCSI Target (string
+# value)
+#hitachi_target_ports=<None>
+hitachi_target_ports={{ backend.target_ports }}
+
+hitachi_compute_target_ports={{ backend.compute_target_ports }}
+
+# Range of group number (string value)
+#hitachi_group_range=
+#hitachi_group_range=
+
+# Request for creating HostGroup or iSCSI Target (boolean
+# value)
+#JPA
+hitachi_group_request=True
+#hitachi_group_request=false
+
+# Instance numbers for HORCM (string value)
+#hitachi_horcm_numbers=200,201
+hitachi_horcm_numbers=0,1
+
+# Username of storage system for HORCM (string value)
+#hitachi_horcm_user=<None>
+#hitachi_horcm_user=openstack
+hitachi_horcm_user={{ backend.user }}
+
+# Password of storage system for HORCM (string value)
+#hitachi_horcm_password=<None>
+#hitachi_horcm_password=avg2014
+hitachi_horcm_password={{ backend.password }}
+
+# Add to HORCM configuration (boolean value)
+#hitachi_horcm_add_conf=true
+hitachi_horcm_add_conf=true
+
+#hitachi multipath advice
+use_multipath_for_image_xfer=false
+
+hitachi_storage_cli=HORCM
\ No newline at end of file
diff --git a/cinder/files/backend/_hp3par.conf b/cinder/files/backend/_hp3par.conf
new file mode 100644
index 0000000..6c217ef
--- /dev/null
+++ b/cinder/files/backend/_hp3par.conf
@@ -0,0 +1,53 @@
+
+[{{ backend_name }}]
+volume_backend_name={{ backend.get('name', backend_name) }}
+hp3par_api_url={{ backend.url }}
+
+# 3PAR Super user username
+hp3par_username={{ backend.storage.user }}
+
+# 3PAR Super user password
+hp3par_password={{ backend.password }}
+
+# 3PAR CPG to use for volume creation
+hp3par_cpg={{ backend.cpg }}
+
+# IP address of SAN volume for SSH access to the array
+san_ip={{ backend.host }}
+
+# Username for SAN volume for SSH access to the array
+san_login={{ backend.login }}
+
+# Password for SAN volume for SSH access to the array
+san_password={{ backend.password }}
+
+# FIBRE CHANNEL(uncomment the next line to enable the FC driver)
+volume_driver=cinder.volume.drivers.san.hp.hp_3par_fc.HP3PARFCDriver
+
+# iSCSI (uncomment the next line to enable the iSCSI driver and
+# hp3par_iscsi_ips or iscsi_ip_address)
+#volume_driver=cinder.volume.drivers.san.hp.hp_3par_iscsi.HP3PARISCSIDriver
+
+# iSCSI multiple port configuration
+# hp3par_iscsi_ips=10.10.220.253:3261,10.10.222.234
+#hp3par_iscsi_ips=10.10.103.151
+
+# Still available for single port iSCSI configuration
+#iscsi_ip_address=10.10.103.151
+
+## OPTIONAL SETTINGS
+# Enable HTTP debugging to 3PAR
+# hp3par_debug=True
+hp3par_debug={{ backend.debug }}
+
+# Enable CHAP authentication for iSCSI connections.
+hp3par_iscsi_chap_enabled=false
+
+# The CPG to use for Snapshots for volumes. If empty hp3par_cpg will be used.
+hp3par_snap_cpg={{ backend.snapcpg }}
+
+# Time in hours to retain a snapshot. You can't delete it before this expires.
+hp3par_snapshot_retention=2
+
+# Time in hours when a snapshot expires and is deleted. This must be larger than retention.
+hp3par_snapshot_expiration=4
\ No newline at end of file
diff --git a/cinder/files/juno/cinder.conf.controller.Debian b/cinder/files/juno/cinder.conf.controller.Debian
index c0ed882..91d9013 100644
--- a/cinder/files/juno/cinder.conf.controller.Debian
+++ b/cinder/files/juno/cinder.conf.controller.Debian
@@ -30,8 +30,21 @@
glance_api_version=2
volume_backend_name=DEFAULT
+
+{%- if controller.backend is defined %}
+
+default_volume_type={% for backend_name, backend in controller.get('backend', {}).iteritems() %}{% if loop.first %}{{ backend_name }}{% endif %}{% endfor %}
+
+enabled_backends={% for backend_name, backend in controller.get('backend', {}).iteritems() %}{{ backend_name }}{% if not loop.last %},{% endif %}{% endfor %}
+
+{%- else %}
+
default_volume_type={% for type in controller.get('types', []) %}{% if loop.first %}{{ type.name }}{% endif %}{% endfor %}
+enabled_backends={% for type in controller.get('types', []) %}{{ type.backend }}{% if not loop.last %},{% endif %}{% endfor %}{% if volume.storage.engine == "openvstorage" %}{% for vpool in pillar.openvstorage.server.get('vpools', []) %}{{ vpool }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
+
+{%- endif %}
+
#RPC response timeout recommended by Hitachi
rpc_response_timeout=3600
@@ -89,6 +102,21 @@
max_overflow=40
connection = {{ controller.database.engine }}://{{ controller.database.user }}:{{ controller.database.password }}@{{ controller.database.host }}/{{ controller.database.name }}
+{# new way #}
+
+{%- if controller.backend is defined %}
+
+{%- for backend_name, backend in controller.get('backend', {}).iteritems() %}
+
+{%- set backend_fragment = "cinder/files/backend/_" + backend.engine + "conf" %}
+{%- include backend_fragment %}
+
+{%- endfor %}
+
+{%- else %}
+
+{# old way #}
+
{%- if controller.storage.engine == "storwize" %}
{%- for type in controller.get('types', []) %}
@@ -330,4 +358,6 @@
{%- endfor %}
+{%- endif %}
+
{%- endif %}
\ No newline at end of file
diff --git a/cinder/files/juno/cinder.conf.volume.Debian b/cinder/files/juno/cinder.conf.volume.Debian
index 73bce22..2a29c34 100644
--- a/cinder/files/juno/cinder.conf.volume.Debian
+++ b/cinder/files/juno/cinder.conf.volume.Debian
@@ -30,8 +30,21 @@
glance_api_version=2
volume_backend_name=DEFAULT
+
+{%- if volume.backend is defined %}
+
+default_volume_type={% for backend_name, backend in volume.get('backend', {}).iteritems() %}{% if loop.first %}{{ backend_name }}{% endif %}{% endfor %}
+
+enabled_backends={% for backend_name, backend in volume.get('backend', {}).iteritems() %}{{ backend_name }}{% if not loop.last %},{% endif %}{% endfor %}
+
+{%- else %}
+
default_volume_type={% for type in volume.get('types', []) %}{% if loop.first %}{{ type.name }}{% endif %}{% endfor %}
+enabled_backends={% for type in volume.get('types', []) %}{{ type.backend }}{% if not loop.last %},{% endif %}{% endfor %}{% if volume.storage.engine == "openvstorage" %}{% for vpool in pillar.openvstorage.server.get('vpools', []) %}{{ vpool }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
+
+{%- endif %}
+
#RPC response timeout recommended by Hitachi
rpc_response_timeout=3600
@@ -78,8 +91,6 @@
verbose=True
lock_path=/var/lock/cinder
-enabled_backends={% for type in volume.get('types', []) %}{{ type.name }}{% if not loop.last %},{% endif %}{% endfor %}{% if volume.storage.engine == "openvstorage" %}{% for vpool in pillar.openvstorage.server.get('vpools', []) %}{{ vpool }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
-
[keystone_authtoken]
signing_dir=/tmp/keystone-signing-cinder
admin_password={{ volume.identity.password }}
@@ -98,6 +109,21 @@
max_overflow=40
connection = {{ volume.database.engine }}://{{ volume.database.user }}:{{ volume.database.password }}@{{ volume.database.host }}/{{ volume.database.name }}
+{# new way #}
+
+{%- if volume.backend is defined %}
+
+{%- for backend_name, backend in volume.get('backend', {}).iteritems() %}
+
+{%- set backend_fragment = "cinder/files/backend/_" + backend.engine + "conf" %}
+{%- include backend_fragment %}
+
+{%- endfor %}
+
+{%- else %}
+
+{# old way #}
+
{%- if volume.storage.engine == "storwize" %}
{%- for type in volume.get('types', []) %}
@@ -407,4 +433,6 @@
{%- endfor %}
+{%- endif %}
+
{%- endif %}
\ No newline at end of file
diff --git a/cinder/files/juno/cinder_fujitsu_eternus_dx.xml b/cinder/files/juno/cinder_fujitsu_eternus_dx.xml
index 2f21171..afab2d5 100644
--- a/cinder/files/juno/cinder_fujitsu_eternus_dx.xml
+++ b/cinder/files/juno/cinder_fujitsu_eternus_dx.xml
@@ -1,3 +1,4 @@
+{%- if volume.storage.engine is defined %}
{%- from "cinder/map.jinja" import volume with context -%}
<?xml version='1.0' encoding='UTF-8'?>
<FUJITSU>
@@ -8,3 +9,14 @@
<EternusISCSIIP></EternusISCSIIP>
<EternusPool>{{ volume_type_name }}</EternusPool>
</FUJITSU>
+{%- else %}
+<?xml version='1.0' encoding='UTF-8'?>
+<FUJITSU>
+<EternusIP>{{ volume.backend.host }}</EternusIP>
+<EternusPort>{{ volume.backend.port }}</EternusPort>
+<EternusUser>{{ volume.backend.user }}</EternusUser>
+<EternusPassword>{{ volume.backend.password }}</EternusPassword>
+<EternusISCSIIP></EternusISCSIIP>
+<EternusPool>{{ backend.pool }}</EternusPool>
+</FUJITSU>
+{%- endif %}
\ No newline at end of file
diff --git a/cinder/files/kilo/cinder.conf.controller.Debian b/cinder/files/kilo/cinder.conf.controller.Debian
index f20a4e6..0cb3700 100644
--- a/cinder/files/kilo/cinder.conf.controller.Debian
+++ b/cinder/files/kilo/cinder.conf.controller.Debian
@@ -30,8 +30,21 @@
glance_api_version=2
volume_backend_name=DEFAULT
+
+{%- if controller.backend is defined %}
+
+default_volume_type={% for backend_name, backend in controller.get('backend', {}).iteritems() %}{% if loop.first %}{{ backend_name }}{% endif %}{% endfor %}
+
+enabled_backends={% for backend_name, backend in controller.get('backend', {}).iteritems() %}{{ backend_name }}{% if not loop.last %},{% endif %}{% endfor %}
+
+{%- else %}
+
default_volume_type={% for type in controller.get('types', []) %}{% if loop.first %}{{ type.name }}{% endif %}{% endfor %}
+enabled_backends={% for type in controller.get('types', []) %}{{ type.backend }}{% if not loop.last %},{% endif %}{% endfor %}{% if volume.storage.engine == "openvstorage" %}{% for vpool in pillar.openvstorage.server.get('vpools', []) %}{{ vpool }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
+
+{%- endif %}
+
#RPC response timeout recommended by Hitachi
rpc_response_timeout=3600
@@ -62,8 +75,6 @@
verbose=True
lock_path=/var/lock/cinder
-enabled_backends={% for type in controller.get('types', []) %}{{ type.backend }}{% if not loop.last %},{% endif %}{% endfor %}
-
[oslo_concurrency]
lock_path=/var/lock/cinder
@@ -95,6 +106,21 @@
max_overflow=40
connection = {{ controller.database.engine }}://{{ controller.database.user }}:{{ controller.database.password }}@{{ controller.database.host }}/{{ controller.database.name }}
+{# new way #}
+
+{%- if controller.backend is defined %}
+
+{%- for backend_name, backend in controller.get('backend', {}).iteritems() %}
+
+{%- set backend_fragment = "cinder/files/backend/_" + backend.engine + "conf" %}
+{%- include backend_fragment %}
+
+{%- endfor %}
+
+{%- else %}
+
+{# old way #}
+
{%- if controller.storage.engine == "storwize" %}
{%- for type in controller.get('types', []) %}
@@ -353,4 +379,6 @@
{%- endfor %}
+{%- endif %}
+
{%- endif %}
\ No newline at end of file
diff --git a/cinder/files/kilo/cinder.conf.volume.Debian b/cinder/files/kilo/cinder.conf.volume.Debian
index cd0657e..3944785 100644
--- a/cinder/files/kilo/cinder.conf.volume.Debian
+++ b/cinder/files/kilo/cinder.conf.volume.Debian
@@ -30,8 +30,21 @@
glance_api_version=2
volume_backend_name=DEFAULT
+
+{%- if volume.backend is defined %}
+
+default_volume_type={% for backend_name, backend in volume.get('backend', {}).iteritems() %}{% if loop.first %}{{ backend_name }}{% endif %}{% endfor %}
+
+enabled_backends={% for backend_name, backend in volume.get('backend', {}).iteritems() %}{{ backend_name }}{% if not loop.last %},{% endif %}{% endfor %}
+
+{%- else %}
+
default_volume_type={% for type in volume.get('types', []) %}{% if loop.first %}{{ type.name }}{% endif %}{% endfor %}
+enabled_backends={% for type in volume.get('types', []) %}{{ type.backend }}{% if not loop.last %},{% endif %}{% endfor %}{% if volume.storage.engine == "openvstorage" %}{% for vpool in pillar.openvstorage.server.get('vpools', []) %}{{ vpool }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
+
+{%- endif %}
+
#RPC response timeout recommended by Hitachi
rpc_response_timeout=3600
@@ -104,6 +117,21 @@
max_overflow=40
connection = {{ volume.database.engine }}://{{ volume.database.user }}:{{ volume.database.password }}@{{ volume.database.host }}/{{ volume.database.name }}
+{# new way #}
+
+{%- if volume.backend is defined %}
+
+{%- for backend_name, backend in volume.get('backend', {}).iteritems() %}
+
+{%- set backend_fragment = "cinder/files/backend/_" + backend.engine + "conf" %}
+{%- include backend_fragment %}
+
+{%- endfor %}
+
+{%- else %}
+
+{# old way #}
+
{%- if volume.storage.engine == "storwize" %}
{%- for type in volume.get('types', []) %}
@@ -430,4 +458,6 @@
{%- endfor %}
+{%- endif %}
+
{%- endif %}
\ No newline at end of file
diff --git a/cinder/files/kilo/cinder_fujitsu_eternus_dx.xml b/cinder/files/kilo/cinder_fujitsu_eternus_dx.xml
index 2f21171..afab2d5 100644
--- a/cinder/files/kilo/cinder_fujitsu_eternus_dx.xml
+++ b/cinder/files/kilo/cinder_fujitsu_eternus_dx.xml
@@ -1,3 +1,4 @@
+{%- if volume.storage.engine is defined %}
{%- from "cinder/map.jinja" import volume with context -%}
<?xml version='1.0' encoding='UTF-8'?>
<FUJITSU>
@@ -8,3 +9,14 @@
<EternusISCSIIP></EternusISCSIIP>
<EternusPool>{{ volume_type_name }}</EternusPool>
</FUJITSU>
+{%- else %}
+<?xml version='1.0' encoding='UTF-8'?>
+<FUJITSU>
+<EternusIP>{{ volume.backend.host }}</EternusIP>
+<EternusPort>{{ volume.backend.port }}</EternusPort>
+<EternusUser>{{ volume.backend.user }}</EternusUser>
+<EternusPassword>{{ volume.backend.password }}</EternusPassword>
+<EternusISCSIIP></EternusISCSIIP>
+<EternusPool>{{ backend.pool }}</EternusPool>
+</FUJITSU>
+{%- endif %}
\ No newline at end of file
diff --git a/cinder/files/liberty/cinder.conf.controller.Debian b/cinder/files/liberty/cinder.conf.controller.Debian
index ee56660..7cf588d 100644
--- a/cinder/files/liberty/cinder.conf.controller.Debian
+++ b/cinder/files/liberty/cinder.conf.controller.Debian
@@ -30,8 +30,21 @@
glance_api_version=2
volume_backend_name=DEFAULT
+
+{%- if controller.backend is defined %}
+
+default_volume_type={% for backend_name, backend in controller.get('backend', {}).iteritems() %}{% if loop.first %}{{ backend_name }}{% endif %}{% endfor %}
+
+enabled_backends={% for backend_name, backend in controller.get('backend', {}).iteritems() %}{{ backend_name }}{% if not loop.last %},{% endif %}{% endfor %}
+
+{%- else %}
+
default_volume_type={% for type in controller.get('types', []) %}{% if loop.first %}{{ type.name }}{% endif %}{% endfor %}
+enabled_backends={% for type in controller.get('types', []) %}{{ type.backend }}{% if not loop.last %},{% endif %}{% endfor %}{% if volume.storage.engine == "openvstorage" %}{% for vpool in pillar.openvstorage.server.get('vpools', []) %}{{ vpool }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
+
+{%- endif %}
+
#RPC response timeout recommended by Hitachi
rpc_response_timeout=3600
@@ -62,8 +75,6 @@
verbose=True
lock_path=/var/lock/cinder
-enabled_backends={% for type in controller.get('types', []) %}{{ type.backend }}{% if not loop.last %},{% endif %}{% endfor %}
-
[oslo_concurrency]
lock_path=/var/lock/cinder
@@ -97,6 +108,21 @@
max_overflow=40
connection = {{ controller.database.engine }}://{{ controller.database.user }}:{{ controller.database.password }}@{{ controller.database.host }}/{{ controller.database.name }}
+{# new way #}
+
+{%- if controller.backend is defined %}
+
+{%- for backend_name, backend in controller.get('backend', {}).iteritems() %}
+
+{%- set backend_fragment = "cinder/files/backend/_" + backend.engine + "conf" %}
+{%- include backend_fragment %}
+
+{%- endfor %}
+
+{%- else %}
+
+{# old way #}
+
{%- if controller.storage.engine == "storwize" %}
{%- for type in controller.get('types', []) %}
@@ -356,4 +382,6 @@
{%- endfor %}
+{%- endif %}
+
{%- endif %}
\ No newline at end of file
diff --git a/cinder/files/liberty/cinder.conf.volume.Debian b/cinder/files/liberty/cinder.conf.volume.Debian
index 7191582..0b80fbd 100644
--- a/cinder/files/liberty/cinder.conf.volume.Debian
+++ b/cinder/files/liberty/cinder.conf.volume.Debian
@@ -117,6 +117,10 @@
max_overflow=40
connection = {{ volume.database.engine }}://{{ volume.database.user }}:{{ volume.database.password }}@{{ volume.database.host }}/{{ volume.database.name }}
+{# new way #}
+
+{%- if volume.backend is defined %}
+
{%- for backend_name, backend in volume.get('backend', {}).iteritems() %}
{%- set backend_fragment = "cinder/files/backend/_" + backend.engine + "conf" %}
@@ -124,6 +128,10 @@
{%- endfor %}
+{%- else %}
+
+{# old way #}
+
{%- if volume.storage.engine == "storwize" %}
{%- for type in volume.get('types', []) %}
@@ -450,4 +458,6 @@
{%- endfor %}
+{%- endif %}
+
{%- endif %}
\ No newline at end of file
diff --git a/cinder/files/liberty/cinder_fujitsu_eternus_dx.xml b/cinder/files/liberty/cinder_fujitsu_eternus_dx.xml
index 2f21171..1af35fa 100644
--- a/cinder/files/liberty/cinder_fujitsu_eternus_dx.xml
+++ b/cinder/files/liberty/cinder_fujitsu_eternus_dx.xml
@@ -1,3 +1,4 @@
+{%- if volume.storage.engine is defined %}
{%- from "cinder/map.jinja" import volume with context -%}
<?xml version='1.0' encoding='UTF-8'?>
<FUJITSU>
@@ -8,3 +9,14 @@
<EternusISCSIIP></EternusISCSIIP>
<EternusPool>{{ volume_type_name }}</EternusPool>
</FUJITSU>
+{%- else %}
+<?xml version='1.0' encoding='UTF-8'?>
+<FUJITSU>
+<EternusIP>{{ volume.backend.host }}</EternusIP>
+<EternusPort>{{ volume.backend.port }}</EternusPort>
+<EternusUser>{{ volume.backend.user }}</EternusUser>
+<EternusPassword>{{ volume.backend.password }}</EternusPassword>
+<EternusISCSIIP></EternusISCSIIP>
+<EternusPool>{{ backend.pool }}</EternusPool>
+</FUJITSU>
+{%- endif %}
diff --git a/cinder/volume.sls b/cinder/volume.sls
index 163eecb..e03b7f6 100644
--- a/cinder/volume.sls
+++ b/cinder/volume.sls
@@ -44,6 +44,92 @@
- file: /etc/cinder/cinder.conf
- file: /etc/cinder/api-paste.ini
+{# new way #}
+
+{%- if volume.backend.engine is defined %}
+
+{%- if volume.backend.engine == 'iscsi' %}
+
+cinder_iscsi_packages:
+ pkg.installed:
+ - names:
+ - iscsitarget
+ - open-iscsi
+ - iscsitarget-dkms
+ - require:
+ - pkg: cinder_volume_packages
+
+/etc/default/iscsitarget:
+ file.managed:
+ - source: salt://cinder/files/iscsitarget
+ - template: jinja
+ - require:
+ - pkg: cinder_iscsi_packages
+
+cinder_scsi_service:
+ service.running:
+ - names:
+ - iscsitarget
+ - open-iscsi
+ - enable: true
+ - watch:
+ - file: /etc/default/iscsitarget
+
+{%- endif %}
+
+{%- if volume.backend.engine == 'hitachi_vsp' %}
+
+{%- if grains.os_family == 'Debian' and volume.version == 'juno' %}
+
+hitachi_pkgs:
+ pkg.latest:
+ - names:
+ - horcm
+ - hbsd
+
+cinder_hitachi_vps_dir:
+ file.directory:
+ - name: /var/lock/hbsd
+ - user: cinder
+ - group: cinder
+
+{%- endif %}
+
+{%- endif %}
+
+{%- if volume.backend.engine == 'hp3par' %}
+
+hp3parclient:
+ pkg.latest:
+ - name: python-hp3parclient
+
+{%- endif %}
+
+{%- if volume.backend.engine == 'fujitsu' %}
+
+cinder_driver_fujitsu:
+ pkg.latest:
+ - name: cinder-driver-fujitsu
+
+{%- for backend_name, backend in volume.get('backend', {}).iteritems() %}
+
+/etc/cinder/cinder_fujitsu_eternus_dx_{{ backend.name }}.xml:
+ file.managed:
+ - source: salt://cinder/files/{{ volume.version }}/cinder_fujitsu_eternus_dx.xml
+ - template: jinja
+ - defaults:
+ volume_type_name: "{{ backend.pool }}"
+ - require:
+ - pkg: cinder-driver-fujitsu
+
+{%- endfor %}
+
+{%- endif %}
+
+{# old way #}
+
+{%- if volume.storage.engine is defined %}
+
{%- if volume.storage.engine == 'iscsi' %}
cinder_iscsi_packages:
@@ -123,3 +209,6 @@
{%- endif %}
{%- endif %}
+
+
+{%- endif %}
diff --git a/metadata/service/control/cluster.yml b/metadata/service/control/cluster.yml
index b274228..9d06756 100644
--- a/metadata/service/control/cluster.yml
+++ b/metadata/service/control/cluster.yml
@@ -32,7 +32,4 @@
password: ${_param:rabbitmq_openstack_password}
virtual_host: '/openstack'
ha_queues: true
- storage:
- engine: iscsi
- host: localhost
- types: []
\ No newline at end of file
+ backend: []
\ No newline at end of file
diff --git a/metadata/service/control/cluster_control.yml b/metadata/service/control/cluster_control.yml
index b274228..9d06756 100644
--- a/metadata/service/control/cluster_control.yml
+++ b/metadata/service/control/cluster_control.yml
@@ -32,7 +32,4 @@
password: ${_param:rabbitmq_openstack_password}
virtual_host: '/openstack'
ha_queues: true
- storage:
- engine: iscsi
- host: localhost
- types: []
\ No newline at end of file
+ backend: []
\ No newline at end of file
diff --git a/metadata/service/control/single.yml b/metadata/service/control/single.yml
index 68dc240..24ac296 100644
--- a/metadata/service/control/single.yml
+++ b/metadata/service/control/single.yml
@@ -32,7 +32,4 @@
password: ${_secret:rabbitmq_openstack_password}
virtual_host: '/openstack'
ha_queues: false
- storage:
- engine: iscsi
- host: localhost
- types: []
+ backend: []
diff --git a/metadata/service/volume/single.yml b/metadata/service/volume/single.yml
index 1676dcb..8a95e20 100644
--- a/metadata/service/volume/single.yml
+++ b/metadata/service/volume/single.yml
@@ -32,7 +32,4 @@
password: ${_param:rabbitmq_openstack_password}
virtual_host: '/openstack'
ha_queues: true
- storage:
- engine: iscsi
- host: localhost
- types: []
\ No newline at end of file
+ backend: []
\ No newline at end of file