Merge "Allow Travis CI to run parallel tests"
diff --git a/README.rst b/README.rst
index 5b601e4..da98313 100644
--- a/README.rst
+++ b/README.rst
@@ -26,6 +26,7 @@
         cpu_allocation_ratio: 8.0
         ram_allocation_ratio: 1.0
         disk_allocation_ratio: 1.0
+        cross_az_attach: false
         workers: 8
         report_interval: 60
         bind:
@@ -157,12 +158,15 @@
         version: juno
         enabled: true
         virtualization: kvm
+        cross_az_attach: false
+        disk_cachemodes: network=writeback,block=none
         availability_zone: availability_zone_01
         aggregates:
         - hosts_with_fc
         - hosts_with_ssd
         security_group: true
         resume_guests_state_on_host_boot: False
+        my_ip: 10.1.0.16
         bind:
           vnc_address: 172.20.0.100
           vnc_port: 6080
@@ -207,6 +211,19 @@
         qemu:
           max_files: 4096
           max_processes: 4096
+        host: node-12.domain.tld
+
+Group membership for user nova (upgrade related)
+
+.. code-block:: yaml
+
+    nova:
+      compute:
+        enabled: true
+        ...
+        user:
+          groups:
+          - libvirt
 
 Nova services on compute node with OpenContrail
 
@@ -345,6 +362,20 @@
             - aggregate1
             - aggregate2
 
+Upgrade levels
+
+.. code-block:: yaml
+
+    nova:
+      controller:
+        upgrade_levels:
+          compute: juno
+
+    nova:
+      compute:
+        upgrade_levels:
+          compute: juno
+
 SR-IOV
 ------
 
diff --git a/nova/compute.sls b/nova/compute.sls
index f2e9f18..128c570 100644
--- a/nova/compute.sls
+++ b/nova/compute.sls
@@ -43,8 +43,12 @@
   - name: nova
   - home: /var/lib/nova
   - shell: /bin/bash
+{%- if compute.user.groups is defined %}
+  - groups: {{ compute.user.groups }}
+{%- else %}
   - groups:
     - libvirtd
+{%- endif %}
 
 /var/lib/nova/.ssh/id_rsa:
   file.managed:
diff --git a/nova/files/grafana_dashboards/nova_prometheus.json b/nova/files/grafana_dashboards/nova_prometheus.json
index 81c7c3a..f42395b 100644
--- a/nova/files/grafana_dashboards/nova_prometheus.json
+++ b/nova/files/grafana_dashboards/nova_prometheus.json
@@ -1,5 +1,8 @@
 {% raw %}
 {
+  "annotations": {
+    "list": []
+  },
   "description": "Monitors Nova cluster using Prometheus. Shows overall cluster processes and usage.",
   "editable": true,
   "gnetId": 315,
@@ -59,7 +62,7 @@
               "to": "null"
             }
           ],
-          "span": 3,
+          "span": 2,
           "sparkline": {
             "fillColor": "rgba(31, 118, 189, 0.18)",
             "full": false,
@@ -69,12 +72,12 @@
           "tableColumn": "",
           "targets": [
             {
-              "expr": "min(openstack_api_check_status{service=~\"nova.api\"})",
+              "expr": "min(openstack_api_check_status{service=\"nova\"})",
               "format": "time_series",
               "intervalFactor": 2,
               "legendFormat": "{{ service }}",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "1,0",
@@ -147,7 +150,7 @@
               "to": "null"
             }
           ],
-          "span": 3,
+          "span": 2,
           "sparkline": {
             "fillColor": "rgba(31, 118, 189, 0.18)",
             "full": false,
@@ -162,7 +165,7 @@
               "intervalFactor": 2,
               "legendFormat": "per sec",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -177,27 +180,6 @@
             }
           ],
           "valueName": "current"
-        }
-      ],
-      "repeat": null,
-      "repeatIteration": null,
-      "repeatRowId": null,
-      "showTitle": true,
-      "title": "Service Status",
-      "titleSize": "h6"
-    },
-    {
-      "collapse": false,
-      "height": "100px",
-      "panels": [
-        {
-          "content": "<br />\n<h3 align=\"center\"> Up </h3>",
-          "id": 3,
-          "links": [],
-          "mode": "html",
-          "span": 1,
-          "title": "",
-          "type": "text"
         },
         {
           "cacheTimeout": null,
@@ -211,7 +193,94 @@
           "datasource": "prometheus",
           "format": "none",
           "gauge": {
-            "maxValue": 100,
+            "maxValue": 1,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+          },
+          "id": 3,
+          "interval": null,
+          "links": [],
+          "mappingType": 1,
+          "mappingTypes": [
+            {
+              "name": "value to text",
+              "value": 1
+            },
+            {
+              "name": "range to text",
+              "value": 2
+            }
+          ],
+          "maxDataPoints": 100,
+          "nullPointMode": "connected",
+          "nullText": null,
+          "postfix": "",
+          "postfixFontSize": "50%",
+          "prefix": "",
+          "prefixFontSize": "50%",
+          "rangeMaps": [
+            {
+              "from": "null",
+              "text": "N/A",
+              "to": "null"
+            }
+          ],
+          "span": 2,
+          "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": true
+          },
+          "tableColumn": "",
+          "targets": [
+            {
+              "expr": "min(haproxy_active_servers{proxy=~\"nova.api\", sv=\"BACKEND\"})",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{ service }}",
+              "refId": "A",
+              "step": 60
+            }
+          ],
+          "thresholds": "1,0",
+          "title": "Nova API backends",
+          "type": "singlestat",
+          "valueFontSize": "80%",
+          "valueMaps": [
+            {
+              "op": "=",
+              "text": "N/A",
+              "value": "null"
+            },
+            {
+              "op": "=",
+              "text": "OK",
+              "value": "1"
+            },
+            {
+              "op": "=",
+              "text": "DOWN",
+              "value": "0"
+            }
+          ],
+          "valueName": "current"
+        },
+        {
+          "cacheTimeout": null,
+          "colorBackground": false,
+          "colorValue": false,
+          "colors": [
+            "rgba(245, 54, 54, 0.9)",
+            "rgba(237, 129, 40, 0.89)",
+            "rgba(50, 172, 45, 0.97)"
+          ],
+          "datasource": "prometheus",
+          "format": "none",
+          "gauge": {
+            "maxValue": 1,
             "minValue": 0,
             "show": false,
             "thresholdLabels": false,
@@ -245,7 +314,7 @@
               "to": "null"
             }
           ],
