Merge "Allow to configure the pagination"
diff --git a/nova/_modules/novang.py b/nova/_modules/novang.py
new file mode 100644
index 0000000..018e41e
--- /dev/null
+++ b/nova/_modules/novang.py
@@ -0,0 +1,127 @@
+# -*- coding: utf-8 -*-
+from __future__ import absolute_import
+from pprint import pprint
+
+# Import python libs
+import logging
+
+# Import salt libs
+import salt.utils.openstack.nova as suon
+
+# Get logging started
+log = logging.getLogger(__name__)
+
+# Function alias to not shadow built-ins
+__func_alias__ = {
+    'list_': 'list'
+}
+
+# Define the module's virtual name
+__virtualname__ = 'novang'
+
+
+def __virtual__():
+    '''
+    Only load this module if nova
+    is installed on this minion.
+    '''
+    if suon.check_nova():
+        return __virtualname__
+    return (False, 'The nova execution module failed to load: '
+            'only available if nova is installed.')
+
+
+__opts__ = {}
+
+
+def _auth(profile=None):
+    '''
+    Set up nova credentials
+    '''
+    if profile:
+        credentials = __salt__['config.option'](profile)
+        user = credentials['keystone.user']
+        password = credentials['keystone.password']
+        tenant = credentials['keystone.tenant']
+        auth_url = credentials['keystone.auth_url']
+        region_name = credentials.get('keystone.region_name', None)
+        api_key = credentials.get('keystone.api_key', None)
+        os_auth_system = credentials.get('keystone.os_auth_system', None)
+    else:
+        user = __salt__['config.option']('keystone.user')
+        password = __salt__['config.option']('keystone.password')
+        tenant = __salt__['config.option']('keystone.tenant')
+        auth_url = __salt__['config.option']('keystone.auth_url')
+        region_name = __salt__['config.option']('keystone.region_name')
+        api_key = __salt__['config.option']('keystone.api_key')
+        os_auth_system = __salt__['config.option']('keystone.os_auth_system')
+    kwargs = {
+        'username': user,
+        'password': password,
+        'api_key': api_key,
+        'project_id': tenant,
+        'auth_url': auth_url,
+        'region_name': region_name,
+        'os_auth_plugin': os_auth_system
+    }
+
+    return suon.SaltNova(**kwargs)
+
+
+def get_connection_args(profile=None):
+    '''
+    Set up profile credentials
+    '''
+    if profile:
+        credentials = __salt__['config.option'](profile)
+        user = credentials['keystone.user']
+        password = credentials['keystone.password']
+        tenant = credentials['keystone.tenant']
+        auth_url = credentials['keystone.auth_url']
+
+    kwargs = {
+        'username': user,
+        'password': password,
+        'tenant': tenant,
+        'auth_url': auth_url
+    }
+    return kwargs
+
+
+def quota_list(tenant_name, profile=None):
+    '''
+    list quotas of a tenant
+    '''
+    connection_args = get_connection_args(profile)
+    tenant = __salt__['keystone.tenant_get'](name=tenant_name, profile=profile, **connection_args)
+    tenant_id = tenant[tenant_name]['id']
+    conn = _auth(profile)
+    nt_ks = conn.compute_conn
+    item = nt_ks.quotas.get(tenant_id).__dict__
+    return item
+
+
+def quota_get(name, tenant_name, profile=None, quota_value=None):
+    '''
+    get specific quota value of a tenant
+    '''
+    item = quota_list(tenant_name, profile)
+    quota_value = item[name]
+    return quota_value
+
+
+def quota_update(tenant_name, profile=None, **quota_argument):
+    '''
+    update quota of specified tenant
+    '''
+    connection_args = get_connection_args(profile)
+    tenant = __salt__['keystone.tenant_get'](name=tenant_name, profile=profile, **connection_args)
+    tenant_id = tenant[tenant_name]['id']
+    conn = _auth(profile)
+    nt_ks = conn.compute_conn
+    item = nt_ks.quotas.update(tenant_id, **quota_argument)
+    return item
+
+
+
+
diff --git a/nova/_states/novang.py b/nova/_states/novang.py
index 13a713a..124faf4 100644
--- a/nova/_states/novang.py
+++ b/nova/_states/novang.py
@@ -2,28 +2,27 @@
 '''
 Nova state that ensures that defined flavor is present
 '''
