To maintain database availability and avoid instance downtime caused by storage exhaustion, you can use the AlloyDB for PostgreSQL cluster storage quota recommender, which identifies production clusters that are at risk of reaching their storage quota.
The AlloyDB cluster storage quota recommender analyzes storage-related metrics and calculates the latest storage quota utilization for each cluster. When utilization exceeds a threshold, the recommender generates a recommendation to increase the cluster storage quota. Recommendations are generated daily.
Before you begin
Before you can view recommendations and insights, do the following:
Ensure that you enable the Recommender API.
To get the permissions to view and work with insights and recommendations, ensure that you have the required Identity and Access Management (IAM) roles.
Tasks Roles View recommendations roles/recommender.alloydbViewerorroles/alloydb.viewer.Apply recommendations roles/recommender.alloydbAdminorroles/alloydb.admin.See Grant access to other users for more information.
List the recommendations
You can list the cluster storage quota recommendations using the Google Cloud console, gcloud CLI, or the Recommender API.
Console
In the Google Cloud console, go to the Clusters page.
For more information, see Find recommendations with Active Assist.
In the Resources list table, find the cluster and click View issues in the Issues column.
A list of issues is displayed in the Aggregated issues panel. Select the Nearing storage quota recommendation card.
gcloud CLI
To list the cluster storage quota recommendations using gcloud CLI, run the gcloud recommender recommendations list command as follows:
gcloud recommender recommendations list \ --project=PROJECT_ID \ --location=LOCATION \ --recommender=google.alloydb.cluster.ReliabilityRecommender \ --filter=recommenderSubtype=INCREASE_CLUSTER_STORAGE_QUOTA
Replace the following:
PROJECT_ID: your project ID.LOCATION: a region where your clusters are located, such asus-central1.
API
To list cluster storage quota recommendations using the Recommender API, call the
recommendations.list
method as follows:
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.alloydb.cluster.ReliabilityRecommender/recommendations?filter=recommenderSubtype=INCREASE_CLUSTER_STORAGE_QUOTA
Replace the following:
PROJECT_ID: your project ID.LOCATION: a region where your clusters are located, such asus-central1.
View insights and detailed recommendations
You can view insights and detailed recommendations about clusters that require increasing cluster storage quota using the Google Cloud console, gcloud CLI, or the Recommender API.
To view insights and detailed recommendations, follow these steps:
Console
On the Clusters page, under the Resources table, click View issues in the Issues column for the cluster.
The Aggregated issues panel appears on the right, which contains insights and detailed recommendations for Nearing storage quota.
gcloud CLI
Run the gcloud recommender insights list command as follows:
gcloud recommender insights list \ --project=PROJECT_ID \ --location=LOCATION \ --insight-type=google.alloydb.cluster.ReliabilityInsight \ --filter=insightSubtype=HIGH_STORAGE_UTILIZATION
Replace the following:
PROJECT_ID: your project ID.LOCATION: a region where your clusters are located, for example,us-central1.
API
Call the insights.list method as follows:
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.alloydb.cluster.ReliabilityInsight/insights?filter=insightSubtype=HIGH_STORAGE_UTILIZATION
Replace the following:
PROJECT_ID: your project ID.LOCATION: a region where your clusters are located, for example,us-central1.
Apply the recommendation
Evaluate the recommendation carefully and do the following:
Console
To implement the recommendation, do the following:
- Click Edit Quota for your cluster. This automatically displays the IAM & Admin > Quotas & System Limits window.
- Select the entry for your cluster, and click Edit Quotas.
- In the Edit quota window, input the appropriate quota value as per the recommendation.
- Fill in the required details in the Request description field and click Done.
- Click Submit Request.