-          "span": 3,
+          "span": 2,
           "sparkline": {
             "fillColor": "rgba(31, 118, 189, 0.18)",
             "full": false,
@@ -255,16 +324,16 @@
           "tableColumn": "",
           "targets": [
             {
-              "expr": "min(haproxy_active_servers{proxy=~\"nova.api\", sv=\"BACKEND\"})",
+              "expr": "min(haproxy_active_servers{proxy=~\"nova.metadata.api\", sv=\"BACKEND\"})",
               "format": "time_series",
               "intervalFactor": 2,
-              "legendFormat": "",
+              "legendFormat": "{{ service }}",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
-          "thresholds": "",
-          "title": "OpenStack",
+          "thresholds": "1,0",
+          "title": "Nova Metadata API backends",
           "type": "singlestat",
           "valueFontSize": "80%",
           "valueMaps": [
@@ -272,6 +341,16 @@
               "op": "=",
               "text": "N/A",
               "value": "null"
+            },
+            {
+              "op": "=",
+              "text": "OK",
+              "value": "1"
+            },
+            {
+              "op": "=",
+              "text": "DOWN",
+              "value": "0"
             }
           ],
           "valueName": "current"
@@ -288,7 +367,7 @@
           "datasource": "prometheus",
           "format": "none",
           "gauge": {
-            "maxValue": 100,
+            "maxValue": 1,
             "minValue": 0,
             "show": false,
             "thresholdLabels": false,
@@ -322,84 +401,7 @@
               "to": "null"
             }
           ],
-          "span": 3,
-          "sparkline": {
-            "fillColor": "rgba(31, 118, 189, 0.18)",
-            "full": false,
-            "lineColor": "rgb(31, 120, 193)",
-            "show": true
-          },
-          "tableColumn": "",
-          "targets": [
-            {
-              "expr": "min(haproxy_active_servers{proxy=~\"nova.metadata.api\", sv=\"BACKEND\"})",
-              "format": "time_series",
-              "intervalFactor": 2,
-              "legendFormat": "",
-              "refId": "A",
-              "step": 20
-            }
-          ],
-          "thresholds": "",
-          "title": "Metadata",
-          "type": "singlestat",
-          "valueFontSize": "80%",
-          "valueMaps": [
-            {
-              "op": "=",
-              "text": "N/A",
-              "value": "null"
-            }
-          ],
-          "valueName": "current"
-        },
-        {
-          "cacheTimeout": null,
-          "colorBackground": false,
-          "colorValue": false,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "datasource": "prometheus",
-          "format": "none",
-          "gauge": {
-            "maxValue": 100,
-            "minValue": 0,
-            "show": false,
-            "thresholdLabels": false,
-            "thresholdMarkers": true
-          },
-          "id": 6,
-          "interval": null,
-          "links": [],
-          "mappingType": 1,
-          "mappingTypes": [
-            {
-              "name": "value to text",
-              "value": 1
-            },
-            {
-              "name": "range to text",
-              "value": 2
-            }
-          ],
-          "maxDataPoints": 100,
-          "nullPointMode": "connected",
-          "nullText": null,
-          "postfix": "",
-          "postfixFontSize": "50%",
-          "prefix": "",
-          "prefixFontSize": "50%",
-          "rangeMaps": [
-            {
-              "from": "null",
-              "text": "N/A",
-              "to": "null"
-            }
-          ],
-          "span": 3,
+          "span": 2,
           "sparkline": {
             "fillColor": "rgba(31, 118, 189, 0.18)",
             "full": false,
@@ -412,13 +414,13 @@
               "expr": "min(haproxy_active_servers{proxy=~\"nova.novnc\", sv=\"BACKEND\"})",
               "format": "time_series",
               "intervalFactor": 2,
-              "legendFormat": "",
+              "legendFormat": "{{ service }}",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
-          "thresholds": "",
-          "title": "NoVNC proxy",
+          "thresholds": "1,0",
+          "title": "Nova NoVNC API backends",
           "type": "singlestat",
           "valueFontSize": "80%",
           "valueMaps": [
@@ -426,25 +428,190 @@
               "op": "=",
               "text": "N/A",
               "value": "null"
+            },
+            {
+              "op": "=",
+              "text": "OK",
+              "value": "1"
+            },
+            {
+              "op": "=",
+              "text": "DOWN",
+              "value": "0"
             }
           ],
           "valueName": "current"
-        },
-        {
-          "content": "",
-          "id": 7,
-          "links": [],
-          "mode": "markdown",
-          "span": 2,
-          "title": "",
-          "type": "text"
         }
       ],
       "repeat": null,
       "repeatIteration": null,
       "repeatRowId": null,
       "showTitle": true,
