Grafana dashboard: vSphere - Datastore utilization
Description: Dashboard for Datastore metrics in a VMware vSphere environments

This dashboard gives an overview of the utilization on VMware vSphere datastores. Data is pulled from vCenter with the vSphere plugin of the Telegraf agent. The data is stored in an InfluxDB timeseries database.

The dashboard shows the current free space in percentage for all datastores, and a trend of the utilization for a configurable time range.

*Note that the variable query for InfluxDB can return stale tags if retention is not set up on your database. See [this post](https://rudimartinsen.com/2020/08/07/vsphere-performance-telegraf-influxdb-and-grafana7-part5-dashboard-variables/#influx-tags-variable) for more information*

See also my other dashboards:
- [vSphere - Overview (id 12786)](https://grafana.com/grafana/dashboards/12786)
- [vSphere - Host details (id 12852)](https://grafana.com/grafana/dashboards/12852)
- [vSphere - VM details (id 12874)](https://grafana.com/grafana/dashboards/12874)


{
  "__inputs": [
    {
      "name": "DS_TELEGRAF-VSPHERE",
      "label": "Telegraf-vsphere",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "bargauge",
      "name": "Bar gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.0.5"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Dashboard for Datastore metrics in a VMware vSphere environments",
  "editable": true,
  "gnetId": 12879,
  "graphTooltip": 1,
  "id": null,
  "iteration": 1598168301754,
  "links": [
    {
      "icon": "external link",
      "keepTime": true,
      "tags": [
        "telegraf",
        "vsphere"
      ],
      "targetBlank": true,
      "type": "dashboards"
    }
  ],
  "panels": [
    {
      "datasource": "${DS_TELEGRAF-VSPHERE}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 16,
      "title": "Free space",
      "type": "row"
    },
    {
      "datasource": "${DS_TELEGRAF-VSPHERE}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 70
              },
              {
                "color": "red",
                "value": 85
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 8,
        "x": 0,
        "y": 1
      },
      "id": 6,
      "interval": "$time",
      "options": {
        "displayMode": "lcd",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true
      },
      "pluginVersion": "7.0.5",
      "repeat": "ds",
      "repeatDirection": "h",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "vsphere_datastore_disk",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT ((mean(\"used_latest\")*100)/mean(\"capacity_latest\")) FROM \"vsphere_datastore_disk\" WHERE (\"dsname\" =~ /^$ds$/) AND $timeFilter GROUP BY time($__interval) fill(null)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "capacity_latest"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [
            {
              "key": "dsname",
              "operator": "=~",
              "value": "/^$ds$/"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "$ds",
      "transformations": [],
      "type": "bargauge"
    },
    {
      "collapsed": true,
      "datasource": "${DS_TELEGRAF-VSPHERE}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 7
      },
      "id": 22,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_TELEGRAF-VSPHERE}",
          "description": "",
          "fieldConfig": {
            "defaults": {
              "custom": {}
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 7,
            "w": 24,
            "x": 0,
            "y": 20
          },
          "hiddenSeries": false,
          "hideTimeOverride": false,
          "id": 10,
          "interval": "1h",
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "repeat": null,
          "repeatDirection": "v",
          "scopedVars": {
            "ds": {
              "selected": false,
              "text": "sw",
              "value": "sw"
            }
          },
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "$col",
              "groupBy": [
                {
                  "params": [
                    "$__interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "dsname"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "vsphere_datastore_disk",
              "orderByTime": "ASC",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "capacity_latest"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  },
                  {
                    "params": [
                      "capacity"
                    ],
                    "type": "alias"
                  }
                ],
                [
                  {
                    "params": [
                      "provisioned_latest"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  },
                  {
                    "params": [
                      "provisioned"
                    ],
                    "type": "alias"
                  }
                ],
                [
                  {
                    "params": [
                      "used_latest"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  },
                  {
                    "params": [
                      "used"
                    ],
                    "type": "alias"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "dsname",
                  "operator": "=~",
                  "value": "/^$ds$/"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": "$weeks",
          "timeRegions": [],
          "timeShift": null,
          "title": "$ds",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "kbytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        }
      ],
      "repeat": "ds",
      "title": "$ds - Utilization trend - Last $weeks",
      "type": "row"
    }
  ],
  "refresh": "30s",
  "schemaVersion": 25,
  "style": "dark",
  "tags": [
    "telegraf",
    "vsphere",
    "demo"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TELEGRAF-VSPHERE}",
        "definition": "show tag values with key = \"vcenter\"",
        "hide": 0,
        "includeAll": true,
        "label": "vCenter",
        "multi": true,
        "name": "vc",
        "options": [],
        "query": "show tag values with key = \"vcenter\"",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TELEGRAF-VSPHERE}",
        "definition": "show tag values with key = \"clustername\" where \"vcenter\" =~/$vc/",
        "hide": 0,
        "includeAll": true,
        "label": "Cluster",
        "multi": true,
        "name": "cluster",
        "options": [],
        "query": "show tag values with key = \"clustername\" where \"vcenter\" =~/$vc/",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TELEGRAF-VSPHERE}",
        "definition": "show tag values with key = \"esxhostname\" where \"clustername\" =~/$cluster/ and \"vcenter\" =~/$vc/",
        "hide": 0,
        "includeAll": true,
        "label": "ESXi",
        "multi": true,
        "name": "host",
        "options": [],
        "query": "show tag values with key = \"esxhostname\" where \"clustername\" =~/$cluster/ and \"vcenter\" =~/$vc/",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TELEGRAF-VSPHERE}",
        "definition": "show tag values with key = \"dsname\" where \"dsname\" != 'instance-total'",
        "hide": 0,
        "includeAll": true,
        "label": "Datastore",
        "multi": true,
        "name": "ds",
        "options": [],
        "query": "show tag values with key = \"dsname\" where \"dsname\" != 'instance-total'",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "auto": true,
        "auto_count": "20",
        "auto_min": "20s",
        "current": {
          "selected": false,
          "text": "auto",
          "value": "$__auto_interval_time"
        },
        "hide": 2,
        "label": "Time",
        "name": "time",
        "options": [
          {
            "selected": true,
            "text": "auto",
            "value": "$__auto_interval_time"
          },
          {
            "selected": false,
            "text": "30m",
            "value": "30m"
          },
          {
            "selected": false,
            "text": "1h",
            "value": "1h"
          },
          {
            "selected": false,
            "text": "12h",
            "value": "12h"
          },
          {
            "selected": false,
            "text": "24h",
            "value": "24h"
          },
          {
            "selected": false,
            "text": "1w",
            "value": "1w"
          },
          {
            "selected": false,
            "text": "30d",
            "value": "30d"
          }
        ],
        "query": "30m,1h,12h,24h,1w,30d",
        "queryValue": "",
        "refresh": 2,
        "skipUrlSync": false,
        "type": "interval"
      },
      {
        "auto": false,
        "auto_count": 30,
        "auto_min": "10s",
        "current": {
          "selected": false,
          "text": "1w",
          "value": "1w"
        },
        "hide": 0,
        "label": "Weeks",
        "name": "weeks",
        "options": [
          {
            "selected": true,
            "text": "1w",
            "value": "1w"
          },
          {
            "selected": false,
            "text": "2w",
            "value": "2w"
          },
          {
            "selected": false,
            "text": "3w",
            "value": "3w"
          },
          {
            "selected": false,
            "text": "4w",
            "value": "4w"
          },
          {
            "selected": false,
            "text": "6w",
            "value": "6w"
          },
          {
            "selected": false,
            "text": "8w",
            "value": "8w"
          },
          {
            "selected": false,
            "text": "12w",
            "value": "12w"
          },
          {
            "selected": false,
            "text": "24w",
            "value": "24w"
          },
          {
            "selected": false,
            "text": "52w",
            "value": "52w"
          }
        ],
        "query": "1w,2w,3w,4w,6w,8w,12w,24w,52w",
        "queryValue": "",
        "refresh": 2,
        "skipUrlSync": false,
        "type": "interval"
      }
    ]
  },
  "time": {
    "from": "now-3h",
    "to": "now"
  },
  "timepicker": {
    "nowDelay": "",
    "refresh_intervals": [
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "browser",
  "title": "vSphere - Datastore utilization",
  "uid": "cq0S9oNGz",
  "version": 2
}