Grafana volume config

Change-Id: I9b98ee388ce4b9917f63659822463ab0e5b415a9
diff --git a/docker/swarm/stack/dashboard.yml b/docker/swarm/stack/dashboard.yml
index 2ee123b..65814b9 100644
--- a/docker/swarm/stack/dashboard.yml
+++ b/docker/swarm/stack/dashboard.yml
@@ -1,10 +1,12 @@
 parameters:
   _param:
-    docker_grafana_replicas: 1
+    docker_grafana_replicas: 3
     grafana_database_type: sqlite3
     grafana_database_host: localhost
     grafana_database_port: 3306
     grafana_database_password: password
+    grafana_session_directory: /data/sessions
+    grafana_session_life_time: 86400
   docker:
     client:
       stack:
@@ -18,6 +20,8 @@
               image: ${_param:docker_image_grafana}
               ports:
                 - 15013:3000
+              volumes:
+                /srv/glusterfs/grafana:${_param:grafana_session_directory}
               environment:
                 GF_DATABASE_TYPE: ${_param:grafana_database_type}
                 GF_DATABASE_NAME: grafana
@@ -25,3 +29,6 @@
                 GF_DATABASE_PASSWORD: ${_param:grafana_database_password}
                 GF_DATABASE_HOST: "${_param:grafana_database_host}:${_param:grafana_database_port}"
                 GF_SECURITY_ADMIN_PASSWORD: ${_param:grafana_admin_password}
+                GF_SESSION_PROVIDER: file
+                GF_SESSION_PROVIDER_CONFIG: ${_param:grafana_session_directory}
+                GF_SESSION_LIFE_TIME: ${_param:grafana_session_life_time}
diff --git a/glusterfs/client/volume/grafana.yaml b/glusterfs/client/volume/grafana.yaml
new file mode 100644
index 0000000..bd939c1
--- /dev/null
+++ b/glusterfs/client/volume/grafana.yaml
@@ -0,0 +1,13 @@
+parameters:
+  _param:
+    grafana_glusterfs_service_host: ${_param:glusterfs_service_host}
+    glusterfs_node01_address: ${_param:cluster_node01_address}
+    glusterfs_node02_address: ${_param:cluster_node02_address}
+    glusterfs_node03_address: ${_param:cluster_node03_address}
+  glusterfs:
+    client:
+      volumes:
+        grafana:
+          path: /srv/volumes/grafana
+          server: ${_param:grafana_glusterfs_service_host}
+          opts: "defaults,backup-volfile-servers=${_param:glusterfs_node01_address}:${_param:glusterfs_node02_address}:${_param:glusterfs_node03_address}"
diff --git a/glusterfs/server/volume/grafana.yaml b/glusterfs/server/volume/grafana.yaml
new file mode 100644
index 0000000..f099c99
--- /dev/null
+++ b/glusterfs/server/volume/grafana.yaml
@@ -0,0 +1,17 @@
+parameters:
+  glusterfs:
+    server:
+      volumes:
+        grafana:
+          storage: /srv/glusterfs/grafana
+          replica: 3
+          bricks:
+            - ${_param:cluster_node01_address}:/srv/glusterfs/grafana
+            - ${_param:cluster_node02_address}:/srv/glusterfs/grafana
+            - ${_param:cluster_node03_address}:/srv/glusterfs/grafana
+          options:
+            cluster.readdir-optimize: On
+            nfs.disable: On
+            network.remote-dio: On
+            diagnostics.client-log-level: WARNING
+            diagnostics.brick-log-level: WARNING