+import logging
+from functools import wraps
+LOG = logging.getLogger(__name__)
 
 
 def __virtual__():
     '''
     Only load if the nova module is in __salt__
     '''
-    return 'novang' if 'nova.flavor_list' in __salt__ else False
+    return 'novang' if 'nova.flavor_list' in __salt__ else False   
 
 
 def flavor_present(name, flavor_id=0, ram=0, disk=0, vcpus=1, profile=None):
     '''
-    Ensures that the nova flavor exists
-    
+    Ensures that the nova flavor exists  
     '''
-    print profile
-    print name
     ret = {'name': name,
            'changes': {},
            'result': True,
            'comment': 'Flavor "{0}" already exists'.format(name)}
     project = __salt__['nova.flavor_list'](profile)
-    print project
     if 'Error' in project:
         pass
     elif name in project:
@@ -35,3 +34,45 @@
     return ret
 
 
+def quota_present(tenant_name, profile, name=None, **kwargs):
+    '''
+    Ensures that the nova quota exists
+    '''
+    changes = {}
+    for key, value in kwargs.items():
+        quota = __salt__['novang.quota_get'](key, tenant_name, profile)
+        if quota != value:
+            arg = {}
+            arg[key] = value
+            changes[key] = value
+            __salt__['novang.quota_update'](tenant_name, profile, **arg)
+    if bool(changes):
+        return _updated(tenant_name, 'tenant', changes)        
+    else:
+        return _no_change(tenant_name, 'tenant')
+
+def _updated(name, resource, resource_definition):
+    changes_dict = {'name': name,
+                    'changes': resource_definition,
+                    'result': True,
+                    'comment': '{0} {1} tenant was updated'.format(resource, name)}
+    return changes_dict
+
+def _update_failed(name, resource):
+    changes_dict = {'name': name,
+                    'changes': {},
+                    'comment': '{0} {1} failed to update'.format(resource, name),
+                    'result': False}
+    return changes_dict
+
+def _no_change(name, resource, test=False):
+    changes_dict = {'name': name,
+                    'changes': {},
+                    'result': True}
+    if test:
+        changes_dict['comment'] = \
+            '{0} {1} will be {2}'.format(resource, name, test)
+    else:
+        changes_dict['comment'] = \
+            '{0} {1} is in correct state'.format(resource, name)
+    return changes_dict
diff --git a/nova/files/grafana_dashboards/hypervisor_influxdb.json b/nova/files/grafana_dashboards/hypervisor_influxdb.json
index 2b9bf5e..66bdddc 100644
--- a/nova/files/grafana_dashboards/hypervisor_influxdb.json
+++ b/nova/files/grafana_dashboards/hypervisor_influxdb.json
@@ -3,15 +3,15 @@
     "list": []
   },
   "editable": true,
+  "gnetId": null,
+  "graphTooltip": 1,
   "hideControls": false,
   "id": null,
   "links": [],
-  "originalTitle": "Hypervisor",
   "refresh": "1m",
   "rows": [
     {
       "collapse": false,
-      "editable": true,
       "height": "250px",
       "panels": [
         {
@@ -21,12 +21,7 @@
           "editable": true,
           "error": false,
           "fill": 0,
-          "grid": {
-            "threshold1": null,
-            "threshold1Color": "rgba(216, 200, 27, 0.27)",
-            "threshold2": null,
-            "threshold2Color": "rgba(234, 112, 112, 0.22)"
-          },
+          "grid": {},
           "id": 8,
           "interval": ">60s",
           "legend": {
@@ -100,8 +95,14 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ]
             },
@@ -154,8 +155,14 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ],
               "target": ""
@@ -209,8 +216,14 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ],
               "target": ""
@@ -264,8 +277,14 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ],
               "target": ""
@@ -319,8 +338,14 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ],
               "target": ""
@@ -374,8 +399,14 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ],
               "target": ""
@@ -429,24 +460,35 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ],
               "target": ""
             }
           ],
