Merge pull request #2 from mnederlof/master

Integrate configurable availability zones for cinder
diff --git a/README.rst b/README.rst
index df9d1d1..e2da026 100644
--- a/README.rst
+++ b/README.rst
@@ -407,6 +407,24 @@
           filter_factory: 'keystonemiddleware.audit:filter_factory'
           map_file: '/etc/pycadf/cinder_api_audit_map.conf'
 
+
+Cinder setup with custom availability zones:
+
+.. code-block:: yaml
+
+    cinder:
+      controller:
+        default_availability_zone: my-default-zone
+        storage_availability_zone: my-custom-zone-name
+    cinder:
+      volume:
+        default_availability_zone: my-default-zone
+        storage_availability_zone: my-custom-zone-name
+
+The default availability zone is used when a volume has been created, without specifying a zone in the create request. (this zone must exist in your configuration obviously)
+The storage availability zone is the actual zone where the node belongs to. Make sure to specify this per node.
+Check the documentation of OpenStack for more information
+
 Documentation and Bugs
 ============================
 
diff --git a/cinder/files/juno/cinder.conf.controller.Debian b/cinder/files/juno/cinder.conf.controller.Debian
index cf7b94f..3961e82 100644
--- a/cinder/files/juno/cinder.conf.controller.Debian
+++ b/cinder/files/juno/cinder.conf.controller.Debian
@@ -47,6 +47,15 @@
 
 {%- endif %}
 
+{%- if controller.storage_availability_zone is defined %}
+storage_availability_zone={{controller.storage_availability_zone}}
+{%- endif %}
+
+{%- if controller.default_availability_zone is defined %}
+default_availability_zone={{controller.default_availability_zone}}
+{%- endif %}
+
+
 #RPC response timeout recommended by Hitachi
 rpc_response_timeout=3600
 
diff --git a/cinder/files/juno/cinder.conf.volume.Debian b/cinder/files/juno/cinder.conf.volume.Debian
index 2cb1031..64e0050 100644
--- a/cinder/files/juno/cinder.conf.volume.Debian
+++ b/cinder/files/juno/cinder.conf.volume.Debian
@@ -47,6 +47,15 @@
 
 {%- endif %}
 
+{%- if volume.storage_availability_zone is defined %}
+storage_availability_zone={{volume.storage_availability_zone}}
+{%- endif %}
+
+{%- if volume.default_availability_zone is defined %}
+default_availability_zone={{volume.default_availability_zone}}
+{%- endif %}
+
+
 #RPC response timeout recommended by Hitachi
 rpc_response_timeout=3600
 
diff --git a/cinder/files/kilo/cinder.conf.controller.Debian b/cinder/files/kilo/cinder.conf.controller.Debian
index e29a399..d35b484 100644
--- a/cinder/files/kilo/cinder.conf.controller.Debian
+++ b/cinder/files/kilo/cinder.conf.controller.Debian
@@ -50,6 +50,15 @@
 
 {%- endif %}
 
+{%- if controller.storage_availability_zone is defined %}
+storage_availability_zone={{controller.storage_availability_zone}}
+{%- endif %}
+
+{%- if controller.default_availability_zone is defined %}
+default_availability_zone={{controller.default_availability_zone}}
+{%- endif %}
+
+
 #RPC response timeout recommended by Hitachi
 rpc_response_timeout=3600
 
diff --git a/cinder/files/kilo/cinder.conf.volume.Debian b/cinder/files/kilo/cinder.conf.volume.Debian
index 94efa00..8bf4f8b 100644
--- a/cinder/files/kilo/cinder.conf.volume.Debian
+++ b/cinder/files/kilo/cinder.conf.volume.Debian
@@ -49,6 +49,15 @@
 
 {%- endif %}
 
+{%- if volume.storage_availability_zone is defined %}
+storage_availability_zone={{volume.storage_availability_zone}}
+{%- endif %}
+
+{%- if volume.default_availability_zone is defined %}
+default_availability_zone={{volume.default_availability_zone}}
+{%- endif %}
+
+
 #RPC response timeout recommended by Hitachi
 rpc_response_timeout=3600
 
diff --git a/cinder/files/liberty/cinder.conf.controller.Debian b/cinder/files/liberty/cinder.conf.controller.Debian
index d5fdeca..e51c079 100644
--- a/cinder/files/liberty/cinder.conf.controller.Debian
+++ b/cinder/files/liberty/cinder.conf.controller.Debian
@@ -51,6 +51,15 @@
 
 {%- endif %}
 
