Resource-based committed use discounts

Stay organized with collections Save and categorize content based on your preferences.

Compute Engine lets you purchase and renew resource-based committed use contracts or commitments in return for heavily discounted prices for VM usage.

This document describes information about Compute Engine's resource-based commitments, how to purchase them and the resulting committed use discounts (CUDs). To learn about Compute Engine flexible CUDs, see Flexible CUDs.

Resource-based commitments are ideal for predictable and steady state usage. Compute Engine lets you purchase the following categories of resource-based commitments:

Commitments for hardware resources are separate from commitments for licenses. You can purchase both categories of commitments for a VM instance, but you cannot purchase a single commitment that covers both hardware resources and licenses.

When you purchase a committed use contract, you purchase Compute Engine resources—such as vCPUs, memory, GPUs, local SSDs, and sole-tenant nodes—at a discounted price in return for committing to paying for those resources for 1 year or 3 years. The discount is up to 57% for most resources like machine types or GPUs. The discount is up to 70% for memory-optimized machine types. For committed use prices for different machine types, see VM instances pricing.

Committed use discount recommendations give you opportunities to optimize your compute costs by analyzing your VM spending trends with and without a committed use discount contract. By comparing these numbers, you can see how much you can save each month with a committed use contract. To learn more about how commitment recommendations work, you can also review Understanding commitment recommendations.

You can purchase a committed use contract for a single project, or purchase multiple contracts which you can share across many projects by enabling shared discounts.

After purchasing, you are billed monthly for the resources you purchased for the duration of the term you selected, whether or not you use the services. If you have a predictable workload, you can use committed use discounts to help you cut costs on resources that you need.

Committed use discounts work on most Compute Engine machine types, including predefined and custom machine types. Committed use discounts are simple and flexible, and require no upfront costs. Discounts apply to the aggregate number of vCPUs, memory, GPUs, and local SSDs within a region, so they are not affected by changes to your instance's machine setup.

Although N2 and C2 machine cores and memory are included in committed use discount pricing, 50, 75, and 100 Gbps higher bandwidth SKUs are excluded from discounts.

F1-micro and g1-small shared-core machines are not eligible for committed use discounts.

Before you begin

How committed use discounts work

If you have just a few projects, you can purchase commitments just for the specific resources you plan to use.

For example, if you purchase a commitment for 8 cores, and you run 24 cores during the month, you will receive committed use discounts for 8 cores. The other 16 cores will be billed at standard, non-committed use rates. Keep in mind that after you purchase a set amount of commitments, you're billed for those commitments monthly, even if you don't use them. For example, if you purchase commitments for 8 cores, you're billed the committed use rates for those 8 cores for the whole month, even if you might have only run these cores for a part of the month. It is to your advantage to purchase commitments only in increments you know you will use.

Any resources that do not qualify for committed use discounts automatically qualify for sustained use discounts. You can't combine committed use discounts and sustained use discounts for the same resources.

Committed use discounts apply to both vCPUs and memory. You can buy a committed use discount for vCPUs or memory independently of one another.

Commitments can't be stacked for burst scenarios. For example, if you purchased 10 cores for the month and then ran 20 cores for half the month, commitments would not apply for the full 20 cores just because the usage was half the month.

Resources that are not covered by committed use discounts automatically qualify for sustained use discounts on a machine type family basis.

For example:

You run an n2-standard-2 for a portion of the month and run an n2-standard-8 for another portion of the same month, Compute Engine combines the two and applies sustained use discounts for the portion not covered by committed use discounts because both machine types belong to the n2-standard family.

By default, committed use discounts apply at the project level, but you can enable discount sharing from your billing account to share discounts across multiple projects.

Sharing committed use discounts across projects

Sharing your committed use discounts across all your projects reduces the overhead of managing discounts on a per-project basis, and maximizes your savings by pooling all your discounts across your projects' resource usage.

If you have multiple projects that share the same Cloud Billing account, you can enable committed use discount sharing so all of your projects within that Cloud Billing account share all of your committed use discount contracts. Your sustained use discounts are also pooled at the same time. That is, sustained use discounts are calculated using the total resources across these projects, rather than just the resources within a single project.

For example, you purchase two commitments for 80 cores each (a total of 160 cores) and you run 200 cores during the month across different projects in your Cloud Billing account. If you've enabled committed use discount sharing, you receive the applicable committed use discounts for 160 of those 200 cores that are used by your billing account's projects. The additional 40 cores are billed at on-demand, non-committed use rates. After you purchase your commitments, you're billed for your committed resources monthly, throughout the commitment time period, even if you don't use the resources. See Understanding discount sharing for cost-saving utilization recommendations.

Committed use discounts are subject to Google Cloud commitment-based pricing and billing. By purchasing a committed use discount, you agree to these terms.

Using attribution to allocate discounts

Attribution refers to how your committed use discounts are allocated across your projects. These allocations are reflected in Cloud Billing cost management interfaces, such as the usage cost export or the Google Cloud console.

Attribution applies only when discount sharing is enabled. You can choose the type of attribution you want to use before you turn on discount sharing, and then activate the attribution configuration when you enable discount sharing.

Compute Engine commitments use proportional attribution by default. Proportional attribution commitments are applied to the projects according to the amount of the total eligible usage consumed by each project. For example, if project A consumed $75 worth of usage and project B consumed $25, project A would be covered by up to 75% of available credit and project B would be covered by up to 25%.

Alternatively, you can choose prioritized attribution for your Compute Engine commitments based on the usage you specify. Any remaining unprioritized commitments are applied proportionally to the eligible usage in your remaining projects. The total amount of the allotments cannot exceed the commitment amount purchased.