+          "thresholds": [],
           "timeFrom": null,
           "timeShift": null,
           "title": "CPU",
           "tooltip": {
             "msResolution": false,
             "shared": true,
+            "sort": 0,
             "value_type": "cumulative"
           },
           "type": "graph",
           "xaxis": {
-            "show": true
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
           },
           "yaxes": [
             {
@@ -476,11 +518,7 @@
           "fill": 1,
           "grid": {
             "max": null,
-            "min": null,
-            "threshold1": null,
-            "threshold1Color": "rgba(216, 200, 27, 0.27)",
-            "threshold2": null,
-            "threshold2Color": "rgba(234, 112, 112, 0.22)"
+            "min": null
           },
           "id": 9,
           "interactive": true,
@@ -562,8 +600,14 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ],
               "target": "randomWalk('random walk')"
@@ -618,8 +662,14 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ],
               "target": ""
@@ -674,8 +724,14 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ],
               "target": ""
@@ -730,13 +786,20 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ],
               "target": ""
             }
           ],
+          "thresholds": [],
           "timeFrom": null,
           "timeShift": null,
           "timezone": "browser",
@@ -745,11 +808,15 @@
             "msResolution": false,
             "query_as_alias": true,
             "shared": true,
+            "sort": 0,
             "value_type": "individual"
           },
           "type": "graph",
           "xaxis": {
-            "show": true
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
           },
           "yaxes": [
             {
@@ -789,9 +856,20 @@
             "thresholdLabels": false,
             "thresholdMarkers": true
           },
-          "id": 10,
+          "id": 12,
           "interval": ">60s",
           "links": [],
+          "mappingType": 1,
+          "mappingTypes": [
+            {
+              "name": "value to text",
+              "value": 1
+            },
+            {
+              "name": "range to text",
+              "value": 2
+            }
+          ],
           "maxDataPoints": 100,
           "nullPointMode": "connected",
           "nullText": null,
@@ -799,6 +877,13 @@
           "postfixFontSize": "50%",
           "prefix": "",
           "prefixFontSize": "50%",
+          "rangeMaps": [
+            {
+              "from": "null",
+              "text": "N/A",
+              "to": "null"
+            }
+          ],
           "span": 2,
           "sparkline": {
             "fillColor": "rgba(31, 118, 189, 0.18)",
@@ -810,31 +895,25 @@
             {
               "column": "value",
               "dsType": "influxdb",
-              "fields": [
-                {
-                  "func": "last",
-                  "name": "value"
-                }
-              ],
               "function": "mean",
               "groupBy": [
                 {
-                  "interval": "auto",
                   "params": [
-                    "auto"
+                    "$interval"
                   ],
                   "type": "time"
                 },
                 {
                   "params": [
-                    "previous"
+                    "null"
                   ],
                   "type": "fill"
                 }
               ],
+              "groupByTags": [],
               "measurement": "fs_space_percent_free",
               "policy": "default",
-              "query": "SELECT last(\"value\") FROM \"fs_space_percent_free\" WHERE \"hostname\" =~ /^$hostname$/ AND \"fs\" = '/var/lib/nova' AND $timeFilter GROUP BY time($interval) fill(previous)",
+              "query": "SELECT mean(\"value\") FROM \"fs_space_percent_free\" WHERE \"hostname\" =~ /^$server$/ AND \"fs\" =~ /^$mount$/ AND $timeFilter GROUP BY time($interval) fill(null)",
               "rawQuery": false,
               "refId": "A",
               "resultFormat": "time_series",
@@ -848,27 +927,33 @@
                   },
                   {
                     "params": [],
-                    "type": "last"
+                    "type": "mean"
                   }
                 ]
               ],
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
                 },
                 {
                   "condition": "AND",
                   "key": "fs",
                   "operator": "=",
-                  "value": "/var/lib/nova"
+                  "value": "/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ]
             }
           ],
           "thresholds": "10,15",
-          "title": "Available ephemeral storage",
+          "title": "Free space",
           "type": "singlestat",
           "valueFontSize": "80%",
           "valueMaps": [
@@ -881,12 +966,15 @@
           "valueName": "current"
         }
       ],
+      "repeat": null,
+      "repeatIteration": null,
+      "repeatRowId": null,
       "showTitle": true,
