Merge branch 'redesign-backends' into 'master'
Redesign backends
Redesign backend to enable multiple storage engines and volume types. It provides old legacy support too.
See merge request !3
diff --git a/README.rst b/README.rst
index 1f2eed8..4c0e355 100644
--- a/README.rst
+++ b/README.rst
@@ -15,6 +15,7 @@
controller:
enabled: true
version: juno
+ default_volume_type: 7k2SaS
database:
engine: mysql
host: 127.0.0.1
@@ -36,17 +37,24 @@
user: openstack
password: pwd
virtual_host: '/openstack'
- storage:
- engine: file
- types:
- - name: 7k2_SAS
- - name: 10k_SAS
- - name: 15k_SAS
+ backend:
+ 7k2_SAS:
+ engine: storwize
+ type_name: slow-disks
+ host: 192.168.0.1
+ port: 22
+ user: username
+ password: pass
+ connection: FC/iSCSI
+ multihost: true
+ multipath: true
+ pool: SAS7K2
cinder:
volume:
enabled: true
version: juno
+ default_volume_type: 7k2SaS
database:
engine: mysql
host: 127.0.0.1
@@ -68,12 +76,18 @@
user: openstack
password: pwd
virtual_host: '/openstack'
- storage:
- engine: file
- types:
- - name: 7k2_SAS
- - name: 10k_SAS
- - name: 15k_SAS
+ backend:
+ 7k2_SAS:
+ engine: storwize
+ type_name: 7k2 SAS disk
+ host: 192.168.0.1
+ port: 22
+ user: username
+ password: pass
+ connection: FC/iSCSI
+ multihost: true
+ multipath: true
+ pool: SAS7K2
Cinder setup with zeroing deleted volumes
@@ -102,6 +116,7 @@
controller:
enabled: true
version: juno
+ default_volume_type: 7k2SaS
database:
engine: mysql
host: 127.0.0.1
@@ -123,39 +138,60 @@
user: openstack
password: pwd
virtual_host: '/openstack'
- storage:
- engine: file
- types:
- - name: 7k2_SAS
- - name: 10k_SAS
- - name: 15k_SAS
+ backend:
+ 7k2_SAS:
+ engine: storwize
+ type_name: 7k2 SAS disk
+ host: 192.168.0.1
+ port: 22
+ user: username
+ password: pass
+ connection: FC/iSCSI
+ multihost: true
+ multipath: true
+ pool: SAS7K2
-Cinder setup with IBM Storwize
+Cinder setup for IBM Storwize
.. code-block:: yaml
cinder:
- controller:
+ volume:
enabled: true
- types:
- - name: 7k2_SAS
- engine: storwize
- pool: SAS7K2
- - name: 10k_SAS
- pool: SAS10K
- engine: storwize
- - name: 15k_SAS
- pool: SAS15K
- engine: storwize
- storage:
- engine: storwize
- host: 192.168.0.1
- port: 22
- user: username
- password: pass
- connection: FC/iSCSI
- multihost: true
- multipath: true
+ backend:
+ 7k2_SAS:
+ engine: storwize
+ type_name: 7k2 SAS disk
+ host: 192.168.0.1
+ port: 22
+ user: username
+ password: pass
+ connection: FC/iSCSI
+ multihost: true
+ multipath: true
+ pool: SAS7K2
+ 10k_SAS:
+ engine: storwize
+ type_name: 10k SAS disk
+ host: 192.168.0.1
+ port: 22
+ user: username
+ password: pass
+ connection: FC/iSCSI
+ multihost: true
+ multipath: true
+ pool: SAS10K
+ 15k_SAS:
+ engine: storwize
+ type_name: 15k SAS
+ host: 192.168.0.1
+ port: 22
+ user: username
+ password: pass
+ connection: FC/iSCSI
+ multihost: true
+ multipath: true
+ pool: SAS15K
Cinder setup with Hitachi VPS
@@ -164,12 +200,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
@@ -178,15 +214,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:
+ type_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/
@@ -198,19 +234,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:
+ type_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
@@ -219,20 +255,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:
+ type_name: 10kThinPro
+ engine: fujitsu
+ pool: 10kThinPro
+ host: 192.168.0.1
+ port: 5988
+ user: username
+ password: pass
+ connection: FC/iSCSI
+ 10k_SAS:
+ type_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
@@ -241,16 +282,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:
+ type_name: GPFS-GOLD
+ engine: gpfs
+ mount_point: '/mnt/gpfs-openstack/cinder/gold'
+ GPFS-SILVER
+ type_name: GPFS-SILVER
+ engine: gpfs
+ mount_point: '/mnt/gpfs-openstack/cinder/silver'
+
## Read more
* https://wiki.openstack.org/wiki/Cinder
diff --git a/cinder/controller.sls b/cinder/controller.sls
index a30b7ca..a890055 100644
--- a/cinder/controller.sls
+++ b/cinder/controller.sls
@@ -36,6 +36,28 @@
- require:
- service: cinder_controller_services
+{# new way #}
+
+{%- for backend_name, backend in controller.get('backend', {}).iteritems() %}
+
+cinder_type_create_{{ backend_name }}:
+ cmd.run:
+ - name: "source /root/keystonerc; cinder type-create {{ backend.type_name }}"
+ - unless: "source /root/keystonerc; cinder type-list | grep {{ backend.type_name }}"
+ - require:
+ - service: cinder_controller_services
+
+cinder_type_update_{{ backend_name }}:
+ cmd.run:
+ - name: "source /root/keystonerc; cinder type-key {{ backend.type_name }} set volume_backend_name={{ backend_name }}"
+ - unless: "source /root/keystonerc; cinder extra-specs-list | grep \"{u'volume_backend_name': u'{{ backend_name }}'}\""
+ - require:
+ - cmd: cinder_type_create_{{ backend_name }}
+
+{%- endfor %}
+
+{# old way #}
+
{% for type in controller.get('types', []) %}
cinder_type_create_{{ type.name }}:
diff --git a/cinder/files/backend/_ceph.conf b/cinder/files/backend/_ceph.conf
new file mode 100644
index 0000000..42151b0
--- /dev/null
+++ b/cinder/files/backend/_ceph.conf
@@ -0,0 +1,47 @@
+
+[{{ backend_name }}]
+volume_backend_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..6245284
--- /dev/null
+++ b/cinder/files/backend/_fujitsu.conf
@@ -0,0 +1,5 @@
+
+[{{ backend_name }}]
+volume_backend_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..3000c39
--- /dev/null
+++ b/cinder/files/backend/_gpfs.conf
@@ -0,0 +1,9 @@
+
+[{{ backend_name }}]
+volume_backend_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..0f6ae75
--- /dev/null
+++ b/cinder/files/backend/_hitachi_vsp.conf
@@ -0,0 +1,64 @@
+
+[{{ backend_name }}]
+
+volume_backend_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..f28a4ba
--- /dev/null
+++ b/cinder/files/backend/_hp3par.conf
@@ -0,0 +1,53 @@
+
+[{{ backend_name }}]
+volume_backend_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/backend/_storwize.conf b/cinder/files/backend/_storwize.conf
new file mode 100644
index 0000000..1f09fca
--- /dev/null
+++ b/cinder/files/backend/_storwize.conf
@@ -0,0 +1,15 @@
+
+[{{ backend_name }}]
+volume_driver = cinder.volume.drivers.ibm.storwize_svc.StorwizeSVCDriver
+volume_backend_name={{ backend_name }}
+san_ip={{ backend.host }}
+san_ssh_port={{ backend.port }}
+san_login={{ backend.user }}
+san_password={{ backend.password }}
+
+storwize_svc_volpool_name={{ backend.pool }}
+#storwize_svc_connection_protocol=iSCSI
+storwize_svc_connection_protocol={{ backend.connection }}
+#storwize_svc_iscsi_chap_enabled=true
+storwize_svc_multihost_enabled={{ backend.multihost }}
+storwize_svc_multipath_enabled={{ backend.multipath }}
\ 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..fa62135 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={{ controller.default_volume_type }}
+
+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 controller.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
@@ -69,8 +82,6 @@
verbose=True
lock_path=/var/lock/cinder
-enabled_backends={% for type in controller.get('types', []) %}{{ type.name }}{% if not loop.last %},{% endif %}{% endfor %}
-
[keystone_authtoken]
signing_dir=/tmp/keystone-signing-cinder
admin_password={{ controller.identity.password }}
@@ -89,6 +100,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 +356,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..383a8f5 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={{ volume.default_volume_type }}
+
+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..55820a2 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={{ controller.default_volume_type }}
+
+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 controller.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..e1706d2 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={{ volume.default_volume_type }}
+
+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
@@ -70,8 +83,6 @@
use_syslog=false
verbose=True
-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 %}
-
[oslo_concurrency]
lock_path=/var/lock/cinder
@@ -104,6 +115,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 +456,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..ae95e4b 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={{ controller.default_volume_type }}
+
+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 controller.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 791cdc2..7869a8e 100644
--- a/cinder/files/liberty/cinder.conf.volume.Debian
+++ b/cinder/files/liberty/cinder.conf.volume.Debian
@@ -30,8 +30,21 @@
glance_api_version=2
volume_backend_name=DEFAULT
+
+{%- if volume.backend is defined %}
+
+default_volume_type={{ volume.default_volume_type }}
+
+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
@@ -70,8 +83,6 @@
use_syslog=false
verbose=True
-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 %}
-
[oslo_concurrency]
lock_path=/var/lock/cinder
@@ -106,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', []) %}
@@ -432,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..d116fce 100644
--- a/cinder/volume.sls
+++ b/cinder/volume.sls
@@ -44,6 +44,98 @@
- file: /etc/cinder/cinder.conf
- file: /etc/cinder/api-paste.ini
+{# new way #}
+
+{%- if volume.backend is defined %}
+
+{%- for backend_name, backend in volume.get('backend', {}).iteritems() %}
+
+{%- if backend.engine == 'iscsi' %}
+
+cinder_iscsi_packages_{{ loop.index }}:
+ 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 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 backend.engine == 'hp3par' %}
+
+hp3parclient:
+ pkg.latest:
+ - name: python-hp3parclient
+
+{%- endif %}
+
+{%- if 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 %}
+
+{%- endfor %}
+
+{%- endif %}
+
+{# old way #}
+
+{%- if volume.storage is defined %}
+
{%- if volume.storage.engine == 'iscsi' %}
cinder_iscsi_packages:
@@ -123,3 +215,6 @@
{%- endif %}
{%- endif %}
+
+
+{%- endif %}
diff --git a/metadata/service/control/cluster.yml b/metadata/service/control/cluster.yml
index b274228..9b65ff9 100644
--- a/metadata/service/control/cluster.yml
+++ b/metadata/service/control/cluster.yml
@@ -31,8 +31,4 @@
user: openstack
password: ${_param:rabbitmq_openstack_password}
virtual_host: '/openstack'
- ha_queues: true
- storage:
- engine: iscsi
- host: localhost
- types: []
\ No newline at end of file
+ ha_queues: true
\ No newline at end of file
diff --git a/metadata/service/control/cluster_control.yml b/metadata/service/control/cluster_control.yml
index b274228..9b65ff9 100644
--- a/metadata/service/control/cluster_control.yml
+++ b/metadata/service/control/cluster_control.yml
@@ -31,8 +31,4 @@
user: openstack
password: ${_param:rabbitmq_openstack_password}
virtual_host: '/openstack'
- ha_queues: true
- storage:
- engine: iscsi
- host: localhost
- types: []
\ No newline at end of file
+ ha_queues: true
\ No newline at end of file
diff --git a/metadata/service/control/single.yml b/metadata/service/control/single.yml
index 68dc240..12f79f4 100644
--- a/metadata/service/control/single.yml
+++ b/metadata/service/control/single.yml
@@ -32,7 +32,3 @@
password: ${_secret:rabbitmq_openstack_password}
virtual_host: '/openstack'
ha_queues: false
- storage:
- engine: iscsi
- host: localhost
- types: []
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