+{%- if controller.storage_availability_zone is defined %}
+storage_availability_zone={{controller.storage_availability_zone}}
+{%- endif %}
+
+{%- if controller.default_availability_zone is defined %}
+default_availability_zone={{controller.default_availability_zone}}
+{%- endif %}
+
+
 #RPC response timeout recommended by Hitachi
 rpc_response_timeout=3600
 
diff --git a/cinder/files/liberty/cinder.conf.volume.Debian b/cinder/files/liberty/cinder.conf.volume.Debian
index 0943e48..0ab8e54 100644
--- a/cinder/files/liberty/cinder.conf.volume.Debian
+++ b/cinder/files/liberty/cinder.conf.volume.Debian
@@ -49,6 +49,15 @@
 
 {%- endif %}
 
+{%- if volume.storage_availability_zone is defined %}
+storage_availability_zone={{volume.storage_availability_zone}}
+{%- endif %}
+
+{%- if volume.default_availability_zone is defined %}
+default_availability_zone={{volume.default_availability_zone}}
+{%- endif %}
+
+
 #RPC response timeout recommended by Hitachi
 rpc_response_timeout=3600
 
diff --git a/cinder/files/mitaka/cinder.conf.controller.Debian b/cinder/files/mitaka/cinder.conf.controller.Debian
index e57508d..6ce59df 100644
--- a/cinder/files/mitaka/cinder.conf.controller.Debian
+++ b/cinder/files/mitaka/cinder.conf.controller.Debian
@@ -43,6 +43,15 @@
 
 {%- endif %}
 
+{%- if controller.storage_availability_zone is defined %}
+storage_availability_zone={{controller.storage_availability_zone}}
+{%- endif %}
+
+{%- if controller.default_availability_zone is defined %}
+default_availability_zone={{controller.default_availability_zone}}
+{%- endif %}
+
+
 #RPC response timeout recommended by Hitachi
 rpc_response_timeout=3600
 
diff --git a/cinder/files/mitaka/cinder.conf.volume.Debian b/cinder/files/mitaka/cinder.conf.volume.Debian
index 73b6ca1..beb8008 100644
--- a/cinder/files/mitaka/cinder.conf.volume.Debian
+++ b/cinder/files/mitaka/cinder.conf.volume.Debian
@@ -42,6 +42,15 @@
 
 {%- endif %}
 
+{%- if volume.storage_availability_zone is defined %}
+storage_availability_zone={{volume.storage_availability_zone}}
+{%- endif %}
+
+{%- if volume.default_availability_zone is defined %}
+default_availability_zone={{volume.default_availability_zone}}
+{%- endif %}
+
+
 #RPC response timeout recommended by Hitachi
 rpc_response_timeout=3600
 
diff --git a/cinder/files/newton/cinder.conf.controller.Debian b/cinder/files/newton/cinder.conf.controller.Debian
index b7e5b74..faf22e9 100644
--- a/cinder/files/newton/cinder.conf.controller.Debian
+++ b/cinder/files/newton/cinder.conf.controller.Debian
@@ -42,6 +42,15 @@
 
 {%- endif %}
 
+{%- if controller.storage_availability_zone is defined %}
+storage_availability_zone={{controller.storage_availability_zone}}
+{%- endif %}
+
+{%- if controller.default_availability_zone is defined %}
+default_availability_zone={{controller.default_availability_zone}}
+{%- endif %}
+
+
 #RPC response timeout recommended by Hitachi
 rpc_response_timeout=3600
 
diff --git a/cinder/files/newton/cinder.conf.volume.Debian b/cinder/files/newton/cinder.conf.volume.Debian
index f5183be..4c70f1c 100644
--- a/cinder/files/newton/cinder.conf.volume.Debian
+++ b/cinder/files/newton/cinder.conf.volume.Debian
@@ -42,6 +42,15 @@
 
 {%- endif %}
 
+{%- if volume.storage_availability_zone is defined %}
+storage_availability_zone={{volume.storage_availability_zone}}
+{%- endif %}
+
+{%- if volume.default_availability_zone is defined %}
+default_availability_zone={{volume.default_availability_zone}}
+{%- endif %}
+
+
 #RPC response timeout recommended by Hitachi
 rpc_response_timeout=3600