Renew commitments automatically

If you have workloads with predictable resource requirements, you can lower your costs by purchasing a committed use discount. You purchase a committed use discount by creating a commitment.

By default, commitments don't automatically renew. If you want a commitment to automatically renew, you must manually enable the auto-renew setting on each commitment.

For new commitments, you must specify a length of 1 year or 3 years, and you can optionally specify whether the commitment renews automatically. If you specify for the commitment to auto-renew, the length of the renewed commitment is the same length as the original commitment. If you create a non-renewing commitment, you can change it to an automatically renewing commitment as long as the commitment is active and not expired.

By activating auto-renew, you agree to have your committed use discount automatically renew on the end date unless you cancel auto-renew, which you can do anytime up to the renewal date at 12PM PST.

This document shows you how to:

  • Create commitments that renew automatically.
  • Create commitments that do not renew automatically.
  • Enable automatic renewal on existing commitments.
  • Disable automatic renewal on existing commitments.

Quota

You do not need to request additional quota because renewed commitments use the same quota as the original commitment. For more information about quota for commitments, see Requesting quota for commitments.

Create a commitment that renews automatically

Create a commitment that renews automatically by using the gcloud tool or the Compute Engine API.

Permissions required for this task

To perform this task, you must have the following permissions:

  • compute.commitments.create on the project

gcloud

Create a commitment that renews automatically by using the gcloud alpha commitments create command.

For example, the following gcloud tool command creates a 3-year commitment that renews automatically.

gcloud alpha compute commitments create COMMITMENT --auto-renew \
    --plan=36-month \
    --region=us-west1 \
    --resources=vcpu=4,memory=9

Replace COMMITMENT with the name of the commitment.

API

Create a commitment that renews automatically by using the regionCommitments.insert method.

For example, the following Compute Engine API request creates a 3-year commitment that renews automatically.

POST https://compute.googleapis.com/compute/alpha/projects/PROJECT/regions/us-west1/commitments

{
  "name": "COMMITMENT",
  "plan": "THIRTY_SIX_MONTH",
  "resources": [
    {
      "type": "VCPU",
      "amount": 4
    },
    {
      "type": "MEMORY",
      "amount": 9
    }
  ],
  "autoRenew": true
}

Replace the following:

  • PROJECT: the name of the project to create the commitment for
  • COMMITMENT: the name of the new commitment

Create a commitment that does not renew automatically

Create a commitment that does not renew automatically by using the gcloud tool or the Compute Engine API.

Permissions required for this task

To perform this task, you must have the following permissions:

  • compute.commitments.create on the project or organization

gcloud

Create a commitment that does not renew automatically by using the gcloud alpha commitments create command.

For example, the following gcloud tool command creates a new 3-year commitment that does not renew automatically.

gcloud alpha compute commitments create COMMITMENT \
    --plan=36-month \
    --region=us-west1 \
    --resources=vcpu=4,memory=9

Replace COMMITMENT with the name of the commitment.

API

Create a commitment that does not renew automatically by using the regionCommitments.insert method.

For example, the following Compute Engine API request creates a new 3-year commitment that does not renew automatically.

POST https://compute.googleapis.com/compute/alpha/projects/PROJECT/regions/us-west1/commitments

{
  "name": "COMMITMENT",
  "plan": "THIRTY_SIX_MONTH",
  "resources": [
    {
      "type": "VCPU",
      "amount": 4
    },
    {
      "type": "MEMORY",
      "amount": 9
    }
  ],
}

Replace the following:

  • PROJECT: the name of the project to create the commitment for
  • COMMITMENT: the name of the new commitment

Enable auto-renew on an existing commitment

Enable auto-renew on an existing commitment by using the Cloud Console, gcloud tool, or the Compute Engine API.

Permissions required for this task

To perform this task, you must have the following permissions:

  • compute.commitments.update on the project or organization

Console

  1. In the Cloud Console, go to the Committed use discounts page.

    Go to Committed use discounts

  2. In the Commitment list, under Hardware commitments, click the Name of the commitment.

  3. On the Hardware commitment details page, click the Auto-renew toggle.

gcloud

Enable auto-renew on an existing commitment by using the gcloud alpha commitments update command.

gcloud alpha compute commitments update COMMITMENT --auto-renew

Replace COMMITMENT with the name of the commitment.

API

Enable auto-renew on an existing commitment by using the regionCommitments.update method.

For example, the following Compute Engine API request enables auto-renew on a commitment in the us-west1 region.

PATCH https://compute.googleapis.com/compute/alpha/projects/PROJECT/regions/us-west1/commitments

{
  "name": "COMMITMENT",
  "autoRenew": true
}

Replace the following:

  • PROJECT: the name of the project with the commitment to update
  • COMMITMENT: the name of the commitment to update

Disable auto-renew on an existing commitment

Disable auto-renew on an existing commitment by using the Cloud Console, gcloud tool, or the Compute Engine API.

Permissions required for this task

To perform this task, you must have the following permissions:

  • compute.commitments.update on the project or organization

Console

  1. In the Cloud Console, go to the Committed use discounts page.

    Go to Committed use discounts

  2. In the Commitment list, under Hardware commitments, click the Name of the commitment.

  3. On the Hardware commitment details page, click the Auto-renew toggle.

gcloud

Disable auto-renew on an existing commitment by using the gcloud alpha commitments update command.

gcloud alpha compute commitments update COMMITMENT --no-auto-renew

Replace COMMITMENT with the name of the commitment.

API

Disable auto-renew on an existing commitment by using the regionCommitments.update method.

For example, the following Compute Engine API request disables auto-renew on a commitment in the us-west1 region.

PATCH https://compute.googleapis.com/compute/alpha/projects/PROJECT/regions/us-west1/commitments

{
  "name": "COMMITMENT",
  "autoRenew": false
}

Replace the following:

  • PROJECT: the name of the project with the commitment to update
  • COMMITMENT: the name of the commitment to update

What's next