-      "title": "Host"
+      "title": "Host",
+      "titleSize": "h6"
     },
     {
       "collapse": false,
-      "editable": true,
       "height": "250px",
       "panels": [
         {
@@ -911,8 +999,18 @@
           },
           "id": 11,
           "interval": "> 60s",
-          "isNew": true,
           "links": [],
+          "mappingType": 1,
+          "mappingTypes": [
+            {
+              "name": "value to text",
+              "value": 1
+            },
+            {
+              "name": "range to text",
+              "value": 2
+            }
+          ],
           "maxDataPoints": 100,
           "nullPointMode": "connected",
           "nullText": null,
@@ -920,6 +1018,13 @@
           "postfixFontSize": "50%",
           "prefix": "",
           "prefixFontSize": "50%",
+          "rangeMaps": [
+            {
+              "from": "null",
+              "text": "N/A",
+              "to": "null"
+            }
+          ],
           "span": 3,
           "sparkline": {
             "fillColor": "rgba(31, 118, 189, 0.18)",
@@ -967,8 +1072,14 @@
               "tags": [
                 {
                   "key": "hostname",
-                  "operator": "=",
-                  "value": "$hostname"
+                  "operator": "=~",
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ]
             }
@@ -993,14 +1104,8 @@
           "editable": true,
           "error": false,
           "fill": 0,
-          "grid": {
-            "threshold1": null,
-            "threshold1Color": "rgba(216, 200, 27, 0.27)",
-            "threshold2": null,
-            "threshold2Color": "rgba(234, 112, 112, 0.22)"
-          },
+          "grid": {},
           "id": 5,
-          "isNew": true,
           "legend": {
             "avg": false,
             "current": false,
@@ -1064,7 +1169,13 @@
                 {
                   "key": "hostname",
                   "operator": "=~",
-                  "value": "/$hostname$/"
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ]
             },
@@ -1109,22 +1220,33 @@
                 {
                   "key": "hostname",
                   "operator": "=~",
-                  "value": "/$hostname$/"
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ]
             }
           ],
+          "thresholds": [],
           "timeFrom": null,
           "timeShift": null,
           "title": "Virtual CPUs",
           "tooltip": {
             "msResolution": false,
             "shared": true,
+            "sort": 0,
             "value_type": "cumulative"
           },
           "type": "graph",
           "xaxis": {
-            "show": true
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
           },
           "yaxes": [
             {
@@ -1150,14 +1272,8 @@
           "editable": true,
           "error": false,
           "fill": 0,
-          "grid": {
-            "threshold1": null,
-            "threshold1Color": "rgba(216, 200, 27, 0.27)",
-            "threshold2": null,
-            "threshold2Color": "rgba(234, 112, 112, 0.22)"
-          },
+          "grid": {},
           "id": 6,
-          "isNew": true,
           "legend": {
             "avg": false,
             "current": false,
@@ -1221,7 +1337,13 @@
                 {
                   "key": "hostname",
                   "operator": "=~",
-                  "value": "/$hostname$/"
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ]
             },
@@ -1266,22 +1388,33 @@
                 {
                   "key": "hostname",
                   "operator": "=~",
-                  "value": "/$hostname$/"
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ]
             }
           ],
+          "thresholds": [],
           "timeFrom": null,
           "timeShift": null,
           "title": "Virtual RAM",
           "tooltip": {
             "msResolution": false,
             "shared": true,
+            "sort": 0,
             "value_type": "cumulative"
           },
           "type": "graph",
           "xaxis": {
-            "show": true
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
           },
           "yaxes": [
             {
@@ -1307,14 +1440,8 @@
           "editable": true,
           "error": false,
           "fill": 0,
-          "grid": {
-            "threshold1": null,
-            "threshold1Color": "rgba(216, 200, 27, 0.27)",
-            "threshold2": null,
-            "threshold2Color": "rgba(234, 112, 112, 0.22)"
-          },
+          "grid": {},
           "id": 7,
-          "isNew": true,
           "legend": {
             "avg": false,
             "current": false,
@@ -1378,7 +1505,13 @@
                 {
                   "key": "hostname",
                   "operator": "=~",
-                  "value": "/$hostname$/"
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ]
             },
@@ -1423,22 +1556,33 @@
                 {
                   "key": "hostname",
                   "operator": "=~",
-                  "value": "/$hostname$/"
+                  "value": "/^$hostname$/"
+                },
+                {
+                  "condition": "AND",
+                  "key": "environment_label",
+                  "operator": "=~",
+                  "value": "/^$environment$/"
                 }
               ]
             }
           ],