To choose proportional or prioritized attribution for your Compute Engine commitments, see choose attribution for resource-based commitments.

Specifications

  • You can only purchase commitments if you have quota for commitments. For more information about quotas, see Resource quotas. Check the Quotas page to ensure you have enough quota to create a commitment. If commitments are not listed on the quotas page or you require additional quota, request a quota increase.

  • Commitments must be purchased on a per-region basis.

  • To use the gcloud CLI to manage commitments, you must be running gcloud version 147.0.0 or later. To update the gcloud CLI to the latest version:

    gcloud components update
    

    To check the version of the gcloud CLI you are running:

    gcloud version
    
  • Any remaining vCPUs and memory that are not covered by committed use discounts are eligible for sustained use discounts.

Restrictions

  • Projects that are in the free tier period with free tier credit and projects that do not have any payment history do not qualify for committed use discounts.
  • You can purchase commitments only on a per-region basis.
  • Committed use discounts apply to usage in the project or Cloud Billing account in which those discounts are purchased.
  • For commitments shared across projects under one Cloud Billing account: If any part of the commitment is unutilized, the remaining commitment charge remains in the project that purchased that portion of the commitment
  • Committed use discounts do not apply to preemptible VM instances, N1 shared-core machine types, or extended memory.
  • For committed use discounted pricing for GPUs and local SSDs, you must create a reservation when purchasing the commitment.
  • Committed use discount prices are independent of on-demand pricing. Any fluctuation in on-demand pricing would not necessarily be reflected in committed use discounts.
  • If a reservation is attached to a committed use discount, the reservation can't be deleted for the duration of the commitment.
  • You can only buy a 1-year commitment on K80 GPUs.

Pricing

Committed use discount pricing for VM instances, with or without GPUs or local SSDs, differs depending on the region. For current rates, see Pricing.

Commitment types

You can purchase commitments for the following resources.

Commitment types Resources for which you can purchase discounts Applicable to the following resource types
General purpose E2 commitments
  • vCPUs
  • Memory
All E2 machine types
General purpose N2 commitments
  • vCPUs
  • Memory
  • Local SSD
  • All N2 machine types
  • All N2 sole-tenant node types
General purpose N2D commitments
  • vCPUs
  • Memory
  • Local SSD
  • All N2D machine types
  • All N2D sole-tenant node types
General purpose Tau T2D commitments
  • vCPUs
  • Memory
Standard Tau T2D machine types
General purpose N1 commitments
  • vCPUs
  • Memory
  • GPUs
  • Local SSD
  • All N1 machine types, excluding shared-core.
  • All N1 sole-tenant node types
  • GPUs:
    • NVIDIA T4
    • NVIDIA V100
    • NVIDIA P100
    • NVIDIA P4
    • NVIDIA K80
Compute-optimized C2 commitments
  • vCPUs
  • Memory
  • Local SSD
  • All C2 machine types
  • All C2 sole-tenant node types
Compute-optimized C2D commitments
  • vCPUs
  • Memory
All C2D machine types
Memory-optimized M1/M2 commitments
  • vCPUs
  • Memory
  • All M1 and M2 machine types
  • All M1 and M2 sole-tenant node types
Memory-optimized M3 commitments
  • vCPUs
  • Memory
All M3 machine types
Accelerator-optimized A2 commitments
  • vCPUs
  • Memory
  • GPUs
  • Local SSD
  • All A2 machine types
  • GPUs:
    • NVIDIA A100

You can't purchase commitments for f1-micro, or g1-small machine types or for the sole-tenant premium charge.

Commitments for machine types

Purchase the appropriate commitment type for the machine types you are using. Discounts for general-purpose commitments are applied to resources in the following order:

  1. E2, N2, N2D, or N1 custom machine types, depending on which commitment you purchase
  2. Sole-tenant nodes
  3. Either the E2, N2, N2D, Tau T2D, or N1 predefined machine types, depending on which commitment you purchase

When you purchase general-purpose commitments, you pick which generation the commitment applies to. For example, if you purchase general-purpose E2 commitments, they only apply to E2 machine types. Similarly, if you purchase general-purpose N2, N2D, Tau T2D, or N1 commitments, the commitments never overlap.

For example, assume you have a region with the following mix:

  • 10 N2 custom machine type vCPUs
  • 30 GB of custom machine type memory
  • 2 n2-standard-4 predefined machine types

You purchase N2 commitments for 15 vCPUs and 13.5 GB of memory for committed use. The committed use discounts would be applied first to the N2 custom machine types, and any remaining discounts would be applied to the N2 predefined machine types. In this case, all 10 vCPUs of the N2 custom machine types would be charged at committed use prices, and 13.5 GB of custom machine type memory would be charged at committed use prices.

Finally, the remaining 5 vCPUs of committed use would apply to 5 random vCPUs across the two n2-standard-4 machine types. Any resources that aren't covered by committed use discounts would qualify for sustained use discounts.

To purchase a commitment for general-purpose machine types, see Purchasing commitments without attached reservations.

Memory-optimized commitments

Memory-optimized committed use discounts are available at two levels. One level applies to both M1 and M2 machine types. The other level applies to only M3 machine types. You cannot use the same committed use discount for all memory-optimized machine types. Quota for these committed use discounts is separate. If you want to use a committed use discount for an M1 machine type, you must have quota for an M1 machine. The same is true for M2 and M3–you must have quota for the committed use discount.

If you intend to use memory-optimized machine types, purchase memory-optimized commitments. To purchase a commitment for memory-optimized machine types, see Purchasing commitments without attached reservations.

Compute-optimized commitments

