# How-To Get Consolidated Data for Cores and RAM Used Across All Tenants

## Problem

Capture consolidated data for resource utilization for all tenants in a region.

## Environment

* Platform9 Managed OpenStack - All Versions

## Procedure

1. The following script can be used to get the consolidated data for the cores and RAM used across all tenants in a region.

**Note**: You will need **jq** package installed on the system from which you will be running this script.

{% tabs %}
{% tab title="None" %}

```none
#!/bin/bashexport ram_allocated=0export cores_allocated=0export TOKEN=$(openstack token issue -c id -f value)for ram in $(curl -s -k -H 'content-type: application/json' -H "X-Auth-Token: $TOKEN" https://[management plane url]/nova/v2.1/[tenant-id]/os-quota-sets/pf9_all_tenants | jq ' .[] | values[] .detail .quota_set .ram .in_use') do ram_allocated=$((ram_allocated+ram)) donefor cores in $(curl -s -k -H 'content-type: application/json' -H "X-Auth-Token: $TOKEN" https://[management plane url]/nova/v2.1/[tenant-id]/os-quota-sets/pf9_all_tenants | jq ' .[] | values[] .detail .quota_set .cores .in_use') do cores_allocated=$((cores_allocated+cores)) done echo "total cores allocated=$cores_allocated" echo "total ram allocated=$ram_allocated"
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://platform9.com/kb/pmo/how-to/how-to-get-consolidated-data-for-cores-and-ram-used-across-all.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