+          "thresholds": [],
           "timeFrom": null,
           "timeShift": null,
           "title": "Virtual Disk",
           "tooltip": {
             "msResolution": false,
             "shared": true,
+            "sort": 0,
             "value_type": "cumulative"
           },
           "type": "graph",
           "xaxis": {
-            "show": true
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
           },
           "yaxes": [
             {
@@ -1458,12 +1602,15 @@
           ]
         }
       ],
+      "repeat": null,
+      "repeatIteration": null,
+      "repeatRowId": null,
       "showTitle": true,
-      "title": "Virtual Resources"
+      "title": "Virtual Resources",
+      "titleSize": "h6"
     },
     {
       "collapse": false,
-      "editable": true,
       "height": "250px",
       "panels": [
         {
@@ -1473,12 +1620,7 @@
           "editable": true,
           "error": false,
           "fill": 1,
-          "grid": {
-            "threshold1": null,
-            "threshold1Color": "rgba(216, 200, 27, 0.27)",
-            "threshold2": null,
-            "threshold2Color": "rgba(234, 112, 112, 0.22)"
-          },
+          "grid": {},
           "id": 1,
           "interval": ">60s",
           "legend": {
@@ -1554,15 +1696,9 @@
               ],
               "tags": [
                 {
-                  "key": "hostname",
-                  "operator": "=~",
-                  "value": "/$hostname$/"
-                },
-                {
-                  "condition": "AND",
                   "key": "instance_id",
                   "operator": "=~",
-                  "value": "/$instance_id$/"
+                  "value": "/^$instance_id$/"
                 }
               ]
             },
@@ -1617,30 +1753,29 @@
               ],
               "tags": [
                 {
-                  "key": "hostname",
-                  "operator": "=~",
-                  "value": "/$hostname$/"
-                },
-                {
-                  "condition": "AND",
                   "key": "instance_id",
                   "operator": "=~",
-                  "value": "/$instance_id$/"
+                  "value": "/^$instance_id$/"
                 }
               ]
             }
           ],
+          "thresholds": [],
           "timeFrom": null,
           "timeShift": null,
           "title": "CPU",
           "tooltip": {
             "msResolution": false,
             "shared": true,
+            "sort": 0,
             "value_type": "cumulative"
           },
           "type": "graph",
           "xaxis": {
-            "show": true
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
           },
           "yaxes": [
             {
@@ -1668,12 +1803,7 @@
           "editable": true,
           "error": false,
           "fill": 1,
-          "grid": {
-            "threshold1": null,
-            "threshold1Color": "rgba(216, 200, 27, 0.27)",
-            "threshold2": null,
-            "threshold2Color": "rgba(234, 112, 112, 0.22)"
-          },
+          "grid": {},
           "id": 2,
           "interval": ">60s",
           "legend": {
@@ -1737,30 +1867,29 @@
               ],
               "tags": [
                 {
-                  "key": "hostname",
-                  "operator": "=~",
-                  "value": "/$hostname$/"
-                },
-                {
-                  "condition": "AND",
                   "key": "instance_id",
                   "operator": "=~",
-                  "value": "/$instance_id$/"
+                  "value": "/^$instance_id$/"
                 }
               ]
             }
           ],