If you intend to use compute-optimized machine types, purchase compute-optimized commitments. To purchase a commitment for compute-optimized machine types, see Purchasing commitments without attached reservations.

Accelerator-optimized commitments

If you intend to use accelerator-optimized machine types, purchase accelerator-optimized commitments. To purchase a commitment for accelerator-optimized machine types, see Purchasing commitments without attached reservations.

Commitments for GPUs and local SSD

To purchase commitments for GPUs or local SSDs, you must also reserve the resources when purchasing the commitment. Reserving these resources is required to ensure that the resources are always available for you (whether you use them or not). There are no additional charges for reserving the resources.

You must purchase commitments by specific GPU types. For example, you can purchase GPUs for either NVIDIA P100s or NVIDIA V100s, but you can't purchase commitments for NVIDIA P100 GPUs and apply them to other GPU types.

To purchase a commitment for GPUs and local SSDs, see Purchasing commitments with attached reservations.

For more information about reservations, see Reserving zonal resources.

Requesting quota for commitments

You can only purchase commitments if you have quota for commitments. Check the Quotas page to ensure you have enough quota to create a commitment.

When making a request using the gcloud CLI or the API, the server returns the following error if you have no commitment quota:

"Quota 'COMMITMENTS' exceeded. Limit: 0.0"

Checking quota in the Google Cloud console

In the Google Cloud console, go to Quotas on the IAM & Admin page.

Go to Quotas

The Quotas page lists all of your Compute Engine resource quota and the level of quota usage. A resource with a quota status that is close to its limit is listed at the top of the page in order of most urgent denoted by a warning icon. Toggle the Quota status column to see each resource and its quota usage.

  1. In the Details column, click ALL QUOTAS to get usage information.
  2. Check the quota for commitments in your desired region. If you do not have quota for a commitment, the Limit is 0.

To request quota in the Google Cloud console

In the Google Cloud console, from the Menu, point to IAM & Admin, and click Quotas:

Go to Quotas

  1. In the Quota status column, click on . The quota panel lists all of your quotas.
  2. Select the checkbox for the location of the quota that needs adjustment.
  3. Click EDIT QUOTAS.
  4. Complete the request form.
  5. Enter your revised quota limit, and optionally, a description.
  6. Click DONE.
  7. Click SUBMIT REQUEST.

Alternatively, click Filter table to query your quota by a specific property.

You will receive an email in response to your request.

Increasing committed resource quotas

If you do not have enough quota for Committed CPUs, Committed local SSDs, or Committed GPUs (for example, for Committed NVIDIA V100 GPUs), request a quota increase from the Quotas page. To utilize the commitment, you also need sufficient resource quota (for example, NVIDIA V100 GPUs). You can request these quota increases at any time.

To increase your COMMITTED CPU quota, do the following:

  1. Submit a new quota request to increase your Committed CPU quota to the new maximum amount you require. For example, if you have 14k vCPUs and you need 20k vCPUs, submit the request for 20k. Wait for the request to be approved and closed before continuing to the next step.
  2. Submit a new quota request to increase your Commitments quota to match the number of commitments you require. For example, if you have 10 commitments for 20k vCPUs, you must request quota to cover those 10 commitments.

This increases your committed CPU to match your current maximum CPU quota in the specified region.

Purchasing commitments without attached reservations

You can purchase commitments for vCPUs and/or memory without attaching any reservations for those resources. You can purchase these commitments using the Google Cloud console, the gcloud CLI, or the API.

To learn more about commitments with attached reservations, see Combining reservations with Committed use discounts

To purchase commitments for GPUs or local SSDs, see Purchasing commitments with attached reservations.

By default, project owners have permission to purchase committed use discount contracts. However, it's possible for owners to create custom roles that include or exclude certain users. Read about access control to ensure you have permission to purchase a committed use discount contract.

After purchasing a commitment, the commitment is effective starting at midnight the following day. For example, a commitment purchased on Monday afternoon at 3 PM US and Canadian Pacific Time (UTC-8, or UTC-7 during daylight saving time) becomes effective on Tuesday at 12 AM US and Canadian Pacific Time (UTC-8 or UTC-7). The discounts are automatically applied to applicable instances in the region you specified, and to the projects in which those discounts are purchased.

Console

Before you purchase a commitment using the Google Cloud console, select the project that you want to use to purchase the commitment. If discount sharing is enabled for a billing account, you can purchase the commitment using any project from that billing account. After you select the project, perform the following steps:

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

    Go to Committed use discounts

  2. To purchase a new commitment, click Purchase commitment.

  3. Name your commitment.

  4. Choose the region where you want it to apply.

  5. Choose the Commitment type:
    General-Purpose E2 for E2 machine types
    General-Purpose N2 for N2 machine types
    General-Purpose N2D for N2D machine types
    General-Purpose T2D for Tau T2D machine types
    General-Purpose N1 for N1 machine types
    Compute-optimized C2 for compute-optimized C2 machine types
    Compute-optimized C2D for compute-optimized C2D machine types
    Memory-optimized M1/M2 for M1 and M2 machine types
    Memory-optimized M3 for M3 machine types
    Accelerator-optimized A2 for accelerator-optimized machine types

  6. Choose a commitment Duration of 1 or 3 years.

  7. Enter the quantity of Cores or Memory that you want to purchase. There is no lower limit, the number can be zero. The quantity for cores must be entered as a whole number equal to or greater than zero. Memory can be purchased in increments of 0.25 GB.

  8. Read the terms of purchase.

  9. Click the Purchase button to purchase the commitment.

gcloud

Using the gcloud CLI, run the gcloud compute commitments create command:

