Merge changes I16871393,Ica5b1586

* changes:
  Add Grafana dashboard for Prometheus
  Add API availability alert for Prometheus
diff --git a/README.rst b/README.rst
index 3dd21a6..73f684b 100644
--- a/README.rst
+++ b/README.rst
@@ -303,11 +303,11 @@
               - 172.18.1.2:/vol_2
               - 172.18.1.2:/vol_3
               - 172.18.1.2:/vol_4
-      compute:
-        backend:
-          netapp:
-            engine: netapp
-            storage_protocol: nfs
+    linux:
+      system:
+        package:
+          nfs-common:
+            version: latest
 
 
 Cinder setup with Hitachi VPS
@@ -466,6 +466,23 @@
             clustername: cluster1
             sf_emulate_512: false
 
+Cinder setup with Block Device driver
+
+.. code-block:: yaml
+
+    cinder:
+      volume:
+        enabled: true
+        backend:
+          bdd:
+            engine: bdd
+            enabled: true
+            type_name: bdd
+            devices:
+              - sdb
+              - sdc
+              - sdd
+
 Enable cinder-backup service for ceph
 
 .. code-block:: yaml
diff --git a/cinder/compute.sls b/cinder/compute.sls
deleted file mode 100644
index bcede64..0000000
--- a/cinder/compute.sls
+++ /dev/null
@@ -1,20 +0,0 @@
-{%- from "cinder/map.jinja" import compute with context %}
-{%- if compute.get('enabled', False) %}
-
-include:
-- cinder.user
-
-{%- for backend_name, backend in compute.get('backend', {}).iteritems() %}
-
-{%- if backend.engine is defined and backend.engine == 'nfs' or (backend.engine == 'netapp' and backend.storage_protocol == 'nfs') %}
-
-cinder_netapp_compute_packages:
-  pkg.installed:
-    - pkgs:
-      - nfs-common
-
-{%- endif %}
-
-{%- endfor %}
-
-{%- endif %}
diff --git a/cinder/controller.sls b/cinder/controller.sls
index 4d8c334..2d3ed9d 100644
--- a/cinder/controller.sls
+++ b/cinder/controller.sls
@@ -59,9 +59,9 @@
   service.running:
   - name: apache2
   - enable: true
-  {% if grains.noservices is defined %}
-  - onlyif: {% if grains.get('noservices', "True") %}"True"{% else %}False{% endif %}
-  {% endif %}
+  {%- if grains.get('noservices') %}
+  - onlyif: /bin/false
+  {%- endif %}
   - watch:
     - file: /etc/cinder/cinder.conf
     - file: /etc/cinder/api-paste.ini
@@ -73,9 +73,9 @@
   service.running:
   - name: cinder-api
   - enable: true
-  {% if grains.noservices is defined %}
-  - onlyif: {% if grains.get('noservices', "True") %}"True"{% else %}False{% endif %}
-  {% endif %}
+  {%- if grains.get('noservices') %}
+  - onlyif: /bin/false
+  {%- endif %}
   - watch:
     - file: /etc/cinder/cinder.conf
     - file: /etc/cinder/api-paste.ini
@@ -98,9 +98,9 @@
   service.running:
   - names: {{ controller.services }}
   - enable: true
-  {% if grains.noservices is defined %}
-  - onlyif: {% if grains.get('noservices', "True") %}"True"{% else %}False{% endif %}
-  {% endif %}
+  {%- if grains.get('noservices') %}
+  - onlyif: /bin/false
+  {%- endif %}
   - watch:
     - file: /etc/cinder/cinder.conf
     - file: /etc/cinder/api-paste.ini
@@ -108,9 +108,9 @@
 cinder_syncdb:
   cmd.run:
   - name: cinder-manage db sync
-  {% if grains.noservices is defined %}
-  - onlyif: {% if grains.get('noservices', "True") %}"True"{% else %}False{% endif %}
-  {% endif %}
+  {%- if grains.get('noservices') %}
+  - onlyif: /bin/false
+  {%- endif %}
   - require:
     - service: cinder_controller_services
 