+          "thresholds": [],
           "timeFrom": null,
           "timeShift": null,
           "title": "Memory",
           "tooltip": {
             "msResolution": false,
             "shared": true,
+            "sort": 0,
             "value_type": "cumulative"
           },
           "type": "graph",
           "xaxis": {
-            "show": true
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
           },
           "yaxes": [
             {
@@ -1788,12 +1917,7 @@
           "editable": true,
           "error": false,
           "fill": 1,
-          "grid": {
-            "threshold1": null,
-            "threshold1Color": "rgba(216, 200, 27, 0.27)",
-            "threshold2": null,
-            "threshold2Color": "rgba(234, 112, 112, 0.22)"
-          },
+          "grid": {},
           "id": 3,
           "interval": "> 60s",
           "legend": {
@@ -1857,21 +1981,15 @@
               ],
               "tags": [
                 {
-                  "key": "hostname",
-                  "operator": "=~",
-                  "value": "/$hostname$/"
-                },
-                {
-                  "condition": "AND",
                   "key": "instance_id",
                   "operator": "=~",
-                  "value": "/$instance_id$/"
+                  "value": "/^$instance_id$/"
                 },
                 {
                   "condition": "AND",
                   "key": "device",
                   "operator": "=~",
-                  "value": "/$disk$/"
+                  "value": "/^$disk$/"
                 }
               ]
             },
@@ -1914,12 +2032,6 @@
               ],
               "tags": [
                 {
-                  "key": "hostname",
-                  "operator": "=~",
-                  "value": "/$hostname$/"
-                },
-                {
-                  "condition": "AND",
                   "key": "instance_id",
                   "operator": "=~",
                   "value": "/$instance_id$/"
@@ -1928,22 +2040,27 @@
                   "condition": "AND",
                   "key": "device",
                   "operator": "=~",
-                  "value": "/$disk$/"
+                  "value": "/^$disk$/"
                 }
               ]
             }
           ],
+          "thresholds": [],
           "timeFrom": null,
           "timeShift": null,
           "title": "Disk I/O",
           "tooltip": {
             "msResolution": false,
             "shared": true,
+            "sort": 0,
             "value_type": "cumulative"
           },
           "type": "graph",
           "xaxis": {
-            "show": true
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
           },
           "yaxes": [
             {
@@ -1969,12 +2086,7 @@
           "editable": true,
           "error": false,
           "fill": 1,
-          "grid": {
-            "threshold1": null,
-            "threshold1Color": "rgba(216, 200, 27, 0.27)",
-            "threshold2": null,
-            "threshold2Color": "rgba(234, 112, 112, 0.22)"
-          },
+          "grid": {},
           "id": 4,
           "interval": "> 60s",
           "legend": {
@@ -2038,21 +2150,15 @@
               ],
               "tags": [
                 {
-                  "key": "hostname",
-                  "operator": "=~",
-                  "value": "/$hostname$/"
-                },
-                {
-                  "condition": "AND",
                   "key": "instance_id",
                   "operator": "=~",
-                  "value": "/$instance_id$/"
+                  "value": "/^$instance_id$/"
                 },
                 {
                   "condition": "AND",
                   "key": "interface",
                   "operator": "=~",
-                  "value": "/$interface$/"
+                  "value": "/^$interface$/"
                 }
               ]
             },
@@ -2095,36 +2201,35 @@
               ],
               "tags": [
                 {
-                  "key": "hostname",
-                  "operator": "=~",
-                  "value": "/$hostname$/"
-                },
-                {
-                  "condition": "AND",
                   "key": "instance_id",
                   "operator": "=~",
-                  "value": "/$instance_id$/"
+                  "value": "/^$instance_id$/"
                 },
                 {
                   "condition": "AND",
                   "key": "interface",
                   "operator": "=~",
-                  "value": "/$interface$/"
+                  "value": "/^$interface$/"
                 }
               ]
             }
           ],
+          "thresholds": [],
           "timeFrom": null,
           "timeShift": null,
           "title": "Network I/O",
           "tooltip": {
             "msResolution": false,
             "shared": true,
+            "sort": 0,
             "value_type": "cumulative"
           },
           "type": "graph",
           "xaxis": {
-            "show": true
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
           },
           "yaxes": [
             {
@@ -2144,11 +2249,15 @@
           ]
         }
       ],
+      "repeat": null,
+      "repeatIteration": null,
+      "repeatRowId": null,
       "showTitle": true,
-      "title": "Virtual instance"
+      "title": "Virtual instance",
+      "titleSize": "h6"
     }
   ],
-  "schemaVersion": 12,
+  "schemaVersion": 14,
   "sharedCrosshair": true,
   "style": "dark",
   "tags": [],