gcloud compute commitments create COMMITMENT_NAME \
    --region REGION \
    --resources vcpu=NUMBER_VCPUS,memory=MEMORY \
    --plan DURATION \
    --type COMMITMENT_TYPE

Replace the following:

  • COMMITMENT_NAME: the name you want to identify this commitment with.
  • REGION: the region this commitment applies to. Each region has different commitment prices. For current prices, see the price sheet.
  • NUMBER_VCPUS: the number of vCPUs you are willing to purchase commitments for. The number of vCPUs must be an integer of 0 or more and can be even or odd.
  • MEMORY: the amount, in MB or GB, of memory you are willing to purchase commitments for. For example, 1000MB. If the units are not specified, the default unit used is GB. Memory can be purchased in increments of 0.25 GB.
  • DURATION: the term of the commitment, either 12-month or 36-month.
  • COMMITMENT_TYPE: one of:

    • general-purpose-e2 for general purpose E2 machine type commitments
    • general-purpose-n2 for general purpose N2 machine type commitments
    • general-purpose-n2d for general purpose N2D machine type commitments
    • general-purpose-t2d for general purpose Tau T2D machine type commitments
    • general-purpose for general purpose N1 machine type commitments
    • compute-optimized for compute-optimized C2 machine type commitments
    • compute-optimized-c2d for compute-optimized C2D machine type commitments
    • memory-optimized for the memory-optimized M1 or M2 machine type commitments
    • memory-optimized-m3 for memory-optimized M3 machine type commitments
    • accelerator-optimized for the accelerator-optimized machine type commitments

      If you do not specify the --type flag, the default value used is general-purpose.

Examples

  • To create a general-purpose commitment for N1 machine types, you might use the following example:

    gcloud compute commitments create example-commitment --region us-central1 \
      --resources vcpu=5,memory=33280MB --plan 12-month
    
  • To create a compute-optimized commitment, use the gcloud compute commitments create command, which purchases a 1 year commitment for a compute-optimized machine type:

    gcloud compute commitments create example-compute-optimized-commitment \
      --region us-central1 --resources vcpu=2,memory=3814GB --plan 12-month \
      --type compute-optimized
    
  • To create a memory-optimized commitment:

    gcloud compute commitments create example-memory-optimized-commitment \
      --region us-central1 --resources vcpu=96,memory=1434MB \
      --plan 12-month --type memory-optimized
    
  • To create an accelerator-optimized commitment, you must create a reservation when purchasing the commitment by using the gcloud compute commitments create command. You must also specify the total number of resources (including GPUs) that you need.

    When creating GPU commitments, you need to specify the --accelerator and --resources-accelerator flags. The --accelerator flag specifies the number of GPUs that are attached to each VM. The --resources-accelerator flag specifies the total number of GPUs in the commitment.

    For example, the following commitment includes 96 vCPUs, 680 GB memory, 8 GPUs, and a reservation for those GPUs to be used in 2 VMs in us-central1-a.

    gcloud compute commitments create example-accelerator-optimized-commitment \
      --region=us-central1 \
      --resources=vcpu=96,memory=680GB \
      --resources-accelerator=count=8,type=nvidia-tesla-a100 \
      --plan 12-month \
      --type accelerator-optimized \
    
      --reservation=reservation-01 \
      --reservation-zone=us-central1-a \
      --machine-type=a2-highgpu-4g \
      --accelerator=count=4,type=nvidia-tesla-a100 \
      --vm-count=2
    
    
  • To create a GPU or local SSD commitment, you must create a reservation when purchasing the commitment by using the gcloud compute commitments create command.

    When creating GPU commitments, you need to specify the --accelerator and --resources-accelerator flags. The --accelerator flag specifies the number of GPUs that are attached to each VM. The --resources-accelerator flag specifies the total number of GPUs in the commitment.

    For example, the following commitment includes 4 GPUs and a reservation for those GPUs to be used in 2 instances in us-central1-a.

    gcloud compute commitments create example-reservation-commitment \
      --region=us-central1 \
      --resources=vcpu=96,memory=624GB \
      --resources-accelerator=type=nvidia-tesla-v100,count=4 \
      --plan 12-month \
      
      --reservation=reservation-01 \
      --reservation-zone=us-central1-a \
      --machine-type=n1-standard-32
      --accelerator=type=nvidia-tesla-v100,count=2 \
      --vm-count=2
      
    

API

In the API, make a POST request to the regionCommitments.insert method, with a request body that contains information about the commitment:

https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/commitments?requestId=OPTIONAL_UNIQUE_ID

The resource body should contain the following:

  • name for the name of the commitment
  • plan for the term of the commitment, either TWELVE_MONTH or THIRTY_SIX_MONTH
  • resources to specify the amount of memory and vCPU. Memory must be be specified in MB. You must specify both VCPU and MEMORY in the resources section.
  • type of commitment, one of the following:

    • GENERAL_PURPOSE_N2 for general purpose N2 machine type commitments
    • GENERAL_PURPOSE_E2 for general purpose E2 machine type commitments
    • GENERAL_PURPOSE_N2D for general purpose N2D machine type commitments
    • GENERAL_PURPOSE_T2D for general purpose Tau T2D machine type commitments
    • GENERAL_PURPOSE for general purpose N1 machine type commitments
    • COMPUTE_OPTIMIZED for compute-optimized C2 commitments
    • COMPUTE_OPTIMIZED_C2D for compute-optimized C2D commitments
    • MEMORY_OPTIMIZED for the memory-optimized M1 or M2 commitments
    • MEMORY_OPTIMIZED_M3 for the memory-optimized M3 machine type commitments
    • ACCELERATOR_OPTIMIZED for the accelerator-optimized commitments

