Prevent data loss for your instance by increasing backup retention

This page describes the AlloyDB increase backup retention recommender which helps you detect instances that need longer backup retention periods.

The AlloyDB increase backup retention recommender analyzes instance metadata. If the instance is a production instance with automated backups enabled and has less than 14 retained backups, it is recommended to increase its backup retention.

Recommendations are generated daily.

Pricing

The AlloyDB increase backup retention recommender is available free of cost to all Google Cloud customers. For more information, see Recommender pricing.

Before you begin

Before you can view recommendations and insights, you must 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 One of these roles: recommender.alloydbViewer or alloydb.viewer.
    Apply recommendations One of these roles: recommender.alloydbAdmin or alloydb.admin.

See Grant access to other users for more information.

List reliability recommendations for increasing backup retention

You can list the increase backup retention recommendations using the Google Cloud console, gcloud CLI, or the Recommender API.

Console

To list increase backup retention recommendations using the Google Cloud console, follow these steps:

  1. In the Google Cloud console, go to the Clusters page.

    Go to Clusters

    For more information, see Getting started with Recommendation Hub.

  2. In the Data protection card, click Show affected resources.

  3. Select instances with the Short backup retention recommendation.

gcloud CLI

To list increase backup retention 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_BACKUP_RETENTION

Replace the following:

  • PROJECT_ID: your project ID.
  • LOCATION: a region where your instances are located, such as us-central1.

API

To list increase backup retention recommendations using the Recommendations 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_BACKUP_RETENTION

Replace the following:

  • PROJECT_ID: your project ID.
  • LOCATION: a region where your instances are located, such as us-central1.

View insights and detailed recommendations

You can view insights and detailed recommendations about instances that require increasing their backup retention using the Google Cloud console, Google Cloud CLI, or the Recommender API.

Console

To view insights and detailed recommendations about instances that require increasing their backup retention, click the recommendation link in the list of instances.

gcloud CLI

To view insights and detailed recommendations about instances that require increasing their backup retention, 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=CLUSTER_INSUFFICIENT_BACKUP_RETENTION

Replace the following:

  • PROJECT_ID: your project ID.
  • LOCATION: a region where your instances are located, such as us-central1.

API

To view insights and detailed recommendations about instances that require increasing their backup retention, use the Recommendations 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=CLUSTER_INSUFFICIENT_BACKUP_RETENTION

Replace the following:

  • PROJECT_ID: your project ID.
  • LOCATION: a region where your instances are located, such as us-central1.

Apply recommendation

To increase backup retention, do the following:

  1. Click Short backup retention in the Issues column. A Short backup retention window displays providing a recommendation.
  2. Click View backup policy.
  3. In the Data protection window, depending on the recommended backup policy, do one of the following:

    • To increase the number of days covered, click Edit in the Continuous backups and recovery field.
    • To increase backup frequency, follow instructions in Enable and configure automated backups.

    For more information, see Backup retention and deletion.

What's next