diff --git a/cinder/files/backend/_bdd.conf b/cinder/files/backend/_bdd.conf
new file mode 100644
index 0000000..ae2b0a1
--- /dev/null
+++ b/cinder/files/backend/_bdd.conf
@@ -0,0 +1,7 @@
+
+[{{ backend_name }}]
+available_devices = {% for device in backend.devices %}/dev/{{ device }}{% if not loop.last %},{% endif %}{% endfor %}
+enable_unsupported_driver = {{ backend.enabled }}
+storage_availability_zone = {{ grains.host }}
+volume_backend_name = {{ backend_name }}
+volume_driver = cinder.volume.drivers.block_device.BlockDeviceDriver
diff --git a/cinder/files/backend/_hp_lefthand.conf b/cinder/files/backend/_hp_lefthand.conf
index e47fd9f..343447e 100644
--- a/cinder/files/backend/_hp_lefthand.conf
+++ b/cinder/files/backend/_hp_lefthand.conf
@@ -1,3 +1,4 @@
+
 [{{ backend_name }}]
 host={{ backend.get('host', grains.host) }}
 volume_backend_name={{ backend_name }}
diff --git a/cinder/files/newton/cinder.conf.volume.Debian b/cinder/files/newton/cinder.conf.volume.Debian
index 1124056..5a02b87 100644
--- a/cinder/files/newton/cinder.conf.volume.Debian
+++ b/cinder/files/newton/cinder.conf.volume.Debian
@@ -141,7 +141,7 @@
 auth_version = v3
 
 [barbican]
-auth_endpoint=http://{{ controller.identity.host }}:5000
+auth_endpoint=http://{{ volume.identity.host }}:5000
 
 [database]
 idle_timeout=3600
diff --git a/cinder/files/ocata/cinder.conf.volume.Debian b/cinder/files/ocata/cinder.conf.volume.Debian
index 1124056..5a02b87 100644
--- a/cinder/files/ocata/cinder.conf.volume.Debian
+++ b/cinder/files/ocata/cinder.conf.volume.Debian
@@ -141,7 +141,7 @@
 auth_version = v3
 
 [barbican]
-auth_endpoint=http://{{ controller.identity.host }}:5000
+auth_endpoint=http://{{ volume.identity.host }}:5000
 
 [database]
 idle_timeout=3600
diff --git a/cinder/init.sls b/cinder/init.sls
index 9a15d91..6f16b57 100644
--- a/cinder/init.sls
+++ b/cinder/init.sls
@@ -3,9 +3,6 @@
 {% if pillar.cinder.controller is defined %}
 - cinder.controller
 {% endif %}
-{% if pillar.cinder.compute is defined %}
-- cinder.compute
-{% endif %}
 {% if pillar.cinder.volume is defined %}
 - cinder.volume
 {% endif %}
diff --git a/cinder/map.jinja b/cinder/map.jinja
index 0755d54..fec426d 100644
--- a/cinder/map.jinja
+++ b/cinder/map.jinja
@@ -65,36 +65,3 @@
     },
 }, merge=pillar.cinder.get('volume', {})) %}
 
-{% set compute = salt['grains.filter_by']({
-    'Debian': {
-        'pkgs': [],
-        'services': [],
-        'wipe_method': 'none',
-        'notification': False,
-        'cors': {},
-        'audit': {
-          'enabled': false
-        },
-        'backup': {
-          'pkgs': [],
-          'services': [],
-          'engine': None
-        }
-    },
-    'RedHat': {
-        'pkgs': [],
-        'services': [],
-        'wipe_method': 'none',
-        'notification': False,
-        'cors': {},
-        'audit': {
-          'enabled': false
-        },
-        'backup': {
-          'pkgs': [],
-          'services': [],
-          'engine': None
-        }
-
-    },
-}, merge=pillar.cinder.get('compute', {})) %}
diff --git a/cinder/volume.sls b/cinder/volume.sls
index ee5d9ea..ac54fb0 100644
--- a/cinder/volume.sls
+++ b/cinder/volume.sls
@@ -44,9 +44,9 @@
   service.running:
   - names: {{ volume.backup.services }}
   - enable: true