For example, the following creates a commitment for 1 year with 5 vCPUs and 18.75 GB of memory:

{
  "name": "example-commitment",
  "plan": "TWELVE_MONTH",
  "type": "GENERAL_PURPOSE",
  "resources": [
    {
    "amount": "5",
    "type": "VCPU"
    },
    {
    "amount": "19200",
    "type": "MEMORY"
    }
  ]
}

To create a memory-optimized commitment, include the type property. The following example shows a purchase of a 1 year commitment for an m1-megamem-96 machine type:

{
  "name": "example-memory-optimized-commitment",
  "plan": "TWELVE_MONTH",
  "type": "MEMORY_OPTIMIZED",
  "resources": [
    {
    "amount": "96",
    "type": "VCPU"
    },
    {
    "amount": "1434",
    "type": "MEMORY"
    }
  ]
}

To create a compute-optimized commitment, include the type property. The following example, purchases a 1 year commitment for a c2-standard-16 machine type:

{
  "name": "example-compute-optimized-commitment",
  "plan": "TWELVE_MONTH",
  "type": "COMPUTE_OPTIMIZED",
  "resources": [
    {
    "amount": "16",
    "type": "VCPU"
    },
    {
    "amount": "1434",
    "type": "MEMORY"
    }
  ]
}

Purchasing commitments with attached reservations

When you purchase a commitment with attached reservations, make sure that your commitment and reservations meet the following criteria:

  • The commitment and its attached reservations must be in the same region.
  • The reservation must be for the same machine series as the commitment.
  • If your commitment has GPUs, then the GPU type in the reservation and the commitment must match.
  • For GPUs and local SSDs, the number of reserved resources of each resource type must exactly match with the number of committed resources for that resource type. For example, if you want to purchase a commitment for 4 V100 GPUs, then your commitment's attached reservations must have a total of 4 V100 GPUs. However, the amount of vCPU and memory that you reserve can be more or less than what you commit to.
  • For GPUs, purchase commitments for the specific GPU types that you intend to use. For example, you can purchase commitments for either NVIDIA P100s or NVIDIA V100s, but you cannot use a commitment that was purchased for NVIDIA P100 GPUs to cover NVIDIA V100 GPUs.

You can purchase a commitment with an attached reservation using the Google Cloud console, the gcloud CLI, or the API.

Console

Before you purchase a commitment using the Google Cloud console, select the project that you want to use to purchase the commitment. If discount sharing is enabled for a billing account, you can purchase the commitment using any project from that billing account. After you select the project, perform the following steps:

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

    Go to Committed use discounts

  2. To purchase a new commitment, click Purchase commitment.

  3. Name your commitment, and choose the Region where you want it to apply.

  4. Choose the Commitment type for your GPUs and/or local SSDs:
    General-Purpose N2 for N2 machine types
    General-Purpose N2D for N2D machine types
    General-Purpose N1 for N1 machine types
    Compute-optimized C2 for C2 machine types
    Accelerator-optimized A2 for accelerator-optimized machine types

  5. Choose a commitment Duration of 1 or 3 years.

  6. Enter the quantity of Cores and Memory that you want to purchase. If you only want to commit to and reserve GPUs or local SSDs without committing to vCPUs and memory, specify 0 for the vCPUs and memory commitment quantities.

  7. Click Add GPUs and select the GPU type and Number of GPUs that you want to commit to.

  8. Click Add local SSD and specify the number of disks that you want to commit to.

  9. To create a reservation and attach it to the commitment, click Add an item in the Reservations section.

    1. In the Name field, enter a name for your reservation.
    2. Choose the Region and Zone where you want to reserve resources.
    3. Choose your preferred Share type:
      • To create a reservation for a single project, select Local.
      • To create a shared reservation among multiple projects, select Shared. To share this reservation with other projects, click Add projects and select the desired projects from the current project's organization.
    4. In the Use with VM instance field, select one of the following options:

      • To use this reservation's resources only when creating matching VMs that specifically target this reservation by name, select Select specific reservation.
      • To allow matching VM instances to automatically use this reservation, select Use reservation automatically.
    5. In the Number of VM instances field, enter the number of VM instances that you want to reserve.

    6. Specify the resources that you want to reserve for each VM instance:

      • If you want to reserve VMs that match an existing instance template, select Use instance template and select an instance template from the list.
      • Otherwise, select Specify machine type and specify the following:
        1. In the Machine family, Series, and Machine type fields, select a machine family, series, and machine type.
        2. Optional: Specify a minimum CPU platform and/or GPUs:
          1. To expand the CPU Platform and GPU section, click the expander arrow.
          2. Optional: To specify a minimum CPU platform, in the CPU Plaform list, select an option.
          3. Optional: To add GPUs, click Add GPU. Then, in the GPU type and Number of GPUs fields, select the type and number of GPUs for each VM.
        3. Optional: Add local SSDs:
          1. In the Number of disks field, select the number of local SSDs for each VM.
          2. In the Interface type field, select the interface for the local SSDs.
    7. To finish specifying the properties for this reservation, click Done.

  10. Click the Purchase button to purchase the commitment.

  11. Read the terms of purchase and click Purchase when you are ready to purchase the commitment.

gcloud

Use the gcloud compute commmitments create command to purchase a commitment, and include flags to create an attached reservation.

For example, the following commitment includes 4 GPUs and a new reservation for those 4 GPUs to be used across 2 n1-standard-32 instances in us-central1-a.

