Resource-based committed use discounts


Compute Engine provides resource-based committed use discounts (CUDs) for your predictable workloads to help you cut costs on resources that you need. You can 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 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.

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 Understand commitment recommendations.

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 SSD disks within a region, so they are not affected by changes to your instance's machine setup.

For machine types that support per VM Tier_1 networking performance, the 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

  • If you haven't already, set up authentication. Authentication is the process by which your identity is verified for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine as follows.

    Select the tab for how you plan to use the samples on this page:

    Console

    When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.

    gcloud

    1. Install the Google Cloud CLI, then initialize it by running the following command:

      gcloud init
    2. Set a default region and zone.

    REST

    To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.

      Install the Google Cloud CLI, then initialize it by running the following command:

      gcloud init

How committed use discounts work

When you purchase a committed use contract, you purchase Compute Engine resources—such as vCPUs, memory, GPUs, Local SSD disks, 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.

During your commitment's term, you automatically start receiving CUDs on eligible resource usage in your project that matches the resource types, machine type, and region specified in your commitment. You continue to receive these CUDs for your eligible resource usage until your commitment expires.

Compute Engine maintains a lien on your project for each region in your project where you purchase a commitment. When you purchase a new commitment for any region in your project, Compute Engine associates the lien for that region with the newly created commitment.

You can't cancel a commitment after you purchase it. Your commitment expires at the end of its specified term duration of 1 or 3 years. However, you can enable auto-renewal on your commitment to ensure that it automatically renews for a new term.

Commitment status

Your commitment can have one of the following statuses:

  • CREATING: the commitment is being created.
  • NOT_YET_ACTIVE or PENDING: the commitment has been created but is not yet active. Compute Engine creates your commitments with this status.

    • If you're using the Google Cloud CLI or the REST API to purchase your commitment, then this status value shows as NOT_YET_ACTIVE.
    • If you're using the Google Cloud console to purchase your commitment, then this status value shows as PENDING.
  • 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.

  • CANCELED: Compute Engine canceled the commitment. Compute Engine changes the status of your commitments to CANCELED when you combine them to create a new merged commitment.

Between the time of your commitment purchase and its activation time, the status of your commitment remains as NOT_YET_ACTIVE (or as PENDING on the Google Cloud console). After activation, the status of your commitment changes to ACTIVE. For example, suppose you purchase your commitment on January 20th at 10:00 PM US and Canadian Pacific Time (UTC-8 or UTC-7). Compute Engine creates your commitment immediately with its status as NOT_YET_ACTIVE. However, your commitment becomes ACTIVE only on January 21st at 12:00 AM US and Canadian Pacific Time (UTC-8 or UTC-7).

Efficient usage of your commitments

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.

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

Usage overage

Any hourly resource usage that is not covered by your commitments is charged based on the on-demand rates and is eligible for any applicable sustained use discounts (SUDs). For example, suppose 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 SUDs for the portion not covered by committed use discounts because both machine types belong to the n2-standard family.

Combine reservations with commitments

A commitment 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. To get zonal resources at discounted prices and also ensure that capacity is reserved for them, you must both purchase commitments and create reservations for those zonal resources.

You can also attach reservations to your resource-based commitments to ensure that the reservations are specific to those commitments. When you commit to GPU or Local SSD resources, you must also reserve those resources and attach those reservations to your commitment.

For more information, see Combine reservations with committed use discounts.

Share committed use discounts across projects

By default, committed use discounts apply at the project level and you receive the applicable committed use discounts only for the project in which you purchase the commitment. If you move the project for which you purchased your commitment to a different Cloud Billing account, then you continue to receive the applicable committed use discounts for that project under the new Cloud Billing account.

However, Compute Engine lets you share discounts for hardware commitments across multiple projects that share the same Cloud Billing account. Sharing your committed use discounts for hardware commitments 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.

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 for your Cloud Billing account, then you receive the applicable committed use discounts for 160 of those 200 cores that are used across the projects in that Cloud Billing account. 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 Understand 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.

Use 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 resource-based commitments for resources in a specific region if you have quota available in that region for both of the following:

    • Commitments
    • Committed resources (with the exception of memory)

    For more information, see Quotas for commitments and committed resources.

  • 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
    

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.
  • You can't change the project for which you purchase a commitment. If you want to share the discount with multiple projects, enable discount sharing.

  • 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 SSD disks, you must reserve your resources and attach those reservations to your 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

You're billed monthly for your commitment and must pay your monthly commitment fee even if you don't use all of your committed resources. Your commitment fee is the sum of the discounted prices of all your committed resources. Compute Engine calculates the discounted price of each resource by using its prevailing on-demand price on the day your commitment becomes active. Your monthly commitment fee and the discounted prices for your resources stay the same until the end of your commitment term, even if the on-demand prices change.