-      "title": "Nova APIs",
+      "title": "Service Status",
+      "titleSize": "h6"
+    },
+    {
+      "collapse": false,
+      "height": "250",
+      "panels": [
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "prometheus",
+          "fill": 1,
+          "id": 6,
+          "legend": {
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "sum(openstack_nova_http_response_times_rate{host=~\"^$host$\"})  by (http_status)",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{ http_status }}",
+              "refId": "A",
+              "step": 10
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Throughput",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "ops",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "prometheus",
+          "fill": 1,
+          "id": 7,
+          "legend": {
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "max(openstack_nova_http_response_times_upper_90{host=~\"^$host$\"})  by (http_method)",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{ http_method }}",
+              "refId": "A",
+              "step": 10
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Latency",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "s",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        }
+      ],
+      "repeat": null,
+      "repeatIteration": null,
+      "repeatRowId": null,
+      "showTitle": true,
+      "title": "API Performances",
       "titleSize": "h6"
     },
     {
@@ -523,7 +690,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -599,7 +766,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -675,7 +842,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -729,7 +896,7 @@
               "intervalFactor": 2,
               "legendFormat": "{{ state }}",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -840,7 +1007,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -916,7 +1083,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -992,7 +1159,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -1046,7 +1213,7 @@
               "intervalFactor": 2,
               "legendFormat": "{{ state }}",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -1157,7 +1324,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -1233,7 +1400,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -1309,7 +1476,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -1363,7 +1530,7 @@
               "intervalFactor": 2,
               "legendFormat": "{{ state }}",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -1474,7 +1641,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -1550,7 +1717,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -1626,7 +1793,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -1680,7 +1847,7 @@
               "intervalFactor": 2,
               "legendFormat": "{{ state }}",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -1791,7 +1958,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -1867,7 +2034,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -1943,7 +2110,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -1997,7 +2164,7 @@
               "intervalFactor": 2,
               "legendFormat": "{{ state }}",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -2110,7 +2277,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -2164,7 +2331,7 @@
               "intervalFactor": 2,
               "legendFormat": "active",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -2265,7 +2432,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -2319,7 +2486,7 @@
               "intervalFactor": 2,
               "legendFormat": "error",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -2470,7 +2637,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -2548,7 +2715,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -2626,7 +2793,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -2704,7 +2871,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -2782,7 +2949,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -2860,7 +3027,7 @@
               "intervalFactor": 2,
               "legendFormat": "",
               "refId": "A",
-              "step": 20
+              "step": 60
             }
           ],
           "thresholds": "",
@@ -2926,7 +3093,7 @@
               "intervalFactor": 2,
               "legendFormat": "{{ aggregate }}",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -3003,7 +3170,7 @@
               "intervalFactor": 2,
               "legendFormat": "{{ aggregate }}",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -3080,7 +3247,7 @@
               "intervalFactor": 2,
               "legendFormat": "{{ aggregate }}",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -3157,7 +3324,7 @@
               "intervalFactor": 2,
               "legendFormat": "{{ aggregate }}",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -3234,7 +3401,7 @@
               "intervalFactor": 2,
               "legendFormat": "{{ aggregate }}",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -3311,7 +3478,7 @@
               "intervalFactor": 2,
               "legendFormat": "{{ aggregate }}",
               "refId": "A",
-              "step": 2
+              "step": 4
             }
           ],
           "thresholds": [],
@@ -3366,7 +3533,29 @@
     "nova"
   ],
   "templating": {
-    "list": []
+    "list": [
+      {
+        "allValue": null,
+        "current": {},
+        "datasource": "prometheus",
+        "hide": 0,
+        "includeAll": true,
+        "label": null,
+        "multi": true,
+        "name": "host",
+        "options": [],
+        "query": "label_values(openstack_nova_http_response_times_count,host)",
+        "refresh": 1,
+        "refresh_on_load": true,
+        "regex": "",
+        "sort": 1,
+        "tagValuesQuery": "",
+        "tags": [],
+        "tagsQuery": "",
+        "type": "query",
+        "useTags": false
+      }
+    ]
   },
   "time": {
     "from": "now-1h",
@@ -3399,6 +3588,6 @@
   },
   "timezone": "browser",
   "title": "Nova",
-  "version": 1
+  "version": 2
 }
 {% endraw %}
diff --git a/nova/files/juno/libvirtd.conf.Debian b/nova/files/juno/libvirtd.conf.Debian
index 8333dcb..4fab737 100644
--- a/nova/files/juno/libvirtd.conf.Debian
+++ b/nova/files/juno/libvirtd.conf.Debian
@@ -1,3 +1,4 @@
+{%- from "nova/map.jinja" import compute with context %}
 # Master libvirt daemon configuration file
 #
 # For further information consult http://libvirt.org/format.html
@@ -84,7 +85,7 @@
 # without becoming root.
 #
 # This is restricted to 'root' by default.
-unix_sock_group = "libvirtd"
+unix_sock_group = "{{ compute.get('libvirt_service_group', 'libvirtd') }}"
 
 # Set the UNIX socket permissions for the R/O socket. This is used
 # for monitoring VM status only