gcloud compute commitments create commitment-01 \
    --region=us-central1 \
    --resources=vcpu=96,memory=624GB \
    --resources-accelerator=type=nvidia-tesla-v100,count=4 \
    --plan 12-month \
    --reservation=reservation-01 \
    --reservation-zone=us-central1-a \
    --machine-type=n1-standard-32 \
    --accelerator=type=nvidia-tesla-v100,count=2 \
    --vm-count=2

If you want to commit to and reserve GPUs or local SSDs without committing to vCPUs and memory, specify 0 for the vCPU and memory commitment quantities.

gcloud compute commitments create commitment-01 \
    --region=us-west2 \
    --resources=vcpu=0,memory=0 \
    --resources-accelerator=type=nvidia-tesla-p4,count=1 \
    --plan 12-month \
    --reservation=reservation-01 \
    --reservation-zone=us-west2-b \
    --machine-type=n1-standard-2 \
    --accelerator=type=nvidia-tesla-p4,count=1 \
    --vm-count=1

To create multiple reservations when purchasing a commitment, use a YAML file that contains the reservation properties. For example:

gcloud compute commitments create commitment-01 \
    --region=us-central1 \
    --resources=vcpu=96,memory=624,local-ssd=750 \
    --resources-accelerator=type=nvidia-tesla-v100,count=1 \
    --plan 12-month \
    --reservations-from-file=YAML_FILE

For example, the following YAML file contains 2 reservations. The first reservation, res-01, contains 1 n1-standard-2 instance with 1 GPU, and it is a targeted reservation, which means that you must specifically target that reservation by name to use its reserved instances. The second reservation, res-02, contains 1 n1-standard-2 VM instance with 2 types of attached local SSDs.

- reservation: res-01
  reservation_zone: us-central1-a
  require_specific_reservation: true
  vm_count: 1
  machine_type: n1-standard-2
  accelerator:
  - count: 1
    type: nvidia-tesla-v100
- reservation: res-02
  reservation_zone: us-central1-a
  vm_count: 1
  machine_type: n1-standard-2
  local_ssd:
  - interface: scsi
    size: 375
  - interface: nvme
    size: 375

API

Use the regionCommitments.insert method and include the reservations field to define the reservation's properties. For example, the following commitment includes 4 GPUs and a reservation for those 4 GPUs to be used across 2 instances in us-central1-a.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/commitments

{
  "name": "commitment-01",
  "plan": "TWELVE_MONTH",
  "resources":
  [
    {
      "amount": "96",
      "type": "VCPU"
    },
    {
      "amount": "638976",
      "type": "MEMORY"
    },
    {
      "acceleratorType": "nvidia-tesla-v100",
      "amount": "4",
      "type": "ACCELERATOR"
    }
  ],
  "reservations":
  [
    {
      "name": "reservation-01",
      "specificReservation":
      {
        "count": "2",
        "instanceProperties":
        {
          "guestAccelerators":
          [
            {
              "acceleratorCount": 2,
              "acceleratorType": "nvidia-tesla-v100"
            }
          ],
          "machineType": "n1-standard-8"
        }
      },
      "specificReservationRequired": false,
      "zone": "us-central1-a"
    }
  ]
}

If you only want to commit to and reserve GPUs or local SSDs without committing to vCPUs and memory, specify 0 for the vCPU and memory commitment quantities. For example:

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/commitments

{
  "name": "commitment-01",
  "plan": "TWELVE_MONTH",
  "resources":
  [
    {
      "amount": "0",
      "type": "VCPU"
    },
    {
      "amount": "0",
      "type": "MEMORY"
    },
    {
      "acceleratorType": "nvidia-tesla-v100",
      "amount": "4",
      "type": "ACCELERATOR"
    }
  ],
  "reservations":
  [
    {
      "name": "reservation-01",
      "specificReservation":
      {
        "count": "2",
        "instanceProperties":
        {
          "guestAccelerators":
          [
            {
              "acceleratorCount": 2,
              "acceleratorType": "nvidia-tesla-v100"
            }
          ],
          "machineType": "n1-standard-8"
        }
      },
      "specificReservationRequired": false,
      "zone": "us-central1-a"
    }
  ]
}

The commitment with the attached reservations is successfully created only if there are enough resources of the specified machine type in the target zone, and sufficient quota, at the time of the request.

When you create a commitment with an attached reservation, you cannot delete the reservation for the duration of the commitment. When your commitment expires, Compute Engine automatically deletes any attached reservations. The deletion of reservations has no effect on any running instances that were tied to those reservations. The running instances continue to run and you are still charged for those instances.

If you need to modify the properties of your committed reservations, see Modifying reservations that are attached to commitments.

Purchasing commitments for licenses

You can purchase commitments for your licenses if you run your workloads on VMs that use the following operating system (OS) images:

  • SUSE Linux Enterprise Server (SLES) images. The following discount percentages apply for these images:
    • For VM instances with 1-2 vCPUs, you get a 77% discount on the on-demand image prices for a 1-year commitment and a 79% discount on the on-demand image prices for a 3-year commitment.
    • For VM instances with 3-4 vCPUs, you get a 54% discount over the on-demand image prices for a 1-year commitment and a 59% discount over the on-demand image prices for a 3-year commitment.
    • For VM instances with more than 5 vCPUs, you get a 45% discount over the on-demand image prices for a 1-year commitment and a 50% discount over the on-demand image prices for a 3-year commitment.
  • SLES for SAP images. You get a 59% discount over the on-demand image prices for a 1-year commitment and a 63% discount over the on-demand image prices for a 3-year commitment.