The discounted pricing (also referred to as CUD pricing) for VM instances, with or without GPUs and Local SSD disks, differs depending on the region. For current rates, see VM instance pricing.

If you move the project for which you purchased commitments to a different Cloud Billing account, then you continue to receive committed use discounts for that project under the new Cloud Billing account. Learn about changing the Cloud Billing account for a project.

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 C3 commitments
  • vCPUs
  • Memory
  • Local SSD
  • All C3 machine types
  • All C3 sole-tenant node types
General purpose C3D commitments
  • vCPUs
  • Memory
  • Local SSD
  • All C3D machine types
  • All C3D 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 H3 commitments
  • vCPUs
  • Memory
  • All H3 machine types
Compute-optimized C2 commitments
  • vCPUs
  • Memory
  • Local SSD
  • All C2 machine types
  • All C2 sole-tenant node types
Compute-optimized C2D commitments
  • vCPUs
  • Memory
  • Local SSD
All C2D machine types
Memory-optimized M1/M2 commitments
  • vCPUs
  • Memory
  • Local SSD
  • All M1 and M2 machine types
  • All M1 and M2 sole-tenant node types
Memory-optimized M3 commitments
  • vCPUs
  • Memory
  • Local SSD
All M3 machine types
Accelerator-optimized A2 commitments
  • vCPUs
  • Memory
  • GPUs
  • Local SSD
  • All A2 machine types
  • GPUs:
    • NVIDIA A100
Accelerator-optimized A3 commitments
  • vCPUs
  • Memory
  • GPUs
  • Local SSD
  • All A3 machine types
  • GPUs:
    • NVIDIA H100
Accelerator-optimized G2 commitments
  • vCPUs
  • Memory
  • GPUs
  • Local SSD
  • All G2 machine types
  • All G2 sole-tenant node types
  • GPUs:
    • NVIDIA L4

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.

General-purpose commitments

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. E2, N2, N2D, C3, C3D, Tau T2D, or N1 predefined machine types, depending on which commitment you purchase

When you purchase general-purpose commitments, you pick which machine series the commitment applies to. For example, if you purchase general-purpose E2 commitments, they apply to only E2 machine types. Similarly, if you purchase general-purpose N2, N2D, C3, C3D, 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 Purchase 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 Purchase commitments without attached reservations.

Compute-optimized commitments

If you intend to use compute-optimized machine types, purchase compute-optimized commitments. To purchase a commitment:

Accelerator-optimized commitments

If you intend to use accelerator-optimized machine types, purchase a commitment for A3, A2, or G2 machine types. To purchase a commitment for A3, A2, or G2 machine types, see Purchase commitments with attached reservations.

Commitments for GPUs and Local SSD resources

To purchase commitments for GPUs, Local SSD disks, or both you must also reserve the resources and attach the reservations to your 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, Local SSD disks, or both, see Purchase commitments with attached reservations in this document.

To learn more about commitments with attached reservations, see Attach reservations to resource-based commitments.

Quotas for commitments and committed resources

You can only purchase resource-based commitments for resources in a specific region if you have quota available in that region for both of the following:

  • Commitments
  • Committed resources (with the exception of memory)

Specifically, if you want to purchase commitments for any vCPUs, GPUs, or Local SSD disks, then you need to have quota available both for commitments and for those specific committed SKUs in the region where you want to purchase the commitment. There is no quota on memory, so you don't need to have separate quota for committed memory to purchase a commitments for memory.

For example, to purchase 5 commitments that cover 32 vCPUs of general-purpose N1 machine type, 16 GB memory, 4 NVIDIA P4 GPUs, and 2 Local SSD disks in us-central1 region, you must have quota for each of the following:

  • Five commitments in us-central1
  • 32 committed N1 vCPUs in us-central1
  • Four committed NVIDIA P4 GPUs in us-central1
  • 750 GB (or 2 Local SSD disks) of committed Local SSD disk space in us-central1

Quota limits

By default, Compute Engine offers a specific amount of commitment quota for each type of committed resource. These quota limits determine the number of commitments you can purchase and the amount of resources you can commit to. To learn how to view the current quota limits and quota usage values for your commitments and committed resources, see View quotas in the Google Cloud console.

If you consistently pay for a very high amount of committed vCPUs for your projects across different regions, then you might be eligible for unlimited quota on your committed vCPUs for all machine types (except for memory-optimized machine types) in all regions.

If you use up all your commitment quota, you won't be able to purchase new commitments. Likewise, if you exhaust your committed resource quota, then you won't be able to purchase a new commitment for that resource even if you have commitment quota available. For example, if you used up all of your commitment quota, then the server returns the following error when you make a commitment purchase request:

"Quota 'COMMITMENTS' exceeded. Limit: 0.0"

Increase quota limits

If you don't have enough quota for your commitments or your committed resources, you can always request for a quota increase from the Quotas page. You can request for quota increases at any time. To learn how to submit a request to increase quota limits for your resources, see Request a higher quota limit.

For example, consider a scenario where you purchased two commitments for a total of four NVIDIA V100 GPUs in us-central1 and met your quota limits. region. Suppose you want to purchase two new commitments for two NVIDIA V100 GPUs each, in the same region, you must do the following:

  1. Submit a new quota request to increase your Committed NVIDIA V100 GPUs quota in us-central1 to the new maximum number (eight) that you want.
  2. Submit a new quota request to increase your Commitments quota in us-central1 to match the new maximum number (four) that you want.

    Wait for your requests to be approved and closed. After your requests are approved, your commitment and committed GPU quotas in us-central1 increase to match your new needs. You can then purchase your new commitments.

If you place a request for an increase in quota limit for a resource that already has unlimited quota by default, then the quota value for that resource remains unlimited and you are notified that your requested limit is below the approved limit.

Set a cap for quota limits

You can set a cap on the quota value for your committed resources by creating a consumer quota override. For resources that have unlimited quota by default, creating a consumer quota override decreases the quota value. To return the default quota to its unlimited value, you must remove the consumer override that was set for your committed SKUs. For more information, see Creating a consumer quota override and Deleting a consumer quota override.

To learn more about how to manage quotas for your resources, see View and manage quotas.

Purchase commitments without attached reservations

You can purchase commitments for vCPUs, memory, or both 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 Attach reservations to resource-based commitments

To purchase commitments for GPUs, Local SSDs disks, or both, see Purchase 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 you purchase a commitment, your commitment becomes active on the following day at 12 AM US and Canadian Pacific Time (UTC-8, or UTC-7 during daylight saving time). Compute Engine maintains a lien on your project for each region in your project where you purchase a commitment. When you purchase a new commitment for any region in your project, Compute Engine associates the lien for that region with the newly created commitment.

Between the time of your commitment purchase and its activation time, the status of your commitment remains as NOT_YET_ACTIVE (or as PENDING on the Google Cloud console). After activation, the status of your commitment changes to ACTIVE. For example, suppose you purchase your commitment on January 20th at 10:00 PM US and Canadian Pacific Time (UTC-8 or UTC-7). Compute Engine creates your commitment immediately with its status as NOT_YET_ACTIVE. However, your commitment becomes ACTIVE only on January 21st at 12:00 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 Cloud Billing account, you can purchase the commitment using any project from that Cloud 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 type resources
    • General-Purpose N2 for N2 machine type resources
    • General-Purpose N2D for N2D machine type resources
    • General-Purpose C3 for C3 machine type resources
    • General-Purpose C3D for C3D machine type resources
    • General-Purpose T2D for Tau T2D machine type resources
    • General-Purpose N1 for N1 machine type resources
    • Compute-optimized C2 for C2 machine type resources
    • Compute-optimized C2D for C2D machine type resources
    • Memory-optimized M1/M2 for M1 and M2 machine type resources
    • Memory-optimized M3 for M3 machine type resources
    • Accelerator-optimized A2 for A2 machine type resources
    • Accelerator-optimized A3 for A3 machine type resources
    • Graphics-optimized G2 for G2 machine type resources
  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 \
    --project PROJECT_ID \
    --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.
  • PROJECT_ID: the project ID of the project for which you want to create the commitment.
  • 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:

    • accelerator-optimized for A2 machine type resources
    • accelerator-optimized-a3 for A3 machine type resources
    • compute-optimized for C2 machine type resources
    • compute-optimized-c2d for C2D machine type resources
    • compute-optimized-c3 for C3 machine type resources
    • compute-optimized-c3d for C3D machine type resources
    • general-purpose for N1 machine type resources
    • general-purpose-e2 for E2 machine type resources
    • general-purpose-n2 for N2 machine type resources
    • general-purpose-n2d for N2D machine type resources
    • general-purpose-t2d for Tau T2D machine type resources
    • graphics-optimized for G2 machine type resources
    • memory-optimized for M1 or M2 machine type resources
    • memory-optimized-m3 for M3 machine type resources

      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 \
      --project=myproject
    
  • 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 --project=myproject
    
  • 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 \
      --project=myproject
    
  • To create an accelerator-optimized commitment, you must purchase your commitment with a supporting attached reservation 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 \
      --project=myproject \
      --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 commitment for GPUs, Local SSD disks, or both, you must purchase your commitment with an attached reservation 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 \
      --project=myproject \
      --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
      
    

REST

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/re