diff --git a/nova/files/juno/nova-compute.conf.Debian b/nova/files/juno/nova-compute.conf.Debian
index 2220177..de61288 100644
--- a/nova/files/juno/nova-compute.conf.Debian
+++ b/nova/files/juno/nova-compute.conf.Debian
@@ -15,6 +15,12 @@
 api_paste_config=/etc/nova/api-paste.ini
 volumes_path=/var/lib/nova/volumes
 enabled_apis=ec2,osapi_compute,metadata
+{%- if compute.my_ip is defined %}
+my_ip={{ compute.my_ip }}
+{%- endif %}
+{%- if compute.host is defined %}
+host={{ compute.host }}
+{%- endif %}
 
 allow_resize_to_same_host=True
 
@@ -148,3 +154,13 @@
 
 [cinder]
 catalog_info=volumev2:cinderv2:internalURL
+{%- if compute.cross_az_attach is defined %}
+cross_az_attach={{ compute.cross_az_attach }}
+{%- endif %}
+
+{%- if compute.upgrade_levels is defined %}
+[upgrade_levels]
+{%- for key, value in compute.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
diff --git a/nova/files/juno/nova-controller.conf.Debian b/nova/files/juno/nova-controller.conf.Debian
index 263539b..7d4c04e 100644
--- a/nova/files/juno/nova-controller.conf.Debian
+++ b/nova/files/juno/nova-controller.conf.Debian
@@ -154,3 +154,13 @@
 
 [cinder]
 catalog_info=volumev2:cinderv2:internalURL
+{%- if controller.cross_az_attach is defined %}
+cross_az_attach={{ controller.cross_az_attach }}
+{%- endif %}
+
+{%- if controller.upgrade_levels is defined %}
+[upgrade_levels]
+{%- for key, value in controller.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
diff --git a/nova/files/kilo/libvirtd.conf.Debian b/nova/files/kilo/libvirtd.conf.Debian
index 8333dcb..4fab737 100644
--- a/nova/files/kilo/libvirtd.conf.Debian
+++ b/nova/files/kilo/libvirtd.conf.Debian
@@ -1,3 +1,4 @@
+{%- from "nova/map.jinja" import compute with context %}
 # Master libvirt daemon configuration file
 #
 # For further information consult http://libvirt.org/format.html
@@ -84,7 +85,7 @@
 # without becoming root.
 #
 # This is restricted to 'root' by default.
-unix_sock_group = "libvirtd"
+unix_sock_group = "{{ compute.get('libvirt_service_group', 'libvirtd') }}"
 
 # Set the UNIX socket permissions for the R/O socket. This is used
 # for monitoring VM status only
diff --git a/nova/files/kilo/nova-compute.conf.Debian b/nova/files/kilo/nova-compute.conf.Debian
index c3e197a..059ae78 100644
--- a/nova/files/kilo/nova-compute.conf.Debian
+++ b/nova/files/kilo/nova-compute.conf.Debian
@@ -17,7 +17,12 @@
 volumes_path=/var/lib/nova/volumes
 enabled_apis=ec2,osapi_compute,metadata
 vnc_keymap = {{ compute.get('vnc_keymap', 'en-us') }}
-
+{%- if compute.my_ip is defined %}
+my_ip={{ compute.my_ip }}
+{%- endif %}
+{%- if compute.host is defined %}
+host={{ compute.host }}
+{%- endif %}
 
 {%- if compute.image.use_cow is defined %}
 use_cow_images = {{ compute.image.use_cow }}
@@ -178,6 +183,9 @@
 [cinder]
 os_region_name = {{ compute.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
+{%- if compute.cross_az_attach is defined %}
+cross_az_attach={{ compute.cross_az_attach }}
+{%- endif %}
 
 {%- if compute.get('ceph', {}).ephemeral is defined %}
 [libvirt]
@@ -190,3 +198,10 @@
 libvirt_inject_key=false
 libvirt_inject_partition=-2
 {%- endif %}
+
+{%- if compute.upgrade_levels is defined %}
+[upgrade_levels]
+{%- for key, value in compute.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
diff --git a/nova/files/kilo/nova-controller.conf.Debian b/nova/files/kilo/nova-controller.conf.Debian
index c86039a..228c358 100644
--- a/nova/files/kilo/nova-controller.conf.Debian
+++ b/nova/files/kilo/nova-controller.conf.Debian
@@ -210,3 +210,13 @@
 [cinder]
 os_region_name = {{ controller.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
+{%- if controller.cross_az_attach is defined %}
+cross_az_attach={{ controller.cross_az_attach }}
+{%- endif %}
+
+{%- if controller.upgrade_levels is defined %}
+[upgrade_levels]
+{%- for key, value in controller.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
diff --git a/nova/files/liberty/libvirtd.conf.Debian b/nova/files/liberty/libvirtd.conf.Debian
index 8333dcb..4fab737 100644
--- a/nova/files/liberty/libvirtd.conf.Debian
+++ b/nova/files/liberty/libvirtd.conf.Debian
@@ -1,3 +1,4 @@
+{%- from "nova/map.jinja" import compute with context %}
 # Master libvirt daemon configuration file
 #
 # For further information consult http://libvirt.org/format.html
@@ -84,7 +85,7 @@
 # without becoming root.
 #
 # This is restricted to 'root' by default.
-unix_sock_group = "libvirtd"
+unix_sock_group = "{{ compute.get('libvirt_service_group', 'libvirtd') }}"
 
 # Set the UNIX socket permissions for the R/O socket. This is used
 # for monitoring VM status only
diff --git a/nova/files/liberty/nova-compute.conf.Debian b/nova/files/liberty/nova-compute.conf.Debian
index 21654cd..90e56ee 100644
--- a/nova/files/liberty/nova-compute.conf.Debian
+++ b/nova/files/liberty/nova-compute.conf.Debian
@@ -24,6 +24,12 @@
 {%- if compute.image.use_cow is defined %}
 use_cow_images = {{ compute.image.use_cow }}
 {%- endif %}
+{%- if compute.my_ip is defined %}
+my_ip={{ compute.my_ip }}
+{%- endif %}
+{%- if compute.host is defined %}
+host={{ compute.host }}
+{%- endif %}
 
 reserved_host_memory_mb = {{ compute.get('reserved_host_memory_mb', '512') }}
 
@@ -192,10 +198,13 @@
 [cinder]
 os_region_name = {{ compute.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
+{%- if compute.cross_az_attach is defined %}
+cross_az_attach={{ compute.cross_az_attach }}
+{%- endif %}
 
 {%- if compute.get('ceph', {}).ephemeral is defined %}
 [libvirt]
-disk_cachemodes="network=writeback,block=none"
+disk_cachemodes="{{ compute.get('disk_cachemodes', 'network=writeback,block=none') }}"
 cpu_mode=host-passthrough
 virt_type=kvm
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST
@@ -211,3 +220,10 @@
 
 [vnc]
 keymap = {{ compute.get('vnc_keymap', 'en-us') }}
+
+{%- if compute.upgrade_levels is defined %}
+[upgrade_levels]
+{%- for key, value in compute.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
diff --git a/nova/files/liberty/nova-controller.conf.Debian b/nova/files/liberty/nova-controller.conf.Debian
index e33c50e..4ceb955 100644
--- a/nova/files/liberty/nova-controller.conf.Debian
+++ b/nova/files/liberty/nova-controller.conf.Debian
@@ -221,6 +221,16 @@
 [cinder]
 os_region_name = {{ controller.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
+{%- if controller.cross_az_attach is defined %}
+cross_az_attach={{ controller.cross_az_attach }}
+{%- endif %}
 
 [vnc]
 keymap = {{ controller.get('vnc_keymap', 'en-us') }}
+
+{%- if controller.upgrade_levels is defined %}
+[upgrade_levels]
+{%- for key, value in controller.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
diff --git a/nova/files/mitaka/libvirtd.conf.Debian b/nova/files/mitaka/libvirtd.conf.Debian
index 8333dcb..4fab737 100644
--- a/nova/files/mitaka/libvirtd.conf.Debian
+++ b/nova/files/mitaka/libvirtd.conf.Debian
@@ -1,3 +1,4 @@
+{%- from "nova/map.jinja" import compute with context %}
 # Master libvirt daemon configuration file
 #
 # For further information consult http://libvirt.org/format.html
@@ -84,7 +85,7 @@
 # without becoming root.
 #
 # This is restricted to 'root' by default.
-unix_sock_group = "libvirtd"
+unix_sock_group = "{{ compute.get('libvirt_service_group', 'libvirtd') }}"
 
 # Set the UNIX socket permissions for the R/O socket. This is used
 # for monitoring VM status only
diff --git a/nova/files/mitaka/nova-compute.conf.Debian b/nova/files/mitaka/nova-compute.conf.Debian
index ba31a2e..e89a442 100644
--- a/nova/files/mitaka/nova-compute.conf.Debian
+++ b/nova/files/mitaka/nova-compute.conf.Debian
@@ -27,6 +27,12 @@
 {%- if compute.image.use_cow is defined %}
 use_cow_images = {{ compute.image.use_cow }}
 {%- endif %}
+{%- if compute.my_ip is defined %}
+my_ip={{ compute.my_ip }}
+{%- endif %}
+{%- if compute.host is defined %}
+host={{ compute.host }}
+{%- endif %}
 
 remove_unused_original_minimum_age_seconds=86400
 image_service=nova.image.glance.GlanceImageService
@@ -112,7 +118,7 @@
 virt_type = kvm
 inject_partition=-2
 inject_password=False
-disk_cachemodes="network=writeback,block=none"
+disk_cachemodes="{{ compute.get('disk_cachemodes', 'network=writeback,block=none') }}"
 libvirt_inject_password=True
 block_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_NON_SHARED_INC
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST
@@ -189,8 +195,18 @@
 [cinder]
 os_region_name = {{ compute.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
+{%- if compute.cross_az_attach is defined %}
+cross_az_attach={{ compute.cross_az_attach }}
+{%- endif %}
 
 {%- if compute.workaround is defined %}
 [workarounds]
 disable_libvirt_livesnapshot={{ compute.workaround.get('disable_libvirt_livesnapshot', True)|lower }}
 {%- endif %}
+
+{%- if compute.upgrade_levels is defined %}
+[upgrade_levels]
+{%- for key, value in compute.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
diff --git a/nova/files/mitaka/nova-controller.conf.Debian b/nova/files/mitaka/nova-controller.conf.Debian
index 0cfc5eb..b808ef9 100644
--- a/nova/files/mitaka/nova-controller.conf.Debian
+++ b/nova/files/mitaka/nova-controller.conf.Debian
@@ -205,6 +205,9 @@
 [cinder]
 os_region_name = {{ controller.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
+{%- if controller.cross_az_attach is defined %}
+cross_az_attach={{ controller.cross_az_attach }}
+{%- endif %}
 
 [vnc]
 keymap = {{ controller.get('vnc_keymap', 'en-us') }}
@@ -254,3 +257,10 @@
 {% if controller.cors.allow_headers is defined %}
 allow_headers = {{ controller.cors.allow_headers }}
 {% endif %}
+
+{%- if controller.upgrade_levels is defined %}
+[upgrade_levels]
+{%- for key, value in controller.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
diff --git a/nova/files/newton/libvirtd.conf.Debian b/nova/files/newton/libvirtd.conf.Debian
index 8333dcb..4fab737 100644
--- a/nova/files/newton/libvirtd.conf.Debian
+++ b/nova/files/newton/libvirtd.conf.Debian
@@ -1,3 +1,4 @@
+{%- from "nova/map.jinja" import compute with context %}
 # Master libvirt daemon configuration file
 #
 # For further information consult http://libvirt.org/format.html
@@ -84,7 +85,7 @@
 # without becoming root.
 #
 # This is restricted to 'root' by default.
-unix_sock_group = "libvirtd"
+unix_sock_group = "{{ compute.get('libvirt_service_group', 'libvirtd') }}"
 
 # Set the UNIX socket permissions for the R/O socket. This is used
 # for monitoring VM status only
diff --git a/nova/files/newton/nova-compute.conf.Debian b/nova/files/newton/nova-compute.conf.Debian
index cad6f4f..d9f5975 100644
--- a/nova/files/newton/nova-compute.conf.Debian
+++ b/nova/files/newton/nova-compute.conf.Debian
@@ -29,6 +29,12 @@
 {%- if compute.image.use_cow is defined %}
 use_cow_images = {{ compute.image.use_cow }}
 {%- endif %}
+{%- if compute.my_ip is defined %}
+my_ip={{ compute.my_ip }}
+{%- endif %}
+{%- if compute.host is defined %}
+host={{ compute.host }}
+{%- endif %}
 
 remove_unused_original_minimum_age_seconds=86400
 image_service=nova.image.glance.GlanceImageService
@@ -137,7 +143,7 @@
 virt_type = kvm
 inject_partition=-2
 inject_password=False
-disk_cachemodes="network=writeback,block=none"
+disk_cachemodes="{{ compute.get('disk_cachemodes', 'network=writeback,block=none') }}"
 libvirt_inject_password=True
 block_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_NON_SHARED_INC
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST
@@ -201,6 +207,9 @@
 [cinder]
 os_region_name = {{ compute.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
+{%- if compute.cross_az_attach is defined %}
+cross_az_attach={{ compute.cross_az_attach }}
+{%- endif %}
 
 {%- if compute.ironic is defined %}
 [ironic]
@@ -218,3 +227,10 @@
 [workarounds]
 disable_libvirt_livesnapshot={{ compute.workaround.get('disable_libvirt_livesnapshot', True)|lower }}
 {%- endif %}
+
+{%- if compute.upgrade_levels is defined %}
+[upgrade_levels]
+{%- for key, value in compute.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
diff --git a/nova/files/newton/nova-controller.conf.Debian b/nova/files/newton/nova-controller.conf.Debian
index 6bc11cf..77e53eb 100644
--- a/nova/files/newton/nova-controller.conf.Debian
+++ b/nova/files/newton/nova-controller.conf.Debian
@@ -215,6 +215,9 @@
 [cinder]
 os_region_name = {{ controller.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
+{%- if controller.cross_az_attach is defined %}
+cross_az_attach={{ controller.cross_az_attach }}
+{%- endif %}
 
 [wsgi]
 api_paste_config=/etc/nova/api-paste.ini
@@ -263,3 +266,10 @@
 {% if controller.cors.allow_headers is defined %}
 allow_headers = {{ controller.cors.allow_headers }}
 {% endif %}
+
+{%- if controller.upgrade_levels is defined %}
+[upgrade_levels]
+{%- for key, value in controller.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
diff --git a/nova/files/newton/nova-controller.conf.RedHat b/nova/files/newton/nova-controller.conf.RedHat
index 6739f80..3d5263c 100644
--- a/nova/files/newton/nova-controller.conf.RedHat
+++ b/nova/files/newton/nova-controller.conf.RedHat
@@ -210,6 +210,16 @@
 [cinder]
 os_region_name = {{ controller.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
+{%- if controller.cross_az_attach is defined %}
+cross_az_attach={{ controller.cross_az_attach }}
+{%- endif %}
 
 [wsgi]
 api_paste_config=/etc/nova/api-paste.ini
+
+{%- if controller.upgrade_levels is defined %}
+[upgrade_levels]
+{%- for key, value in controller.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
diff --git a/nova/files/ocata/libvirtd.conf.Debian b/nova/files/ocata/libvirtd.conf.Debian
index 8333dcb..4fab737 100644
--- a/nova/files/ocata/libvirtd.conf.Debian
+++ b/nova/files/ocata/libvirtd.conf.Debian
@@ -1,3 +1,4 @@
+{%- from "nova/map.jinja" import compute with context %}
 # Master libvirt daemon configuration file
 #
 # For further information consult http://libvirt.org/format.html
@@ -84,7 +85,7 @@
 # without becoming root.
 #
 # This is restricted to 'root' by default.
-unix_sock_group = "libvirtd"
+unix_sock_group = "{{ compute.get('libvirt_service_group', 'libvirtd') }}"
 
 # Set the UNIX socket permissions for the R/O socket. This is used
 # for monitoring VM status only
diff --git a/nova/files/ocata/nova-compute.conf.Debian b/nova/files/ocata/nova-compute.conf.Debian
index ae358f6..77d4b50 100644
--- a/nova/files/ocata/nova-compute.conf.Debian
+++ b/nova/files/ocata/nova-compute.conf.Debian
@@ -1514,6 +1514,9 @@
 # * vpn_ip
 #  (string value)
 #my_ip=10.89.104.70
+{%- if compute.my_ip is defined %}
+my_ip={{ compute.my_ip }}
+{%- endif %}
 
 #
 # The IP address which is used to connect to the block storage network.
@@ -1536,6 +1539,9 @@
 # * String with hostname, FQDN or IP address. Default is hostname of this host.
 #  (string value)
 #host=lcy01-22
+{%- if compute.host is defined %}
+host={{ compute.host }}
+{%- endif %}
 
 #
 # Assign IPv6 and IPv4 addresses when creating instances.
@@ -4113,6 +4119,9 @@
 # By default there is no availability zone restriction on volume attach.
 #  (boolean value)
 #cross_az_attach=true
+{%- if compute.cross_az_attach is defined %}
+cross_az_attach={{ compute.cross_az_attach }}
+{%- endif %}
 
 
 [cloudpipe]
@@ -5893,7 +5902,7 @@
 virt_type = kvm
 inject_partition=-2
 inject_password=True
-disk_cachemodes="network=writeback,block=none"
+disk_cachemodes="{{ compute.get('disk_cachemodes', 'network=writeback,block=none') }}"
 block_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_NON_SHARED_INC
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST
 inject_key=True
@@ -9390,6 +9399,11 @@
 
 
 [upgrade_levels]
+{%- if compute.upgrade_levels is defined %}
+{%- for key, value in compute.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
 #
 # upgrade_levels options are used to set version cap for RPC
 # messages sent between different nova services.
diff --git a/nova/files/ocata/nova-controller.conf.Debian b/nova/files/ocata/nova-controller.conf.Debian
index 64cc4b8..7a8126a 100644
--- a/nova/files/ocata/nova-controller.conf.Debian
+++ b/nova/files/ocata/nova-controller.conf.Debian
@@ -4103,7 +4103,9 @@
 # By default there is no availability zone restriction on volume attach.
 #  (boolean value)
 #cross_az_attach=true
-
+{%- if controller.cross_az_attach is defined %}
+cross_az_attach={{ controller.cross_az_attach }}
+{%- endif %}
 
 [cloudpipe]
 
@@ -9395,6 +9397,11 @@
 
 
 [upgrade_levels]
+{%- if controller.upgrade_levels is defined %}
+{%- for key, value in controller.upgrade_levels.iteritems() %}
+{{ key }}={{ value }}
+{%- endfor %}
+{%- endif %}
 #
 # upgrade_levels options are used to set version cap for RPC
 # messages sent between different nova services.
diff --git a/nova/files/ocata/nova-placement-api.conf b/nova/files/ocata/nova-placement-api.conf
index 02e88cc..e7cde11 100644
--- a/nova/files/ocata/nova-placement-api.conf
+++ b/nova/files/ocata/nova-placement-api.conf
@@ -14,7 +14,7 @@
     </IfVersion>
 
     ErrorLog /var/log/apache2/nova_placement_error.log
-    CustomLog /var/log/apache2/nova_placement_access.log combined
+    CustomLog /var/log/apache2/nova_placement_access.log "%v:%p %h %l %u %t \"%r\" %>s %D %O \"%{Referer}i\" \"%{User-Agent}i\""
 
     <Directory /usr/bin>
         <IfVersion >= 2.4>
diff --git a/nova/map.jinja b/nova/map.jinja
index d99b5a4..b8f51e7 100644
--- a/nova/map.jinja
+++ b/nova/map.jinja
@@ -38,50 +38,67 @@
     },
 }, merge=pillar.nova.get('client', {})) %}
 
-{% set compute = salt['grains.filter_by']({
-    'Debian': {
-        'pkgs': ['nova-common', 'nova-compute-kvm', 'python-novaclient', 'pm-utils', 'sysfsutils', 'sg3-utils', 'libvirt-bin', 'python-memcache', 'qemu-kvm','python-guestfs', 'gettext-base'],
-        'services': ['nova-compute'],
-        'libvirt_config': 'libvirtd.conf',
-        'libvirt_bin': '/etc/default/libvirt-bin',
-        'libvirt_service': 'libvirt-bin',
-        'bind': compute_bind_defaults,
-        'debug': false,
-        'libvirt': [],
-        'instances_path': '$state_path/instances',
-        'notification': false,
-        'availability_zone': None,
-        'aggregates': [],
-        'identity': {
-            'region': 'RegionOne'
-        },
-        'network': {
-            'region': 'RegionOne'
-        },
-        'heal_instance_info_cache_interval': '60',
-    },
-    'RedHat': {
-        'pkgs': ['openstack-nova-compute', 'python-novaclient', 'python-nova', 'sysfsutils', 'sg3_utils'],
-        'services': ['messagebus', 'openstack-nova-compute', 'libvirtd'],
-        'libvirt_config': 'libvirt.conf',
-        'libvirt_bin': '/etc/sysconfig/libvirtd',
-        'libvirt_service': 'libvirtd',
-        'bind': compute_bind_defaults,
-        'debug': false,
-        'libvirt': [],
-        'notification': false,
-        'availability_zone': None,
-        'identity': {
-            'region': 'RegionOne'
-        },
-        'network': {
-            'region': 'RegionOne'
-        },
-        'heal_instance_info_cache_interval': '60',
-    },
-}, merge=pillar.nova.get('compute', {})) %}
+{%- load_yaml as compute_defaults %}
+Debian:
+  pkgs:
+  - nova-common
+  - nova-compute-kvm
+  - python-novaclient
+  - pm-utils
+  - sysfsutils
+  - sg3-utils
+  - libvirt-bin
+  - python-memcache
+  - qemu-kvm
+  - python-guestfs
+  - gettext-base
+  {%- if pillar.nova.compute is defined and pillar.nova.compute.get('networking', 'default') == "contrail" and pillar.nova.compute.get('version', 'ocata') not in ["juno", "kilo", "liberty", "mitaka", "newton"] %}
+  - contrail-nova-driver
+  {%- endif %}
+  services:
+  - nova-compute
+  libvirt_config: libvirtd.conf
+  libvirt_bin: "/etc/default/libvirt-bin"
+  libvirt_service: libvirt-bin
+  bind: compute_bind_defaults
+  debug: false
+  libvirt: []
+  instances_path: "$state_path/instances"
+  notification: false
+  availability_zone:
+  aggregates: []
+  identity:
+    region: RegionOne
+  network:
+    region: RegionOne
+  heal_instance_info_cache_interval: '60'
+RedHat:
+  pkgs:
+  - openstack-nova-compute
+  - python-novaclient
+  - python-nova
+  - sysfsutils
+  - sg3_utils
+  services:
+  - messagebus
+  - openstack-nova-compute
+  - libvirtd
+  libvirt_config: libvirt.conf
+  libvirt_bin: "/etc/sysconfig/libvirtd"
+  libvirt_service: libvirtd
+  bind: compute_bind_defaults
+  debug: false
+  libvirt: []
+  notification: false
+  availability_zone:
+  identity:
+    region: RegionOne
+  network:
+    region: RegionOne
+  heal_instance_info_cache_interval: '60'
+{%- endload %}
 
-
+{% set compute = salt["grains.filter_by"](compute_defaults, merge=pillar.nova.get("compute", {})) %}
 
 {% set monitoring = salt['grains.filter_by']({
     'default': {
diff --git a/nova/meta/heka.yml b/nova/meta/heka.yml
index 6121039..2ff45c8 100644
--- a/nova/meta/heka.yml
+++ b/nova/meta/heka.yml
@@ -1,3 +1,5 @@
+{% from "nova/map.jinja" import controller with context %}
+{%- set apache_wsgi = controller.get('enabled') and controller.version not in ('juno', 'kilo', 'liberty', 'mitaka', 'newton') %}
 log_collector:
   decoder:
     nova:
@@ -11,6 +13,16 @@
       module_file: /usr/share/lma_collector/decoders/libvirt_log.lua
       module_dir: /usr/share/lma_collector/common;/usr/share/heka/lua_modules
     {%- endif %}
+    {%- if apache_wsgi %}
+    nova_placement_wsgi:
+      engine: sandbox
+      module_file: /usr/share/lma_collector/decoders/apache_wsgi_log.lua
+      module_dir: /usr/share/lma_collector/common;/usr/share/heka/lua_modules
+      config:
+        logger: openstack.nova_placement
+        apache_log_pattern: >-
+          %v:%p %h %l %u %t \"%r\" %>s %D %O \"%{Referer}i\" \"%{User-Agent}i\"
+    {%- endif %}
   splitter:
     nova:
       engine: token
@@ -33,6 +45,16 @@
       decoder: "libvirt_decoder"
       splitter: "TokenSplitter"
     {%- endif %}
+    {%- if apache_wsgi %}
+    nova_placement_wsgi_log:
+      engine: logstreamer
+      log_directory: "/var/log/apache2"
+      file_match: 'nova_placement_access\.log'
+      differentiator: ['nova-placement-wsgi']
+      priority: ["^Seq"]
+      decoder: "nova_placement_wsgi_decoder"
+      splitter: "TokenSplitter"
+    {%- endif %}
 metric_collector:
   trigger:
     nova_logs_error:
diff --git a/tests/pillar/compute_cluster.sls b/tests/pillar/compute_cluster.sls
index c3a2485..2bcd9b4 100644
--- a/tests/pillar/compute_cluster.sls
+++ b/tests/pillar/compute_cluster.sls
@@ -7,6 +7,7 @@
       mount_points:
       - path: /mnt/hugepages_1GB
     virtualization: kvm
+    disk_cachemodes: network=writeback,block=none
     heal_instance_info_cache_interval: 60
     vncproxy_url: openstack:6080
     report_interval: 60
@@ -66,3 +67,6 @@
         port: 11211
     libvirt:
       hw_disk_discard: unmap
+    upgrade_levels:
+      compute: liberty
+    libvirt_service_group: libvirtd
diff --git a/tests/pillar/control_cluster.sls b/tests/pillar/control_cluster.sls
index 9744dd1..07cb450 100644
--- a/tests/pillar/control_cluster.sls
+++ b/tests/pillar/control_cluster.sls
@@ -62,3 +62,5 @@
       'context_is_admin': 'role:admin or role:administrator'
       'compute:create': 'rule:admin_or_owner'
       'compute:create:attach_network':
+    upgrade_levels:
+      compute: liberty