When you purchase a commitment for licenses, the commitment forms a "pool" of licenses that automatically apply to any running VM instances within a selected project in a specified region. The licenses in the commitment are not tied to any one particular VM. When a VM starts, it takes a committed license from the pool, and when the VM stops it returns the license to the pool, where the license can be used by another VM. As long as there are available committed licenses in the pool, you continue to receive discounts for the premium OS usage.

For example, if you need to run 10 VMs in two regions (5 VMs in us-central1 and 5 VMs in us-west1) and under the same project ID, you must purchase 5 licenses in each region to cover those running VMs. For each commitment, your committed licenses can apply to any 5 concurrently running VMs at any time during the year in the respective region. You are billed monthly for the commitments regardless of your usage.

You can't cancel a license commitment after you purchase it. When your license commitments expire, your running VMs continue to run and you are charged for the licenses at on-demand image prices.

Purchase a license commitment using the Google Cloud console, the Google Cloud CLI, or the Compute Engine API.

Console

Before you purchase a commitment using the Google Cloud console, select the project that you want to use to purchase the commitment. If discount sharing is enabled for a billing account, you can purchase the commitment using any project from that billing account. After you select the project, perform the following steps:

  1. In the Google Cloud console, go to the Committed Use Discounts page.

    Go to the Committed Use Discounts page

  2. Click Purchase commitment to purchase a new commitment.
  3. Click New license committed use discount to purchase a new license commitment.
  4. Name your commitment and choose the region where you want it to apply.
  5. Choose a duration amount of the commitment, either 1 or 3 years.
  6. Choose a License family.
  7. Choose the License type and quantity.
  8. Choose the Number of licenses.
  9. Click Purchase.

gcloud

Using the gcloud CLI, run the gcloud compute commitments create-license command to purchase a license commitment.

gcloud compute commitments create-license COMMITMENT_NAME \
    --license `LICENSE_URI`
    --amount NUMBER_OF_LICENSES \
    --cores-per-license CORES_PER_LICENSE \
    --plan PLAN \
    --region REGION \

Replace the following:

  • COMMITMENT_NAME: the name for your commitment.
  • LICENSE_URI: the license URI. For example: https://www.googleapis.com/compute/v1/projects/myproject/global/licenses/sles-sap-12
  • NUMBER_OF_LICENSES: the number of licenses you plan to purchase.
  • CORES_PER_LICENSE: the number of cores per license. Enter 1-2 3-4, or 5+.
  • PLAN: enter the plan length: 12-month or 36-month.
  • REGION: the region where this commitment applies.

For example, the following commitment is for 4 SAP licenses with 3-4 cores per license for 36 months in the us-central1 region:

gcloud compute commitments create-license commitment-1
    --license https://www.googleapis.com/compute/v1/projects/myproject/global/licenses/sles-12
    --amount=4
    --cores-per-license=3-4
    --plan=36-month
    --region=us-central1

For example, the following commitment is for 2 SLES for SAP licenses with 1-2 cores per license for 12 months in the us-central1 region:

gcloud compute commitments create-license commitment-2
    --license https://www.googleapis.com/compute/v1/projects/myproject/global/licenses/sles-sap-12
    --amount=2
    --cores-per-license=1-2
    --plan=12-month
    --region=us-central1

API

Use the regionCommitments.insert method and include the licenseResource field to define the license commitment's properties.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/commitments?requestId=OPTIONAL_UNIQUE_ID

{
    "name": COMMITMENT_NAME,
    "plan": PLAN,
    "category": "LICENSE",
    "licenseResource": {
      "coresPerLicense": CORES_PER_LICENSE,
      "amount": NUMBER_OF_LICENSES,
      "license": `LICENSE_URI`
      }
}

Replace the following:

  • COMMITMENT_NAME: the name for your commitment.
  • LICENSE_URI: the license URI. For example: https://www.googleapis.com/compute/v1/projects/myproject/global/licenses/sles-sap-12
  • NUMBER_OF_LICENSES: the number of licenses you plan to purchase.
  • CORES_PER_LICENSE: the number of cores per license. Enter 1-2 3-4, or 5+.
  • PLAN: enter the plan length: 12-month or 36-month.
  • REGION: the region where this commitment applies.

For example, the following commitment is for 4 SLES for SAP licenses with 3-4 cores per license for 36 months in the us-central1 region.

POST https://compute.googleapis.com/compute/v1/projects/myproject/regions/us-central1/commitments

{
    "name": "commitment-3",
    "plan": "THIRTY_SIX_MONTH",
    "category": "LICENSE",
    "licenseResource": {
      "coresPerLicense": "3-4",
      "amount": "4",
      "license": "https://www.googleapis.com/compute/v1/projects/suse-sap-cloud/global/licenses/sles-sap-12"
      }
}

Applying committed use discount recommendations

Committed use discount recommendations are available in the Google Cloud console. The Recommender generates a card with information about your VM usage over the last 30 days. If your VMs show a trend of uncommitted usage over 30 days, the Recommender classifies this as an opportunity to purchase committed use discounts to reduce your VM costs.

Usage is considered uncommitted and eligible if the following is true.

  • The VM was active for the entire duration of the 30 days.
  • The VM's SKU is part of an eligible committed use discount bucket.
  • The VM's usage was not already covered by an existing commitment.

Recommendations are refreshed once per day and take the last 30 days of usage history into consideration.

Recommendations for committed use discounts are generated by two separate algorithms, which you can select from when purchasing (or accepting) them on the summary card.

  • Stable usage recommendations cover minimum stable usage over time.
  • Optimal recommendations are based on overall usage and might cover resources that are not on all the time.

You can read more about commitment recommendations in the committed use discount recommender documentation.

Limitations

