Implement different ways to calculate hypervisor disk total

Depends on ceph enabled or not we have different ways to calculate
total hypervisor disk stats.

Change-Id: Ib46f55ec1d91fab43e05ee53ab0bcb177dc64d2c
Related-PROD: ROD-21006
diff --git a/nova/files/grafana_dashboards/nova_utilization_prometheus.json b/nova/files/grafana_dashboards/nova_utilization_prometheus.json
index 1ecd6bd..957dc6f 100644
--- a/nova/files/grafana_dashboards/nova_utilization_prometheus.json
+++ b/nova/files/grafana_dashboards/nova_utilization_prometheus.json
@@ -632,7 +632,13 @@
       "tableColumn": "",
       "targets": [
         {
+          {%- endraw %}
+          {%- if parameters is defined and parameters.get('nova_compute_ceph_ephemeral', False) == True %}
+          "expr": "max(avg(openstack_nova_used_disk) by (instance)) / max(avg(openstack_nova_disk) by (instance))",
+          {%- else %}
           "expr": "max(sum(openstack_nova_used_disk) by (instance)) / max(sum(openstack_nova_disk) by (instance))",
+          {%- endif %}
+          {%- raw %}
           "format": "time_series",
           "intervalFactor": 2,
           "refId": "A"
@@ -691,7 +697,13 @@
       "targets": [
         {
           "$$hashKey": "object:33000",
+          {%- endraw %}
+          {%- if parameters is defined and parameters.get('nova_compute_ceph_ephemeral', False) == True %}
+          "expr": "max(avg(openstack_nova_disk) by (instance))",
+          {%- else %}
           "expr": "max(sum(openstack_nova_disk) by (instance))",
+          {%- endif %}
+          {%- raw %}
           "format": "time_series",
           "intervalFactor": 2,
           "legendFormat": "total",
@@ -699,7 +711,13 @@
         },
         {
           "$$hashKey": "object:33001",
+          {%- endraw %}
+          {%- if parameters is defined and parameters.get('nova_compute_ceph_ephemeral', False) == True %}
+          "expr": "max(avg(openstack_nova_used_disk) by (instance))",
+          {%- else %}
           "expr": "max(sum(openstack_nova_used_disk) by (instance))",
+          {%- endif %}
+          {%- raw %}
           "format": "time_series",
           "intervalFactor": 2,
           "legendFormat": "used",
@@ -707,7 +725,13 @@
         },
         {
           "$$hashKey": "object:33002",
+          {%- endraw %}
+          {%- if parameters is defined and parameters.get('nova_compute_ceph_ephemeral', False) == True %}
+          "expr": "max(avg(openstack_nova_used_disk) by (instance))",
+          {%- else %}
           "expr": "max(sum(openstack_nova_disk - openstack_nova_disk_available) by (instance))",
+          {%- endif %}
+          {%- raw %}
           "format": "time_series",
           "intervalFactor": 2,
           "legendFormat": "allocated",
@@ -817,7 +841,13 @@
       "targets": [
         {
           "$$hashKey": "object:33092",
+          {%- endraw %}
+          {%- if parameters is defined and parameters.get('nova_compute_ceph_ephemeral', False) == True %}
+          "expr": "max(avg(openstack_nova_used_disk) by (instance)) / max(avg(openstack_nova_disk) by (instance))",
+          {%- else %}
           "expr": "max(sum(openstack_nova_disk - openstack_nova_disk_available) by (instance)) / max(sum(openstack_nova_disk) by (instance))",
+          {%- endif %}
+          {%- raw %}
           "format": "time_series",
           "intervalFactor": 2,
           "refId": "A"
diff --git a/nova/files/grafana_dashboards/openstack_overview_prometheus.json b/nova/files/grafana_dashboards/openstack_overview_prometheus.json
index 8fa1718..ccaae42 100644
--- a/nova/files/grafana_dashboards/openstack_overview_prometheus.json
+++ b/nova/files/grafana_dashboards/openstack_overview_prometheus.json
@@ -257,7 +257,13 @@
       "tableColumn": "",
       "targets": [
         {
+          {%- endraw %}
+          {%- if parameters is defined and parameters.get('nova_compute_ceph_ephemeral', False) == True %}
+          "expr": "max(avg(openstack_nova_used_disk) by (instance)) / max(avg(openstack_nova_disk) by (instance))",
+          {%- else %}
           "expr": "max(sum(openstack_nova_used_disk) by (instance)) / max(sum(openstack_nova_disk) by (instance))",
+          {%- endif %}
+          {%- raw %}
           "format": "time_series",
           "intervalFactor": 2,
           "refId": "A"