Grafana dashboard: HPE Storage Volumes
Description: List volumes in a pool or CPG for volume drill-down.

This dashboard enumerates volumes found in particular pool or CPG found in the datasource using a HPE Storage Array Exporter for Prometheus scrape target. 

# Requirements

- Scrape target label named "array" with the storage array name or designation.
- Requires the following drill-down dashboards to function properly:
  - [HPE Storage Arrays](https://grafana.com/grafana/dashboards/14836)
  - [HPE Storage Pools](https://grafana.com/grafana/dashboards/14907)
  - [HPE Storage Array Details](https://grafana.com/grafana/dashboards/14908)
  - [HPE Storage Volume Details](https://grafana.com/grafana/dashboards/14910)

The source metrics needs to be normalized with the following `metric_relabel_configs` for the scrape target.

```
metric_relabel_configs:
  - source_labels: [__name__]
    action: labelmap
    regex: "cpg|pool"
    replacement: "storagepool"
  - source_labels: [__name__]
    regex: "^hpe(primera|nimble|3par|alletra6000|alletra9000)_(.*)"
    target_label: "__name__"
    replacement: "hpe_$2"
  - source_labels: [__name__]
    regex: "^hpe_(pool|cpg)_(.*)"
    target_label: "__name__"
    replacement: "hpe_storagepool_$2"
```

# Resources

This dashboard utilize the officially supported exporter for HPE storage systems.
- [HPE Storage Array Exporter for Prometheus](https://hpe-storage.github.io/array-exporter/)

# Support

This dashboard is provided, as-is, as an example and it's not officially supported by HPE. Join us on Slack at [slack.hpedev.io](https://slack.hpedev.io) in the storage platform channels if you have questions or feedback.

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.1.2"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "List volumes in a pool or CPG for volume drill-down.",
  "editable": true,
  "gnetId": 14909,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1631672027355,
  "links": [
    {
      "asDropdown": false,
      "icon": "external link",
      "includeVars": false,
      "keepTime": true,
      "tags": [
        "HPE Storage Arrays"
      ],
      "targetBlank": false,
      "title": "HPE Storage Arrays",
      "tooltip": "",
      "type": "dashboards",
      "url": ""
    },
    {
      "asDropdown": false,
      "icon": "external link",
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "HPE Storage Pools"
      ],
      "targetBlank": false,
      "title": "HPE Storage Pools",
      "tooltip": "",
      "type": "dashboards",
      "url": ""
    }
  ],
  "panels": [
    {
      "datasource": null,
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "filterable": false
          },
          "links": [
            {
              "title": "Volume Details",
              "url": "d/LT7Nnk7nk?var-volume=${__data.fields.volume}&${array:queryparam}&${pool:queryparam}&${__url_time_range}"
            }
          ],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "transparent",
                "value": null
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 20,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "interval": null,
      "maxDataPoints": null,
      "options": {
        "showHeader": true
      },
      "pluginVersion": "8.1.2",
      "repeat": null,
      "targets": [
        {
          "exemplar": true,
          "expr": "hpe_volume_size_bytes{array=\"$array\", storagepool=\"$pool\"}",
          "format": "table",
          "hide": false,
          "interval": "",
          "legendFormat": "Size",
          "refId": "Size"
        }
      ],
      "title": "$array ($pool)",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "volume_name",
                "Value #Size",
                "volume"
              ]
            }
          }
        },
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "sortBy",
          "options": {
            "fields": {},
            "sort": [
              {
                "desc": false,
                "field": "volume_name"
              }
            ]
          }
        },
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "Value #Size": {
                "aggregations": [],
                "operation": "groupby"
              },
              "volume": {
                "aggregations": [],
                "operation": "groupby"
              },
              "volume_name": {
                "aggregations": [],
                "operation": "groupby"
              }
            }
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": "",
  "schemaVersion": 30,
  "style": "dark",
  "tags": [
    "HPE Storage Volumes"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(array)",
        "description": "Select array to visualize",
        "error": null,
        "hide": 2,
        "includeAll": false,
        "label": "Array",
        "multi": false,
        "name": "array",
        "options": [],
        "query": {
          "query": "label_values(array)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "",
          "value": ""
        },
        "description": "Select pools",
        "error": null,
        "hide": 2,
        "label": "Pool",
        "name": "pool",
        "options": [
          {
            "selected": false,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "skipUrlSync": false,
        "type": "textbox"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "HPE Storage Volumes",
  "uid": "OcsMRkn7z",
  "version": 57
}