L'recommender pour manque d'espace disque de Cloud SQL génère de manière proactive des recommandations qui vous aident à réduire le risque d'indisponibilité imputable à des instances manquant d'espace disque.
Vous pouvez appliquer ces recommandations lorsqu'une instance Cloud SQL s'approche d'une limite de stockage. Cette page décrit le fonctionnement de cet outil de recommandation et son utilisation.
Fonctionnement
L'outil de recommandation pour manque d'espace disque de Cloud SQL analyse la tendance de l'utilisation du stockage au cours des 30 derniers jours. Lorsqu'une instance s'approche d'une limite où elle risque de manquer d'espace dans un délai de un à 30 jours, l'outil de recommandation génère des recommandations associées suggérant d'augmenter manuellement la capacité de stockage, de configurer la capacité de stockage pour qu'elle augmente automatiquement, ou de libérer de l'espace de stockage.
Répertorier les recommandations pour manque d'espace disque
Vous pouvez répertorier les recommandations d'instances à court d'espace disque à l'aide de la console Google Cloud, de gcloud ou de l'API Recommender.
Les recommandations pour manque d'espace disque ne s'affichent que si vos instances s'approchent de leur capacité maximale de disque.
Console
Pour répertorier les recommandations à court d'espace disque à l'aide de la console Google Cloud, procédez comme suit :
Dans la fiche Éviter les temps d'arrêt pour les instances SQL, cliquez sur Tout afficher.
gcloud
Pour répertorier les recommandations pour manque d'espace disque à l'aide de gcloud, exécutez la commande gcloud recommender recommendations list comme suit :
gcloud recommender recommendations list \
--project=PROJECT_ID \
--location=LOCATION \
--recommender=google.cloudsql.instance.RECOMMENDER
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : une région, telle que us-central1
RECOMMENDER : ID de l'outil de recommandation en tant que OutOfDiskRecommender.
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/recommenders/google.cloudsql.instance.RECOMMENDER/recommendations
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : une région, telle que us-central1
RECOMMENDER : ID de l'outil de recommandation en tant que OutOfDiskRecommender.
Afficher les insights et les recommandations détaillées
Vous pouvez afficher les insights et les recommandations détaillées concernant les instances pratiquement à court d'espace disque à l'aide de la console Google Cloud, de gcloud ou de l'API Recommender.
Console
Pour afficher des insights et des recommandations détaillées concernant les instances pratiquement à court d'espace disque à l'aide de la console Google Cloud, cliquez sur le bouton de recommandation dans la liste des instances.
gcloud
Pour afficher les insights et les recommandations détaillées concernant les instances pratiquement à court d'espace disque à l'aide de gcloud, exécutez la commande gcloud recommender insights list comme suit :
gcloud recommender insights list \
--project=PROJECT_ID \
--location=LOCATION \
--insight-type=google.cloudsql.instance.INSIGHT_TYPE
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : une région, telle que us-central1
INSIGHT_TYPE : ID du type d'insight ; par exemple, DiskUsageTrendInsight
API
Pour afficher les insights et les recommandations détaillées concernant les instances pratiquement à court d'espace disque à l'aide de l'API Recommendations, appelez la méthode insights.list comme suit :
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/insightTypes/google.cloudsql.instance.INSIGHT_TYPE/insights
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : une région, telle que us-central1
INSIGHT_TYPE : ID du type d'insight ; par exemple, DiskUsageTrendInsight
Le tableau suivant répertorie les insights et les recommandations générés par l'outil de recommandation pour manque d'espace disque de Cloud SQL. Les sous-types sont visibles dans les résultats de gcloud et de l'API.
Insight
Recommandation
Selon la tendance actuelle d'utilisation de l'espace de stockage, l'instance est susceptible de manquer d'espace disque, ce qui peut entraîner un temps d'arrêt. Sous-type : TRENDING_OUT_OF_DISK.
Activez l'augmentation automatique, augmentez manuellement la capacité de stockage ou libérez de l'espace disque. Sous-type : ENABLE_AUTO_STORAGE_INCREASE.
Appliquer les recommandations
Étudiez attentivement les recommandations et effectuez l'une des opérations suivantes :
Pour examiner la recommandation, cliquez sur Afficher l'instance.
Une bannière comportant une recommandation s'affiche en haut de la page.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Monitor disk availability\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/using-ood-recommender \"View this page for the MySQL database engine\") \\| PostgreSQL \\| [SQL Server](/sql/docs/sqlserver/using-ood-recommender \"View this page for the SQL Server database engine\")\n\n\u003cbr /\u003e\n\nThe Cloud SQL out-of-disk [recommender](/recommender/docs/overview) proactively\ngenerates recommendations that help you reduce the risk\nof downtime that might be caused by your instances running out of disk space.\nYou can apply these recommendations when a Cloud SQL instance is trending\ntoward a storage limit. This page describes how this recommender works and how\nto use it.\n\nHow it works\n------------\n\nThe Cloud SQL out-of-disk recommender analyzes the storage utilization trend\nover the last 30 days. When an instance is trending toward a limit\nwhere it's likely to run out of space within the next 1 to 30 days, the recommender\ngenerates related recommendations to manually increase the storage capacity, set\nthe storage capacity to automatically increase, or free up space.\n\nPricing\n-------\n\nThe Cloud SQL out-of-disk recommender is included in the [Standard Google Cloud support package](/recommender/pricing).\n\nBefore you begin\n----------------\n\nBefore you can view recommendations and insights, do the following:\n\n- To get the permissions to view and work with insights and recommendations, ensure that you have the required [roles](/sql/docs/postgres/project-access-control#roles).\n\n For more information about roles, see [understanding roles](/iam/docs/understanding-roles) and [granting IAM permissions](/iam/docs/granting-changing-revoking-access).\n-\n\n\n Enable the Recommender API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=recommender.googleapis.com)\n\nList out-of-disk recommendations\n--------------------------------\n\nYou can list out-of-disk instance recommendations by\nusing the Google Cloud console, `gcloud`, or the Recommender API.\n\nOut-of-disk recommendations are shown only if you have instances that\nare nearing disk capacity. \n\n### Console\n\nTo list out-of-disk recommendations by using the Google Cloud console, follow these steps:\n\n1. Go to the **Cloud SQL Instances** page.\n\n [Go to Cloud SQL Instances](https://console.cloud.google.com/sql/instances)\n2. Click **View all** on the out-of-disk recommendations banner.\n\nAlternatively, follow these steps:\n\n1. Go to the **Recommendation Hub** . See also [Getting started with Recommendation Hub](/recommender/docs/recommendation-hub/identify-configuration-problems).\n\n [Go to the Recommendation Hub](https://console.cloud.google.com/home/recommendations/)\n2. In the **Prevent Downtime for SQL instances** card, click **View all**.\n\n### gcloud\n\nTo list out-of-disk recommendations by using `gcloud`, run the\n[`gcloud recommender recommendations list`](/sdk/gcloud/reference/recommender/recommendations/list)\ncommand as follows: \n\n```\ngcloud recommender recommendations list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--recommender=google.cloudsql.instance.RECOMMENDER\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region, such as `us-central1`\n- \u003cvar translate=\"no\"\u003eRECOMMENDER\u003c/var\u003e: The ID of the recommender as `OutOfDiskRecommender`.\n\n### API\n\nTo list out-of-disk recommendations by using the\n[Recommendations API](/recommender/docs/using-api), call the\n[`recommendations.list`](/recommender/docs/reference/rest/v1beta1/projects.locations.recommenders.recommendations/list)\nmethod as follows: \n\n```\nGET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/recommenders/google.cloudsql.instance.RECOMMENDER/recommendations\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region, such as `us-central1`.\n- \u003cvar translate=\"no\"\u003eRECOMMENDER\u003c/var\u003e: The ID of the recommender as `OutOfDiskRecommender`.\n\nView insights and detailed recommendations\n------------------------------------------\n\nYou can view insights and detailed recommendations about instances\nthat are nearly out of disk space by using the Google Cloud console,\n`gcloud`, or the Recommender API. \n\n### Console\n\nTo view insights and detailed recommendations about instances that are nearly\nout of disk space by using the Google Cloud console, click the recommendation\nbutton in the list of instances.\n\n### gcloud\n\nTo view insights and detailed recommendations about instances that are nearly\nout of disk space by using `gcloud`, run the\n[`gcloud recommender insights list`](/sdk/gcloud/reference/recommender/insights/list)\ncommand as follows: \n\n```\ngcloud recommender insights list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--insight-type=google.cloudsql.instance.INSIGHT_TYPE\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region, such as `us-central1`.\n- \u003cvar translate=\"no\"\u003eINSIGHT_TYPE\u003c/var\u003e: The ID of the insight type as `DiskUsageTrendInsight`.\n\n### API\n\nTo view insights and detailed recommendations about instances that are nearly\nout of disk space by using the [Recommendations API](/recommender/docs/using-api),\ncall the [`insights.list`](/recommender/docs/reference/rest/v1beta1/projects.locations.insightTypes.insights/list)\nmethod as follows: \n\n```\nGET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/insightTypes/google.cloudsql.instance.INSIGHT_TYPE/insights\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region, such as `us-central1`.\n- \u003cvar translate=\"no\"\u003eINSIGHT_TYPE\u003c/var\u003e: The ID of the insight type as `DiskUsageTrendInsight`.\n\nThe following table lists the insight and recommendation that the Cloud SQL\nout-of-disk recommender generates. The subtypes are visible in the `gcloud` and\nAPI results.\n\nApply recommendations\n---------------------\n\nEvaluate the recommendations carefully and do any of the following:\n\n- To examine the recommendation, click **View instance**.\n\n A banner appears at the top of the page providing a recommendation.\n\n [Edit](/sql/docs/postgres/edit-instance) the instance, if required, to [manually increase](/sql/docs/postgres/instance-settings#storage-capacity-2ndgen) the storage capacity and set the storage\n capacity to [automatically increase](/sql/docs/postgres/instance-settings#storage-capacity-2ndgen).\n Alternatively, delete data to free up space.\n- To dismiss the recommendation so that it's de-emphasized and appears dimmed,\n click **Dismiss**.\n\n- To close the panel without applying or dismissing the recommendation, click\n **Cancel**.\n\nWhat's next\n-----------\n\n- [Reduce idle Cloud SQL instances](/sql/docs/postgres/recommender-sql-idle)\n- [Reduce overprovisioned Cloud SQL instances](/sql/docs/postgres/recommender-sql-overprovisioned)\n- [Blog: Maximize your Cloud ROI](https://cloud.google.com/blog/products/management-tools/active-assist-comes-to-google-cloud)\n- [Blog: Do more with less](https://cloud.google.com/blog/products/databases/reduce-cloud-sql-costs-with-optimizations-by-active-assist)\n- [Google Cloud recommenders](/recommender/docs/recommenders)"]]