Committed use discount recommendations are available for the CPU and memory component of machine type commitments only. Committed use discount recommendations are not available for SSD, GPU or license commitments.

Reviewing and accepting a recommendation

For how to purchase the recommended commitments, see purchasing recommendations.

Dismissing a recommendation

For how to dismiss your commitment recommendations or to restore recommendations that were previously dismissed, see dismissing recommendations.

History of recommendations

To view the history of your applied and dismissed commitment recommendations, see viewing the history of recommendations.

Enabling committed use discount sharing

By default, committed use discounts are applied to the project where you purchased it. To share the discount across multiple projects linked to your Cloud Billing account, enable committed use discount sharing from the console.

Discount sharing works in conjunction with your attribution configuration. You can choose to use proportional attribution or prioritized attribution.

Unless you configure your attribution preferences first, when you enable discount sharing, it defaults to using proportional attribution for your Compute Engine resource-based commitments.

If you want to configure your attribution configuration before you enable discount sharing, see choose attribution for resource-based commitments for more information and how to enable each type of attribution.

You must have specific permissions to access billing account information. Read the Overview of Cloud Billing access control document for specifics.

  1. Sign in to your Cloud Billing account in the Google Cloud console.

    Sign in to your Cloud Billing account

  2. At the prompt, choose the Cloud Billing account for which you'd like to configure your committed use discounts to use discount sharing. The Billing Overview page opens for the selected billing account.

  3. From the Billing navigation menu, select Commitments to view the committed use discounts dashboard.

  4. From the committed use discounts dashboard, locate the resource-based commitment for which you want to enable discount sharing, and click View analysis.

  5. On the committed use discount analysis page, select Commitment scope.

    • Project scope is the default option when you select committed use discounts for a specific project. To change your setting, you must enable shared billing. (If your commitment scope is set for Billing account, then discount sharing is already enabled for this commitment.)
  6. In the text entry box, type Enable to enable Billing account scope commitments.

  7. Click Enable Billing Account Scope to save your changes.

When you enable committed use discount sharing, all of your current active committed use discounts in all the projects under the same Cloud Billing account, including those you previously purchased and new ones you purchase in the future, are shared across your Cloud Billing account. Your sustained use discounts are also pooled and shared across all projects within your Cloud Billing account. When you change your commitment scope configuration, the change takes effect on the following day at 12 AM US and Canadian Pacific Time (UTC-8 or UTC-7).

To gain a better understanding of how committed use discounts impact and appear on your bill, see Understanding your bill with committed use discounts.

Combining reservations with commitments

A committed use discount provides a 1- or 3-year discounted price agreement, but it does not reserve capacity in a specific zone. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. By combining a reservation with a commitment, you get discounted, reserved resources.

To purchase a commitment and get discounted prices for GPUs and local SSDs, create a reservation when purchasing the commitment. For these resources, the location and size of the reservation can't be changed for the duration of your commitment.

For information about reservations, see Combining reservations with committed use discounts.

Modifying a commitment

After you purchase a commitment, you can only modify the amount of resources in your commitments. You can change the amount of resources in a commitment by either merging or splitting your existing commitments. For more information, see Merge and split commitments.

You can't modify the commitment's project, type, region, or term duration after you create the commitment.

Viewing active commitments

View commitments in the console or the API.

Console

In the Google Cloud console, view a list of commitments in the Committed use discounts page.

Go to Committed use discounts

gcloud

Make a request using the commitments list command:

gcloud compute commitments list

The tool returns a list of commitments:

 NAME              REGION    END_TIMESTAMP                  STATUS
 my-commitment     us-east1  2018-03-17T00:00:00.000-07:00  NOT_YET_ACTIVE

API

You can get a list of commitments across all regions by making an aggregatedList request to the following URL:

https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/aggregated/commitments

Which returns a list of commitments:

"commitments": [
{
  "kind": "compute#commitment",
  "id": "3294122326373778983",
  "creationTimestamp": "2017-02-09T15:18:32.411-08:00",
  "name": "example-commitment",
  "region": "https://www.googleapis.com/compute/v1/projects/example-project/regions/us-central1",
  "selfLink": "https://www.googleapis.com/compute/v1/projects/example-project/regions/us-central1/commitments/example-commitment",
  "status": "NOT_YET_ACTIVE",
  "statusMessage": "The commitment is not yet active (its startTimestamp is in the future). It will not apply to current resource usage.",
  "plan": "TWELVE_MONTH",
  "startTimestamp": "2017-02-10T00:00:00.000-08:00",
  "endTimestamp": "2018-02-10T00:00:00.000-08:00",
  "resources": [
    {
      "type": "VCPU",
      "amount": "5"
    },
    {
      "type": "MEMORY",
      "amount": "32500"
    }]
  }
]

A commitment can have one of the following statuses:

  • CREATING: the commitment is being created.
  • NOT_YET_ACTIVE: the commitment has been created but is not yet active. Commitments are effective at midnight the following day.
  • ACTIVE: the commitment is active.
  • EXPIRED: the commitment has expired. Compute Engine reserves the right to remove expired commitments that are older than 210 days from the expiration date.

Canceling a commitment

After you create a commitment, you can't cancel it. You must pay the agreed upon monthly amount for the duration of the commitment. Commitments are not affected by future pricing changes to the standard prices for Compute Engine resources.

If you accidentally purchased a commitment or made a mistake configuring your commitment, contact Google Cloud Billing Support for help.

Understanding your bill with committed use discounts

Read the following documents to gain a better understanding of your billing:

Support

If you have any questions regarding committed use discounts on your bill, you can contact Google Cloud support.

What's next