@@ -2156,40 +2265,57 @@
     "list": [
       {
         "allFormat": "regex values",
+        "allValue": null,
         "current": {},
-        "datasource": null,
+        "datasource": "lma",
         "hide": 0,
         "includeAll": false,
+        "label": null,
+        "multi": false,
         "name": "environment",
         "options": [],
         "query": "show tag values from cpu_idle with key = environment_label",
         "refresh": 1,
         "refresh_on_load": true,
         "regex": "",
-        "type": "query"
+        "sort": 1,
+        "tagValuesQuery": "",
+        "tags": [],
+        "tagsQuery": "",
+        "type": "query",
+        "useTags": false
       },
       {
         "allFormat": "glob",
+        "allValue": null,
         "current": {},
-        "datasource": null,
+        "datasource": "lma",
         "hide": 0,
         "includeAll": false,
+        "label": null,
         "multi": false,
         "multiFormat": "glob",
         "name": "hostname",
         "options": [],
-        "query": "show tag values from openstack_nova_running_instances with key = hostname where environment_label =~ /^$environment$/",
+        "query": "show tag values from libvirt_check with key = hostname where environment_label =~ /^$environment$/",
         "refresh": 1,
         "refresh_on_load": true,
         "regex": "",
-        "type": "query"
+        "sort": 1,
+        "tagValuesQuery": "",
+        "tags": [],
+        "tagsQuery": "",
+        "type": "query",
+        "useTags": false
       },
       {
         "allFormat": "glob",
+        "allValue": null,
         "current": {},
-        "datasource": null,
+        "datasource": "lma",
         "hide": 0,
         "includeAll": false,
+        "label": null,
         "multi": false,
         "multiFormat": "glob",
         "name": "instance_id",
@@ -2197,14 +2323,22 @@
         "query": "show tag values from virt_cpu_time with key = instance_id where hostname =~ /^$hostname$/ and environment_label =~ /^$environment$/",
         "refresh": 1,
         "refresh_on_load": true,
-        "type": "query"
+        "regex": "",
+        "sort": 1,
+        "tagValuesQuery": "",
+        "tags": [],
+        "tagsQuery": "",
+        "type": "query",
+        "useTags": false
       },
       {
         "allFormat": "glob",
+        "allValue": null,
         "current": {},
-        "datasource": null,
+        "datasource": "lma",
         "hide": 0,
         "includeAll": false,
+        "label": null,
         "multi": false,
         "multiFormat": "glob",
         "name": "disk",
@@ -2213,14 +2347,21 @@
         "refresh": 1,
         "refresh_on_load": true,
         "regex": "",
-        "type": "query"
+        "sort": 1,
+        "tagValuesQuery": "",
+        "tags": [],
+        "tagsQuery": "",
+        "type": "query",
+        "useTags": false
       },
       {
         "allFormat": "glob",
+        "allValue": null,
         "current": {},
-        "datasource": null,
+        "datasource": "lma",
         "hide": 0,
         "includeAll": false,
+        "label": null,
         "multi": false,
         "multiFormat": "glob",
         "name": "interface",
@@ -2228,7 +2369,13 @@
         "query": "show tag values from virt_if_octets_rx with key = interface where hostname =~ /^$hostname$/ and instance_id =~ /^$instance_id$/ and environment_label =~ /^$environment$/",
         "refresh": 1,
         "refresh_on_load": true,
-        "type": "query"
+        "regex": "",
+        "sort": 1,
+        "tagValuesQuery": "",
+        "tags": [],
+        "tagsQuery": "",
+        "type": "query",
+        "useTags": false
       }
     ]
   },
@@ -2264,5 +2411,5 @@
   },
   "timezone": "browser",
   "title": "Hypervisor",
-  "version": 2
+  "version": 3
 }
diff --git a/nova/files/mitaka/nova-compute.conf.Debian b/nova/files/mitaka/nova-compute.conf.Debian
index 3cd526e..af03d27 100644
--- a/nova/files/mitaka/nova-compute.conf.Debian
+++ b/nova/files/mitaka/nova-compute.conf.Debian
@@ -93,7 +93,7 @@
 {%- if compute.cache is defined %}
 backend = oslo_cache.memcache_pool
 enabled = true
-memcached_servers={%- for member in compute.cache.members %}{{ member.host }}:11211{% if not loop.last %},{% endif %}{%- endfor %}
+memcache_servers={%- for member in compute.cache.members %}{{ member.host }}:11211{% if not loop.last %},{% endif %}{%- endfor %}
 {%- endif %}
 
 [libvirt]