-  {% if grains.noservices is defined %}
-  - onlyif: {% if grains.get('noservices', "True") %}"True"{% else %}False{% endif %}
-  {% endif %}
+  {%- if grains.get('noservices') %}
+  - onlyif: /bin/false
+  {%- endif %}
   - watch:
     - file: /etc/cinder/cinder.conf
     - file: /etc/cinder/api-paste.ini
@@ -59,9 +59,9 @@
   service.running:
   - names: {{ volume.services }}
   - enable: true
-  {% if grains.noservices is defined %}
-  - onlyif: {% if grains.get('noservices', "True") %}"True"{% else %}False{% endif %}
-  {% endif %}
+  {%- if grains.get('noservices') %}
+  - onlyif: /bin/false
+  {%- endif %}
   - watch:
     - file: /etc/cinder/cinder.conf
     - file: /etc/cinder/api-paste.ini
@@ -72,6 +72,24 @@
 
 {%- for backend_name, backend in volume.get('backend', {}).iteritems() %}
 
+{%- if backend.engine is defined and backend.engine == 'nfs' or (backend.engine == 'netapp' and backend.storage_protocol == 'nfs') %}
+/etc/cinder/nfs_shares_{{ backend_name }}_for_cinder-volume:
+  file.managed:
+  - name: /etc/cinder/nfs_shares_{{ backend_name }}
+  - source: salt://cinder/files/{{ volume.version }}/nfs_shares
+  - defaults:
+      backend: {{ backend|yaml }}
+  - template: jinja
+  - require:
+    - pkg: cinder_volume_packages
+
+cinder_netapp_packages_for_cinder-volume:
+  pkg.installed:
+    - pkgs:
+      - nfs-common
+
+{%- endif %}
+
 {%- if backend.engine in ['iscsi' , 'hp_lefthand'] %}
 
 cinder_iscsi_packages_{{ loop.index }}:
@@ -96,9 +114,9 @@
     - iscsitarget
     - open-iscsi
   - enable: true
-  {% if grains.noservices is defined %}
-  - onlyif: {% if grains.get('noservices', "True") %}"True"{% else %}False{% endif %}
-  {% endif %}
+  {%- if grains.get('noservices') %}
+  - onlyif: /bin/false
+  {%- endif %}
   - watch:
     - file: /etc/default/iscsitarget
 
@@ -182,9 +200,9 @@
     - iscsitarget
     - open-iscsi
   - enable: true
-  {% if grains.noservices is defined %}
-  - onlyif: {% if grains.get('noservices', "True") %}"True"{% else %}False{% endif %}
-  {% endif %}
+  {%- if grains.get('noservices') %}
+  - onlyif: /bin/false
+  {%- endif %}
   - watch:
     - file: /etc/default/iscsitarget
 
diff --git a/metadata/service/compute/single.yml b/metadata/service/compute/single.yml
deleted file mode 100644
index 097e874..0000000
--- a/metadata/service/compute/single.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-applications:
-- cinder
-classes:
-- service.cinder.support
-parameters:
-  cinder:
-    compute:
-      enabled: true
diff --git a/tests/pillar/netapp.sls b/tests/pillar/netapp.sls
index 7a7baa0..7746433 100644
--- a/tests/pillar/netapp.sls
+++ b/tests/pillar/netapp.sls
@@ -22,10 +22,8 @@
   volume:
     enabled: true
     version: mitaka
-  compute:
-    enabled: true
-    version: mitaka
-    backend:
-      netapp:
-        engine: netapp
-        storage_protocol: nfs
+linux:
+  system:
+    package:
+      nfs-common:
+        version: latest