Resource-based committed use discounts Stay organized with collections Save and categorize content based on your preferences.
This document provides information about resource-based commitments, includinghow to purchase these commitments and how the resulting CUDs apply.
To learn about spend-based CUDs for Compute Engine, seeCompute flexible CUDs.
Resource-based commitments are ideal for predictable and steady state usage.Compute Engine lets you purchase the following categories ofresource-based commitments:
- Hardware commitments: You can purchase hardware commitments for aspecificmachine series andcommit to resources available for that machine series, such as vCPUs, memory,GPUs, Local SSD disks, and sole tenant nodes. For more information, seePurchase commitments without attached reservationsandPurchase commitments with attached reservations.
- Software license commitments: You can purchase license commitmentsfor applicable premium operating system (OS) licenses. For moreinformation, seePurchase commitments for licenses.
Commitments for hardware resources are separate from commitments for licenses.You can purchase both categories of commitments for a VM instance, but youcannot purchase a single commitment that covers both hardware resources andlicenses.
Before you begin
- If you haven't already, set upauthentication. Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:
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
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.- 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. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
About resource-based commitments
When you purchase a resource-based commitment, you commit to purchasing aminimum amount of specific Compute Engine resources—such as vCPUs,memory, GPUs, Local SSD disks, and sole-tenant nodes—for a minimum of oneor three years. In return for your commitment to pay for these resources, youreceive these resources at discounted prices for the duration of yourcommitment's term. The percentage of discount that you receive off on-demandprices is also referred to as the committed use discount rate, or CUD rate.These discounts are as follows:
- vCPUs and memory: you can receive up to 55% discount off on-demandprices for most machine types. For some machine types, you can receive up to70% discount off on-demand prices.
- GPUs: you can receive to 55% discount off on-demand prices for most GPUtypes. For some GPU types, you can receive up to 65% discount off on-demandprices.
- Local SSD disks: you can receive up to 55% discount off on-demand prices.
- OS licenses: you can receive up to 79% discount off on-demand prices.
The exact discount rates and the duration for which you receive thosediscounts depend on the following properties that you specify when you purchaseyour commitment:
- Commitment plan
- Commitment term
- The resource type, which is determined as follows:
- For hardware resources, thecommitment type.
- For software resources, theOS license type.
To compare on-demand and discounted rates of hardware resources,seeVM instances pricing.To compare on-demand and discounted rates of software OS licenses, seeDisk and image pricing.
Commitment lifecycle
You purchase a commitment by specifying the following properties, at a minimum:
- Types and numbers of resources that you agree to pay for
- Region where you agree to use the committed resources
- The minimum time period for which you agree to pay for the resources
After you complete the purchase, you must wait until your commitment becomesactive before you can start receiving CUDs. Your commitment becomes active at12:00 AM US and Canadian Pacific Time the day after the purchase.Depending on daylight saving time, this time is equivalent to UTC-8(Pacific Standard Time), or UTC-7 (Pacific Daylight Time). For example,suppose you purchase your commitment at 3:45 PM US and Canadian Pacific Time(UTC-8) on December 1, 2024. In this scenario, your commitment becomes activeat 12:00 AM US and Canadian Pacific Time (UTC-8) on December 2, 2024.
Important: Resource-based commitments are subject to Google Cloudcommitment-based pricing and billing.By purchasing a commitment, you agree to these terms. After you purchase acommitment, you can't cancel or delete it. The commitment remains active untilits specified end date. For more information, seeCancel a commitment.Compute Enginemaintains a lien on your project for each region in yourproject where you purchase a commitment. When you purchasea new commitment for any region in your project,Compute Engine associates the lien for that region withthe newly created commitment.
After your commitment becomes active, you start paying the discounted pricesof your committed resources. You continue to pay these prices on an hourly basisuntil your commitment's end date, regardless of whether or not you usethose resources. As you use Compute Engine resources,Google Cloud utilizes your commitment on an hourly basis to cover thecosts of any eligible resource usage. Google Cloud continues to utilizeyour commitment either until the commitment expires or gets fully utilized.
Commitment plan
When you purchase a commitment, you choose between a1-year or3-year plan. The plan functions as the commitment tier;it determines both the minimum period for which you must commit topaying for resources, and the CUD rate that you receive.A 3-year plan typically offers a higher CUD rate than a 1-year plan.Commitments are often referred to by their plan—for example, as1-year commitments or3-year commitments.
Commitment term
A commitment's term is the specific period during which the commitment isactive. The duration of this term must be at least as long as the period definedby the commitment's plan (1 or 3 years), but can be longer. This durationrepresents the time for which you agree to pay for the committed resources.
By default, your commitment expires at the end of its term. However, you canautomatically renew your commitment for additional terms by enablingauto-renewal.After you enable auto-renewal, at the end of each term, Compute Engineautomatically renews the commitment for a new term. Your commitment continuesto renew for new terms until you manually disable auto-renewal. By default, theduration of each renewed term matches the minimum duration required by thecommitment's plan, either 1 or 3 years.
Difference between term and plan
A commitment'splan (1 year or 3 years) determines the preset time durationand the CUD rate, whereas itsterm determines how long the commitmentactually remains active. By default, a commitment's plan and term are identical.However, you canextend the termbeyond the preset duration specified by the plan. If you extend the term, thenyour commitment remains active for a custom duration, but retains the CUDrate associated with its plan. You can extend commitment terms as follows:
- Commitments with a 1-year plan can have term durations starting from 1 yearand less than 3 years.
- Commitments with a 3-year plan can have term durations starting from 3years and less than 6 years.
To summarize, your commitment's term and plan function as follows:
- You get to use the committed resourcesat discounted prices as determined by your plan.
- You must pay these discounted pricesfor the entire duration of your commitment's term, regardless ofwhether or not you use them.
Start and end times of a commitment
A commitment's term represents the active lifecycle of a commitment and eachterm has a start time and an end time. Terms always start and end at 12:00 AMUS and Canadian Pacific Time on their respective start and end dates. Dependingon daylight saving time, this time is equivalent to UTC-8(Pacific Standard Time), or UTC-7 (Pacific Daylight Time).
The start time of a commitment's term can be one of the following, depending onwhether it is a new or an existing commitment:
Fornew commitments, the start time is the same as the activation time,which is 12:00 AM US and Canadian Pacific Time on the day following yourpurchase.
For example, suppose you purchase your commitment at 3:45 PM US and CanadianPacific Time on January 1, 2025. In this scenario, your commitment startsat 12:00 AM US and Canadian Pacific Time on January 2, 2025.
Foran existing commitment that has auto-renewal enabled, the starttime of the new term is the same as the end time of the previous term:12:00 AM US and Canadian Pacific Time.
For example, suppose the end time of your commitment's ongoing term is12:00 AM US and Canadian Pacific Time on January 1, 2026. If auto-renewal isenabled, then a new term automatically begins at 12:00 AM US and CanadianPacific Time on January 1, 2026.
The end time of a commitment's term can be one of the following, depending onyour commitment's configuration:
Default: When you don't extend a commitment's term or enableauto-renewal, the default end time for that term is at 12:00 AM US andCanadian Pacific Time, exactly one or three years after the start time,depending on whether you chose a 1-year or 3-year commitment plan.
For example, suppose your commitment starts at 12:00 AM US and CanadianPacific Time on January 1, 2025.
- With a 1-year plan, the default end time is 12:00 AM US and CanadianPacific Time on January 1, 2026.
- With a 3-year plan, the default end time is 12:00 AM US and CanadianPacific Time on January 1, 2028.
Auto-renewal: If you enable auto-renewal, then the commitmentautomatically renews for additional terms. Each renewed term has a durationequal to the commitment's plan (1 or 3 years), and the end time of eachsubsequent term is at 12:00 AM US and Canadian Pacific Time, one or threeyears after the start time of that renewed term.
For example, suppose your 1-year commitment starts at 12:00 AM US andCanadian Pacific Time on January 1, 2025. With auto-renewal enabled, thecommitment has its subsequent term ending at 12:00 AM US and CanadianPacific Time on January 1 of each subsequent year.
Extended term: If youextend the term,the end time is at 12:00 AM US and Canadian Pacific Time on the custom enddate you specify. This custom end date must be within the allowed rangefor your commitment's plan (for example, less than 3 years for a 1-yearplan, or less than 6 years for a 3-year plan).
For example, you could extend a commitment with a 1-year plan to end 2 yearsafter its start date, at 12:00 AM US and Canadian Pacific Time on that date.
Commitment status
Depending on the stage of the commitment's lifecycle, your commitment can haveone of the following statuses:
CREATING: the commitment is being created.NOT_YET_ACTIVEorPENDING: the commitment has been created but is not yetactive. Compute Engine creates your commitments with this status.- If you're using the Google Cloud CLI or the REST API to purchase yourcommitment, then this status value shows as
NOT_YET_ACTIVE. - If you're using the Google Cloud console to purchase your commitment, thenthis status value shows as
PENDING.
- If you're using the Google Cloud CLI or the REST API to purchase yourcommitment, then this status value shows as
ACTIVE: the commitment is active.EXPIRED: the commitment has expired. Compute Engine reserves theright to remove expired commitments that are older than 210 days from theexpiration date.CANCELED: Compute Engine canceled the commitment. Compute Enginechanges the status of your commitments toCANCELEDwhen you combine themto create a newmerged commitment.
Between the time of your commitment purchase and its activation time, thestatus of your commitment remains asNOT_YET_ACTIVE (or asPENDING on theGoogle Cloud console). After activation, the status of your commitment changes toACTIVE.For example, suppose you purchase your commitment on January 20, 2024, at 10:00 PMUS and Canadian Pacific Time (UTC-8 or UTC-7). Compute Engine creates yourcommitment immediately with its status asNOT_YET_ACTIVE. Yourcommitment becomesACTIVE on January 21, 2024, at 12:00 AM USand Canadian Pacific Time (UTC-8 or UTC-7).
When the commitment reaches its end date and expires, the status changes fromACTIVE toEXPIRED. Suppose the commitment from the preceding example (whichbecomes active on January 21, 2024) has a 1-year term and you don't enableauto-renewal. Then, on January 21, 2025, at 12:00 AM US and Canadian PacificTime (UTC-8 or UTC-7), the commitment expires and its status changes toEXPIRED.
Pricing
You're billed monthly for your commitment and must pay your monthly commitmentfee even if you don't use all of your committed resources. Your commitment feeis the sum of the discounted prices of all your committed resources.Compute Engine calculates the discounted price of each resource byusing its prevailing on-demand price on the day your commitment becomes active.Your monthly commitment fee and the discounted prices for your resources staythe same until the end of your commitment term, even if the on-demand priceschange.
If you use your commitments to run custom machine types, thenCompute Engine charges a 5% premium over the commitment prices.Compute Engine charges this premium for the portion and duration of yourcommitment that you run these custom machine type VMs.
Note: If you merge or split your commitments, then the discounted prices foryour committed resources might change on the day your merged or splitcommitments become active.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, seeVM instance pricing.
If you move the project for which you purchased commitments to a differentCloud Billing account, then you continue to receive committed usediscounts for that project under the new Cloud Billing account.Learn about changing the Cloud Billing account for a project.
Limitations
The following restrictions apply to resource-based CUDs.
General Limitations
- Projects that are in the free tier period with free tier credit and projectsthat don't have any payment history don't qualify for committed usediscounts.
- You can purchase commitments only on a per-region basis.
- Resource-based CUDs don't apply topreemptible VM instances,N1 shared-core machine types,orextended memory.
- If you use your Compute Enginereservations withGoogle Cloud Serverless for Apache Spark, then those reserved resources aren't eligiblefor resource-based CUDs.
- If you use your reservations with Dataflow, then you canreceive resource-based CUDs only for usage fromspecifically targeted reservationsthat specify accelerators (GPUs or TPUs).
- For machine types that supportper VM Tier_1 networking performance,the higher bandwidth SKUs are excluded from CUDs.
f1-microandg1-smallshared-core machines are not eligible for CUDs.You can't change the project for which you purchase a commitment. However,you can share CUDs from a commitment across other projects byenabling CUD sharing.
If you move the project for which you purchased your commitments to adifferent Cloud Billing account, then you continue to receiveapplicable CUDs for that project in the new Cloud Billing account.Learn about changing the Cloud Billing account for projects.
Limitations specific to sharing resource-based CUDs
If you have a shared reservation in a project whereCUD sharing is enabled, and you want usage from the shared projects to beeligible for the shared CUDs, then you must ensure that you share yourreservation only with projects that are linked to the sameCloud Billing account. Otherwise, usage from the shared projectswon't be eligible for the shared CUDs and you might be charged the on-demandrates.
When you enable CUD sharing for a Cloud Billing account, if anyportion of a commitment is unutilized, then the remaining commitmentcharge remains in the project where you purchased that commitment.
Limitations specific to attached reservations
If the commitment specifies any GPUs, Local SSD disks, or both, then theattached reservation (or combination of attached reservations) must specifyexactly the same numbers and types of those resources as the commitment.For more information, seeAttach reservations to resource-based commitments.
Note: This restriction doesn't apply to local Titanium SSD disksfor use with C4A, C4D, H4D, or Z3 instances. You can purchase a commitmentfor these disks without attaching reservations.If a reservation is attached to a commitment, then you can't delete or resizethat reservation.
You can't attach the same reservation to more than one commitment.
Limitations specific to CUDs Recommendations
- CUD recommendations are available only for hardware resource commitments.You don't receive CUD recommendations for OS license commitments.
- You can view CUD recommendations only for vCPU and memory resources from yourusage. CUD recommendations are not available for Local SSD disk or GPU usage.
Hardware commitments
Hardware commitments apply only to the specific region and machine family seriesfor which you purchase. In return, you receive discounts on the aggregate pricesof all the eligible hardware resources for that machine series within thatregion. These hardware resources include vCPUs, memory, GPUs, and Local SSDdisks.
The commitment that you purchase doesn't affect your VM configurations. YourCUDs apply to the aggregate number of vCPUs, memory, GPUs, and Local SSD disksof a specific machine series within a region. Consequently, the CUDs that youreceive for a commitment are not affected by changes to your VM's machine setup,as long as the resources are covered by that commitment.
When you purchase a commitment for a specific machine series, you are eligiblefor CUDs on all VM machine types regardless of the VM size or tenancy model,including all predefined and custom machine types and sole-tenant nodes.For more information about the eligible resource types for each machine series,seeHardware commitment types.
Efficient usage of your commitments
If you have just a few projects, you can purchase commitments just forthe 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 discountsfor 8 cores. The other 16 cores will be billed at standard, non-committed userates. Keep in mind that after you purchase a set amount of commitments, you'rebilled for those commitments monthly, even if you don't use them.For example, if you purchase commitments for 8 cores, you're billed thecommitted use rates for those 8 cores for the whole month, even if you mighthave only run these cores for a part of the month. It is to your advantage topurchase commitments only in increments you know you will use.
Commitments can't be stacked for burst scenarios. For example, if you purchased10 cores for a month and then ran 20 cores for half the month, your commitmentswon't apply for the full 20 cores just because their usage was across only halfthe month.
Usage overage
Any hourly resource usage that is not covered by your commitments ischarged based on the on-demand rates and might be eligible for applicablesustained use discounts (SUDs).For example, consider a commitment for 2 vCPUs and 8 GB memory that belongto the N2 machine series. Suppose that you use this commitment to purchaseand run ann2-standard-2 (2 vCPUs and 8 GB memory) VM for a portion ofthe month and then run ann2-standard-8 (8 vCPUs and 32 GB memory) VMfor the remainder of the same month. In this scenario, Compute Enginecombines the usage across both VMs and automatically applies the applicable SUDsto any resource usage that isn't covered by your commitment.
Combine reservations with commitments
A commitment provides a 1- or 3-year discounted price agreement, but it does notreserve capacity in a specific zone. A reservation makes sure that capacity isheld in a specific zone even if the reserved VMs are not running. To get zonalresources at discounted prices and also makes sure that capacity is reservedfor them, you must both purchase commitments and create reservations for thosezonal resources.
You can also attach reservations to your resource-based commitments at the timethat you purchase your commitment. By attaching reservations to your commitments,you link the two entities together. This linkage helps you better identify andtrack which committed resources also have capacity reserved.
Attaching a reservation to your commitment is mandatory for some resource types.When you purchase commitments for GPUs, you must reserve those GPUs andattach those reservations to your commitment. This requirement also applies toLocal SSD disks for use with most machine series. If you're committing topurchase local Titanium SSD disks for use with C4A, C4D, H4D, or Z3instances, then you don't need attached reservations for those disks.
For more information about attaching reservations to your commitments, seeCombine reservations with committed use discounts.
Commitment types for hardware commitments
When you purchase a commitment, you must choose thecommitment type thatapplies to your intended resource usage. The commitment type of the commitmentdetermines the machine series—or in some cases, a specific collection ofmachine types—that is covered by your commitment. When you use instancesbelonging to these machine series or machine types, Google Cloud coversthe eligible portions of that usage through your commitment. Most machine seriesuse one specific commitment type for all machine types in that series. Thefollowing machine series are exceptions; they don't have a single commitmenttype for the entire series:
Accelerator-optimized A3: This machine series has multiple commitmenttypes:
- A3 Edge and A3 High machine type resources are covered by a singlecommitment type.
- A3 Mega machine type resources are covered by a separate commitment type.
A3 Ultra machine type resources are covered by a separate commitment type.
Note: To purchase commitments for A3 Ultra machine types, you must usethefuture reservations in AI Hypercomputer consumption option.For more information, seeReserve capacity through your account teamin the AI Hypercomputer documentation.
Memory-optimized M1 and memory-optimized M2: These machine series have asingle, combined commitment type that covers all M1 and M2 machine types.
Memory-optimized M4: This machine series has two commitment types:
- One commitment type specifically covers M4 machine types that come with6 TB of memory.
- All other M4 machine types are covered by a separate commitment type.
Memory-optimized X4: This machine series has a different commitment typefor each machine type:
- The X4 machine type with 6 TB of memory (
x4-480-6t-metal) - The X4 machine type with 8 TB of memory (
x4-480-8t-metal) - The X4 machine type with 12 TB of memory (
x4-960-12t-metal) - The X4 machine type with 16 TB of memory (
x4-megamem-960-metal) - The X4 machine type with 24 TB of memory (
x4-megamem-1440-metal) - The X4 machine type with 32 TB of memory (
x4-megamem-1920-metal)
- The X4 machine type with 6 TB of memory (
The specific value for each commitment type varies depending on whether you usethe gcloud CLI, REST, or the Google Cloud console topurchase a commitment. For the exact values to use when purchasing, see therelevant instructions in thePurchase commitments without attached reservationsorPurchase commitments with attached reservationssections.
Caution: For C3 and C3D commitment types, the machine family that is specified by the commitment type changes depending on the interface:- In the gcloud CLI and REST, the commitment type values useCompute-optimized as the machine family, even though C3 and C3D are part of the general-purpose machine family.
- In the Google Cloud console, the commitment type values use the correct machine series:General-Purpose.
The following table lists all the machine series for which you can purchaseresource-based commitments, along with their corresponding commitment types.For each commitment type, the table also lists the eligible machine types andresource types that are eligible for CUDs. For every listed machine type, theapplicability includes sole-tenant node types, if sole-tenancy issupported by the machine series.
| Commitment type | Eligible resources | Applicable machine types |
|---|---|---|
| General-purpose E2 |
| All E2 machine types |
| General-purpose N2 |
| All N2 machine types |
| General-purpose N2D |
| All N2D machine types |
| General-purpose N4 |
| All N4 machine types |
| General-purpose N4D |
| All N4D machine types |
| General-purpose N4A |
| All N4A machine types |
| General-purpose C3 |
| All C3 machine types |
| General-purpose C3D |
| All C3D machine types |
| General-purpose C4 |
| All C4 machine types |
| General-purpose C4A |
| All C4A machine types |
| General-purpose C4D |
| All C4D machine types |
| General-purpose Tau T2D |
| Standard Tau T2D machine types |
| General-purpose N1 |
|
|
| Storage-optimized Z3 |
| All Z3 machine types |
| Compute-optimized H4D |
|
|
| Compute-optimized H3 |
| All H3 machine types |
| Compute-optimized C2 |
|
|
| Compute-optimized C2D |
| All C2D machine types |
| Memory-optimized M1/M2 |
|
|
| Memory-optimized M3 |
| All M3 machine types |
| Memory-optimized M4 6TB |
| m4-ultramem-224 (the M4 machine type with 6 TB of memory) |
| Memory-optimized M4 |
| All other M4 machine types |
| Memory-optimized X4 6TB |
| X4 machine type with 6 TB of memory |
| Memory-optimized X4 8TB |
| X4 machine type with 8 TB of memory |
| Memory-optimized X4 12TB |
| X4 machine type with 12 TB of memory |
| Memory-optimized X4 16TB |
| X4 machine type with 16 TB of memory |
| Memory-optimized X4 24TB |
| X4 machine type with 24 TB of memory |
| Memory-optimized X4 32TB |
| X4 machine type with 32 TB of memory |
| Accelerator-optimized A2 |
|
|
| Accelerator-optimized A3 |
|
|
| Accelerator-optimized A3 Mega |
|
|
| Accelerator-optimized A3 Ultra (Available only with AI Hypercomputer) |
|
|
| Accelerator-optimized A4 (Available only with AI Hypercomputer) |
|
|
| Accelerator-optimized A4X (Available only with AI Hypercomputer) |
|
|
| Graphics-optimized G2 |
|
|
| Graphics-optimized G4 |
|
|
You can't purchase commitments forf1-micro, org1-small machine types orfor the sole-tenant premium charge.
Commitments for Compute Engine machine types
Google Cloud offers resource-based commitments for hardware resources ofseveral Compute Engine machine family series. Purchase the appropriatecommitment type for the machine types you plan to use.
General-purpose machine types
CUDs for general-purpose machine types are applied to resources in thefollowing order:
- N4, N2, N2D, E2, or N1 custom machine types, depending on the commitmentthat you purchase
- Sole-tenant nodes
- E2, N2, N2D, N4, N4D,N4A,C4, C4A, C4D, C3, C3D, Tau T2D, or N1 predefined machine types, dependingon which commitment that you purchase.
When you purchase commitments for general-purpose machine types, you pick whichmachine series the commitment applies to. For example, if you purchasegeneral-purpose E2 commitments, they apply to only E2 machine types. Similarly,if you purchase general-purpose N2, N2D, N4, N4D, N4A, C4, C4A, C4D, 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-4predefined machine types
You purchase N2 commitments for 15 vCPUs and 13.5 GB of memory for committeduse. The CUDs would be applied first to the N2 custom machinetypes, and any remaining discounts would be applied to the N2 predefined machinetypes. In this case, all 10 vCPUs of the N2 custom machine types would becharged at committed use prices, and 13.5 GB of custom machine type memory wouldbe charged at committed use prices.
Finally, the remaining 5 vCPUs of committed use would apply to 5 random vCPUsacross the twon2-standard-4 machine types. Any resource usage that isn'tcovered by your commitments might qualify for applicable SUDs.
Additionally, if you use your commitments to run custom machine types, thenCompute Engine charges a 5% premium over the commitment prices.Compute Engine charges this premium for the portion and duration of yourcommitment that you run these custom machine type VMs.
Commitments are aggregated by machine series. If you are unsure of howmany commitments to purchase, you might want to purchase a smaller number ofcommitments, then add more as you need them. For example, you can purchasemultiple contracts for 10 vCPUs and zero memory, then purchase separatecontracts for additional memory.
To purchase a commitment for general-purpose machine types, seePurchase commitments without attached reservationsandPurchase commitments with attached reservations.
Memory-optimized machine types
The commitment type for memory-optimized machine type resources varies depending on the machine type.There is a unique commitment type for each of the following groups of machinetypes:
- For all M1 and M2 machine types
- For allM3 machine types
- For M4 machine types with 6 TB of memory
- Forall other M4 machine types
ForX4 machine types,there is a unique commitment type for each of the available memory options:
- 6 TB of memory
- 8 TB of memory
- 12 TB of memory
- 16 TB of memory
- 24 TB of memory
- 32 TB of memory
You must purchase the commitment type that matches the machine series and typeof your instance.
The Memory Optimized Upgrade Premium Core and RAM SKUs, which are specific toM2 machine types, are not eligible for CUDs. The prices for these SKUs areincorporated into the price rates that are documented on theVM instance pricing page andin thepricing calculator.
If you intend to use memory-optimized machine types, purchase memory-optimizedcommitments. To purchase a commitment for memory-optimized machine types,seePurchase commitments without attached reservations.
Storage-optimized machine types
To purchase commitments for storage-optimized Z3 machine types, seePurchase commitments without attached reservationsandPurchase commitments with attached reservations.
Compute-optimized machine types
To purchase commitments for compute-optimized machine types, see one of thefollowing:
- For C2 and C2D compute-optimized machine types, seePurchase commitments without attached reservations.
- For H3 and H4D compute-optimized machine types, seePurchase commitments with attached reservations.
Accelerator-optimized machine types
Accelerator-optimized VMs have a specific model and number of NVIDIA GPUsattached. When you purchase commitments for these machine types, you must alsoreserve your committed GPUs and attach those reservations to your commitments.
To purchase a commitment for these machine types, see the following:
- For A3 Mega, A3 High, A3 Edge, A2, G4, or G2 machine types, seePurchase commitments with attached reservations.
- For A4X, A4, or A3 Ultra machine types, you must use thefuture reservationsin AI Hypercomputer consumption option. For more information, seeReserve capacity through your account teamin the AI Hypercomputer documentation.
Commitments for GPUs and Local SSD disk resources
When you purchase commitments for GPUs, you can only specify one GPU type forany given commitment. Consequently, that commitment covers usage only for thespecified GPU type. If you want to receive CUDs for using multiple GPU types,then you must purchase separate commitments for each GPU type.For example, suppose that you use both NVIDIA V100 GPUs and NVIDIA P100 GPUs.If you only have a commitment for NVIDIA P100 GPUs, then that commitment can'tcover your usage from NVIDIA V100 GPUs. To receive CUDs for both NVIDIA P100 GPUusage and NVIDIA V100 GPU usage, you must purchase separate commitments foreach GPU type.
Additionally, to purchase commitments for GPUs, Local SSD disks, or both youmust reserve the resources and attach the reservations to your commitment.Reserving these resources is required to make sure that the resources are alwaysavailable for you (whether you use them or not). There are no additional chargesfor reserving the resources.
Note: If you're committing to purchasing any local Titanium SSD disksfor use with C4A, C4D, H4D, or Z3 instances, then you don't need attachedreservations for those disks.To learn how to purchase commitments for GPUs, see one of the following:
For use with A4X, A4, or A3 Ultra machine types, you must use thefuture reservations in AI Hypercomputer consumption option. Formore information, seeReserve capacity through your account teamin the AI Hypercomputer documentation.
For use with all other machine types, seePurchase commitments with attached reservationsin this document.
To learn how to purchase commitments for Local SSD disks, seePurchase commitments with attached reservationsin this document.
To learn more about commitments with attached reservations, seeAttach reservations to resource-based commitments.
Quotas for commitments and committed resources
You can only purchase resource-based commitments for resources in a specificregion 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 commitmentsand for those specific committed SKUs in the region where you want to purchasethe commitment. There is no quota on memory, so you don't need to have separatequota for committed memory to purchase a commitments for memory.
For example, to purchase 5 commitments that cover 32 vCPUs of general-purposeN1 machine type, 16 GB memory, 4 NVIDIA P4 GPUs, and 2 Local SSD disks inus-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 commitmentquota for each type of committed resource. These quota limits determine thenumber of commitments you can purchase and the amount of resources you cancommit to.To learn how to view the current quota limits and quota usage values for yourcommitments and committed resources, seeView quotas in the Google Cloud console.
If you consistently pay for a very high amount of committed vCPUs for yourprojects across different regions, then you might be eligible for unlimitedquota on your committed vCPUs for all machine types (except formemory-optimized machine types) in all regions.
If you use up all your commitment quota, you won't be able to purchase newcommitments. Likewise, if you exhaust your committed resource quota, then youwon't be able to purchase a new commitment for that resource even if you havecommitment quota available.For example, if you used up all of your commitment quota, then the serverreturns 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 committedresources, you can always request for a quota increase from theQuotas page.You can request for quota increases at any time. To learn how to submit arequest to increase quota limits for your resources, seeRequest a quota adjustment.
For example, consider a scenario where you purchased two commitments for atotal of fourNVIDIA V100 GPUs inus-central1 and met your quota limits.region. Suppose you want to purchase two new commitments for twoNVIDIA V100 GPUs each, in the same region, you must do the following:
- Submit a new quota request to increase your
Committed NVIDIA V100 GPUsquota inus-central1to the new maximum number (eight) that you want. Submit a new quota request to increase your
Commitmentsquota inus-central1to match the new maximum number (four) that you want.Wait for your requests to be approved and closed. After your requests areapproved, your commitment and committed GPU quotas in
us-central1increase to match your new needs. You can then purchase your newcommitments.
If you place a request for an increase in quota limit for a resourcethat already has unlimited quota by default, then the quota value for thatresource remains unlimited and you are notified that your requested limit isbelow the approved limit.
Set a cap for quota limits
You can set a cap on the quota value for your committed resources bycreating a quota override.For resources that have unlimited quota by default, the quota overridedecreases the quota value. To remove the quota override for the resource andreturn to unlimited quota values by default, you mustreset the quota value.
To learn more about how to manage quotas for your resources, seeView and manage quotas.
Purchase commitments without attached reservations
You can purchase commitments for vCPUs, memory, or both without attaching anyreservations for those resources. You can purchase these commitments using theGoogle Cloud console, the gcloud CLI, or the API.
To learn more about commitments with attached reservations, seeAttach reservations to resource-based commitments
To purchase commitments for GPUs, Local SSDs disks, or both, seePurchase commitments with attached reservations.
By default, project owners have permission to purchase committed use discountcontracts. However, it's possible for owners to create custom roles thatinclude or exclude certain users. Read aboutaccess control to make sure you have permission topurchase a committed use discount contract.
After you purchase a commitment, your commitment becomes active on thefollowing day at 12 AM US and Canadian Pacific Time (UTC-8, or UTC-7 duringdaylight saving time).Compute Enginemaintains a lien on your project for each region in yourproject where you purchase a commitment. When you purchasea new commitment for any region in your project,Compute Engine associates the lien for that region withthe newly created commitment.
Between the time of your commitment purchase and its activation time, thestatus of your commitment remains asNOT_YET_ACTIVE (or asPENDING on theGoogle Cloud console). After activation, the status of your commitment changes toACTIVE.For example, suppose you purchase your commitment on January 20, 2024, at 10:00 PMUS and Canadian Pacific Time (UTC-8 or UTC-7). Compute Engine creates yourcommitment immediately with its status asNOT_YET_ACTIVE. Yourcommitment becomesACTIVE on January 21, 2024, at 12:00 AM USand Canadian Pacific Time (UTC-8 or UTC-7).
The discounts are automatically applied to applicableinstances in the region you specified, and to the projects in which thosediscounts are purchased.
Important: After you purchase a commitment, you can't cancel it. If you changethe Cloud Billing account for the project associated with thecommitment, the scope of yourattribution and discount sharing settingschanges to projects in the new Cloud Billing account. If you haddiscount sharing enabled in the old Cloud Billing account, the projectsin the old Cloud Billing account are no longer in the scope of thediscount sharing settings.Permissions required for this task
To perform this task, you must have the followingpermissions:
compute.commitments.createto create a commitment for a VM.compute.commitments.listto view a list of commitments on a project.
Console
Before you purchase a commitment using the Google Cloud console,select the project that you want to use to purchase the commitment. IfCUD sharingis enabled for a Cloud Billing account, you canpurchase the commitment using any project from that Cloud Billingaccount. After you select the project, do the following:
In the Google Cloud console, go to theCommitted use discountspage.
To purchase a commitment, clickPurchase commitment. ThePurchase a committed use discount pageopens and displays theHardware tab.
In theName field, enter a name for your commitment.
In theRegion field, select the region where you want to commit toCompute Engine resources.
In theCommitment type field, select the machine family series foryour committed resources. For vCPUs, memory, or both, you can choosefrom the following commitment types:
- For A2 machine types, selectAccelerator-optimized A2
- For A3 Edge and A3 High machine types, selectAccelerator-optimized A3
- For A3 Mega machine types, selectAccelerator-optimized A3 MegaNote: For A4X, A4, or A3 Ultra machine types, you must purchase your commitments by using thefuture reservations in AI Hypercomputer consumption option. For more information, see Reserve capacity through your account team.
- For G2 machine types, selectGraphics-optimized G2
- For G4 machine types, selectGraphics-optimized G4
- For C2 machine types, selectCompute-optimized C2
- For C2D machine types, selectCompute-optimized C2D
- For H3 machine types, selectCompute-optimized H3
- For H4D machine types, selectCompute-optimized H4D
- For C3 machine types, selectGeneral-Purpose C3
- For C3D machine types, selectGeneral-Purpose C3DCaution: For C3 and C3D commitment types, the machine family that is specified by the commitment type changes depending on the interface:
- In the gcloud CLI and REST, the commitment type values useCompute-optimized as the machine family, even though C3 and C3D are part of the general-purpose machine family.
- In the Google Cloud console, the commitment type values use the correct machine series:General-Purpose.
- For C4 machine types, selectGeneral-Purpose C4
- For C4A machine types, selectGeneral-Purpose C4A
- For C4D machine types, selectGeneral-Purpose C4D
- For E2 machine types, selectGeneral-Purpose E2
- For N1 machine types, selectGeneral-Purpose N1
- For N2 machine types, selectGeneral-Purpose N2
- For N2D machine types, selectGeneral-Purpose N2D
- For N4 machine types, selectGeneral-Purpose N4
- For N4D machine types, selectGeneral-Purpose N4D
- For N4A machine types, selectGeneral-Purpose N4A
- For Tau T2D machine types, selectGeneral-Purpose T2D
- For M1 or M2 machine types, selectMemory-optimized M1/M2
- For M3 machine types, selectMemory-optimized M3
- For M4 machine types, selectMemory-optimized M4
- For M4 machine types with 6 TB of memory, selectMemory-optimized M4 6TB
- For the X4 machine type with 6 TB of memory, selectMemory-optimized X4 480 6T
- For the X4 machine type with 8 TB of memory, selectMemory-optimized X4 480 8T
- For the X4 machine type with 12 TB of memory, selectMemory-optimized X4 960 12T
- For the X4 machine type with 16 TB of memory, selectMemory-optimized X4 960 16T
- For the X4 machine type with 24 TB of memory, selectMemory-optimized X4 1440 24T
- For the X4 machine type with 32 TB of memory, selectMemory-optimized X4 1920 32T
- For Z3 machine types, selectStorage-optimized Z3
In theDuration section, do the following:
- To specify your commitment's plan, select either1 year or3 years. The plan determines the CUD rate and preset termduration of your commitment.
- Optional. To specify a custom term duration for your commitment,click theExtend end date toggle and then, in theDate field,specify the custom end date that you want. For more information,seeExtend commitment terms.
In theCores field, enter the number of vCPUs that youwant to commit to purchasing.
In theMemory field, enter the amount, in GB, of memorythat you want to commit to purchasing.
You can specify memory only in increments of 0.25 GB. To specify acustom memory value for your commitment, use gcloud CLIor REST instead.
To finish purchasing your commitment, do the following:
- ClickPurchase.
- In thePurchase a committed use discount dialog, if you agreewith theservice specific terms, clickPurchase again.
gcloud
Using the gcloud CLI, run thegcloud compute commitments create command:
gcloud compute commitments createCOMMITMENT_NAME \ --regionREGION \ --projectPROJECT_ID \ --resources vcpu=NUMBER_VCPUS,memory=MEMORY \ --planPLAN \ --typeCOMMITMENT_TYPE
Replace the following:
COMMITMENT_NAME: the name you want to identifythis commitment with.REGION: the region this commitment applies to.Each region has different commitment prices. For current prices, see theprice sheet.PROJECT_ID: the project ID of the project forwhich you want to create the commitment.NUMBER_VCPUS: the number of vCPUs you arewilling to purchase commitments for. The number of vCPUs must be aninteger of 0 or more and can be even or odd.MEMORY: the amount, in MB or GB, of memory youare willing to purchase commitments for. For example,1000MB. If theunits are not specified, the default unit used is GB.PLAN: the commitment plan, whichdetermines your CUD rate and preset term. Specify12-monthor36-month.COMMITMENT_TYPE: one of:- For A2 machine types, use
accelerator-optimized - For A3 Edge and A3 High machine types, use
accelerator-optimized-a3 - For A3 Mega machine types, use
accelerator-optimized-a3-megaNote: For A4X, A4, or A3 Ultra machine types, you must purchase your commitments by using thefuture reservations in AI Hypercomputer consumption option. For more information, see Reserve capacity through your account team. - For G2 machine types, use
graphics-optimized - For G4 machine types, use
graphics-optimized-g4 - For C2 machine types, use
compute-optimized - For C2D machine types, use
compute-optimized-c2d - For C3 machine types, use
compute-optimized-c3 - For C3D machine types, use
compute-optimized-c3dCaution: For C3 and C3D commitment types, the machine family that is specified by the commitment type changes depending on the interface:- In the gcloud CLI and REST, the commitment type values useCompute-optimized as the machine family, even though C3 and C3D are part of the general-purpose machine family.
- In the Google Cloud console, the commitment type values use the correct machine series:General-Purpose.
- For H3 machine types, use
compute-optimized-h3 - For H4D machine types, use
compute-optimized-h4d - For N1 machine types, use
general-purpose - For C4 machine types, use
general-purpose-c4 - For C4A machine types, use
general-purpose-c4a - For C4D machine types, use
general-purpose-c4d - For E2 machine types, use
general-purpose-e2 - For N2 machine types, use
general-purpose-n2 - For N2D machine types, use
general-purpose-n2d - For N4 machine types, use
general-purpose-n4 - For N4D machine types, use
general-purpose-n4d - For N4A machine types, use
general-purpose-n4a - For Tau T2D machine types, use
general-purpose-t2d - For M1 or M2 machine types, use
memory-optimized - For M3 machine types, use
memory-optimized-m3 - For M4 machine types, use
memory-optimized-m4 - For M4 machine types with 6 TB of memory, use
memory-optimized-m4-6tb - For X4 machine types with 6 TB of memory, use
memory-optimized-x4-6t - For X4 machine types with 8 TB of memory, use
memory-optimized-x4-8t - For X4 machine types with 12 TB of memory, use
memory-optimized-x4-12t - For X4 machine types with 16 TB of memory, use
memory-optimized-x4-960-16t - For X4 machine types with 24 TB of memory, use
memory-optimized-x4-1440-24t - For X4 machine types with 32 TB of memory, use
memory-optimized-x4-1920-32t - For Z3 machine types, use
storage-optimized-z3
If you don't specify the
--typeflag, the default value used isgeneral-purpose.- For A2 machine types, use
Examples
To create a general-purpose commitment for N1 machine types, you might usethe 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 createcommand,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 mustpurchase your commitment with a supporting attached reservationby using the
gcloud compute commitments createcommand.You must also specify the total number of resources (including GPUs) thatyou need.When creating GPU commitments, you need to specify the
--acceleratorand--resources-acceleratorflags.The--acceleratorflag specifies the number of GPUs that are attachedto each VM. The--resources-acceleratorflag specifies the totalnumber 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 mustpurchase your commitment with an attached reservationby using the
gcloud compute commitments createcommand.When creating GPU commitments, you need to specify the
--acceleratorand--resources-acceleratorflags.The--acceleratorflag specifies the number of GPUs that are attachedto each VM. The--resources-acceleratorflag specifies the totalnumber of GPUs in the commitment.For example, the following commitment includes 4 GPUs and a reservation forthose 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 aPOST request to theregionCommitments.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_IDrequestIdis an optional query parameter, but we recommend providing it to helpprevent unintended duplicate requests.The resource body should contain the following:
namefor the name of the commitmentplanfor the commitment plan, eitherTWELVE_MONTHorTHIRTY_SIX_MONTHresourcesto specify the amount of memory and vCPU. Memory must bebe specified in MB. You must specify bothVCPUandMEMORYin theresourcessection.typeof commitment, one of the following:- For A2 machine types, use
ACCELERATOR_OPTIMIZED - For A3 Edge and A3 High machine types, use
ACCELERATOR_OPTIMIZED_A3 - For A3 Mega machine types, use
ACCELERATOR_OPTIMIZED_A3_MEGANote: For A4X, A4, or A3 Ultra machine types, you must purchase your commitments by using thefuture reservations in AI Hypercomputer consumption option. For more information, see Reserve capacity through your account team. - For G2 machine types, use
GRAPHICS_OPTIMIZED - For G4 machine types, use
GRAPHICS_OPTIMIZED_G4 - For C2 machine types, use
COMPUTE_OPTIMIZED - For C2D machine types, use
COMPUTE_OPTIMIZED_C2D - For C3 machine types, use
COMPUTE_OPTIMIZED_C3 - For C3D machine types, use
COMPUTE_OPTIMIZED_C3DCaution: For C3 and C3D commitment types, the machine family that is specified by the commitment type changes depending on the interface:- In the gcloud CLI and REST, the commitment type values useCompute-optimized as the machine family, even though C3 and C3D are part of the general-purpose machine family.
- In the Google Cloud console, the commitment type values use the correct machine series:General-Purpose.
- For H3 machine types, use
COMPUTE_OPTIMIZED_H3 - For H4D machine types, use
COMPUTE_OPTIMIZED_H4D - For N1 machine types, use
GENERAL_PURPOSE - For C4 machine types, use
GENERAL_PURPOSE_C4 - For C4A machine types, use
GENERAL_PURPOSE_C4A - For C4D machine types, use
GENERAL_PURPOSE_C4D - For E2 machine types, use
GENERAL_PURPOSE_E2 - For N2 machine types, use
GENERAL_PURPOSE_N2 - For N2D machine types, use
GENERAL_PURPOSE_N2D - For N4 machine types, use
GENERAL_PURPOSE_N4 - For N4D machine types, use
GENERAL_PURPOSE_N4D - For N4A machine types, use
GENERAL_PURPOSE_N4A - For Tau T2D machine types, use
GENERAL_PURPOSE_T2D - For M1 or M2 machine types, use
MEMORY_OPTIMIZED - For M3 machine types, use
MEMORY_OPTIMIZED_M3 - For M4 machine types, use
MEMORY_OPTIMIZED_M4 - For M4 machine types with 6 TB of memory, use
MEMORY_OPTIMIZED_M4_6TB - For X4 machine types with 6 TB of memory, use
MEMORY_OPTIMIZED_X4_480_6T - For X4 machine types with 8 TB of memory, use
MEMORY_OPTIMIZED_X4_480_8T - For X4 machine types with 12 TB of memory, use
MEMORY_OPTIMIZED_X4_960_12T - For X4 machine types with 16 TB of memory, use
MEMORY_OPTIMIZED_X4_960_16T - For X4 machine types with 24 TB of memory, use
MEMORY_OPTIMIZED_X4_1440_24T - For X4 machine types with 32 TB of memory, use
MEMORY_OPTIMIZED_X4_1920_32T - For Z3 machine types, use
STORAGE_OPTIMIZED_Z3
- For A2 machine types, use
For example, the following creates a commitment for 1 year with 5 vCPUsand 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 thetype property. Thefollowing example shows a purchase of a 1 yearcommitment for anm1-megamem-96 machine type:
{"name":"example-memory-optimized-commitment","plan":"TWELVE_MONTH","type":"MEMORY_OPTIMIZED","resources":[{"amount":"96","type":"VCPU"},{"amount":"1434","type":"MEMORY"}]}```Tocreateacompute-optimizedcommitment,includethe`type`property.Thefollowingexample,purchasesa1yearcommitmentfora`c2-standard-16`machinetype:```json{"name":"example-compute-optimized-commitment","plan":"TWELVE_MONTH","type":"COMPUTE_OPTIMIZED","resources":[{"amount":"16","type":"VCPU"},{"amount":"1434","type":"MEMORY"}]}Purchase commitments with attached reservations
When you purchase a new commitment, you can attach reservations toyour commitment in either of the following ways:
- Using existing reservations whose properties match with the commitment
- Creating new matching reservations while purchasing of your commitment
After you purchase a commitment, your commitment becomes active on thefollowing day at 12 AM US and Canadian Pacific Time (UTC-8, or UTC-7 duringdaylight saving time).Between the time of your commitment purchase and its activation time, thestatus of your commitment remains asNOT_YET_ACTIVE (or asPENDING on theGoogle Cloud console). After activation, the status of your commitment changes toACTIVE.For example, suppose you purchase your commitment on January 20, 2024, at 10:00 PMUS and Canadian Pacific Time (UTC-8 or UTC-7). Compute Engine creates yourcommitment immediately with its status asNOT_YET_ACTIVE. Yourcommitment becomesACTIVE on January 21, 2024, at 12:00 AM USand Canadian Pacific Time (UTC-8 or UTC-7).
Requirements
Before you purchase a commitment with attached reservations, review theserequirements and make sure that your commitment and reservations meet thefollowing criteria:
- You must purchase the commitment and create the attached reservations in thesame project and region.
- You must purchase the commitment and create the attached reservations forresources from the same machine family series.
- You must disable theauto-delete optionon the attached reservations.
- If your commitment has GPUs, then the GPU type specified in the reservationand the commitment must match.
For GPUs and Local SSD disks, the number of reserved resources of eachresource type must exactly match with the number of committed resourcesfor that resource type. However, this requirement isn't applicable whenyou're purchasing a commitment for local Titanium SSD disks for usewith C4A, C4D, H4D, or Z3 machine types.
For example, if you want to purchase a commitment for 4 V100 GPUs and 2Local SSD disks, then your commitment's attached reservations must specify atotal of 4 V100 GPUs and 2 Local SSDs. The amount of vCPU and memory thatyou reserve can be more or less than what you commit to. However, if youpurchase a commitment for 4 C4A vCPUs and 2 local Titanium SSD disks,then you don't have to attach any reservations to the commitment.
For GPUs, purchase commitments for the specific GPU types that youintend to use. For example, you can purchase commitments for either NVIDIAP100s or NVIDIA V100s, but you cannot use a commitment that was purchasedfor NVIDIA P100 GPUs to cover NVIDIA V100 GPUs.
If your attached reservation is a shared reservation and you want to receivethe applicable CUDs when you consume that reservation outside yourcommitment's project, then you must do both the following:
- Share your reservations only between projects that belong to the sameCloud Billing account as the commitment.
- Enable CUD sharingfor that Cloud Billing account.
Attach existing reservations
You can attach existing reservations while purchasing your commitment by usingthe Google Cloud console, the Google Cloud CLI, or REST.
Permissions required for this task
To perform this task, you must have the followingpermissions:
- To create a commitment:
compute.commitments.createon the project - To create reservations:
compute.reservations.createon the project
Console
Before you purchase a commitment using the Google Cloud console,select the project that you want to use to purchase the commitment. IfCUD sharingis enabled for a Cloud Billing account, you canpurchase the commitment using any project from that Cloud Billingaccount. After you select the project, do the following:
In the Google Cloud console, go to theCommitted use discountspage.
To purchase a commitment, clickPurchase commitment. ThePurchase a committed use discount pageopens and displays theHardware tab.
In theName field, enter a name for your commitment.
In theRegion field, select the region where you want to commit toCompute Engine resources.
In theCommitment type field, select the machine family series foryour committed resources.The following commitment types provideoptions for GPUs, Local SSD disks, or both:
- For A2 machine types, selectAccelerator-optimized A2
- For A3 Edge and A3 High machine types, selectAccelerator-optimized A3
- For A3 Mega machine types, selectAccelerator-optimized A3 MegaNote: For A4X, A4, or A3 Ultra machine types, you must purchase your commitments by using thefuture reservations in AI Hypercomputer consumption option. For more information, see Reserve capacity through your account team.
- For G2 machine types, selectGraphics-optimized G2
- For G4 machine types, selectGraphics-optimized G4
- For C2 machine types, selectCompute-optimized C2
- For C2D machine types, selectCompute-optimized C2D
- For C3 machine types, selectGeneral-Purpose C3
- For C3D machine types, selectGeneral-Purpose C3DCaution: For C3 and C3D commitment types, the machine family that is specified by the commitment type changes depending on the interface:
- In the gcloud CLI and REST, the commitment type values useCompute-optimized as the machine family, even though C3 and C3D are part of the general-purpose machine family.
- In the Google Cloud console, the commitment type values use the correct machine series:General-Purpose.
- For C4 machine types, selectGeneral-Purpose C4
- For C4A machine types, selectGeneral-Purpose C4A
- For C4D machine types, selectGeneral-Purpose C4D
- For N1 machine types, selectGeneral-Purpose N1
- For N2 machine types, selectGeneral-Purpose N2
- For N2D machine types, selectGeneral-Purpose N2D
- For M1 machine types, selectMemory-optimized M1/M2
- For M3 machine types, selectMemory-optimized M3
- For Z3 machine types, selectStorage-optimized Z3
ForDuration, do the following:
- To specify your commitment's plan, select either1 year or3 years. The plan determines the CUD rate and the preset termduration of your commitment.
- Optional. To specify a custom term duration for your commitment,click theExtend end date toggle and then, in theDate field,specify a custom end date. For more information,seeExtend commitment terms.
In theCores field, enter the number of vCPUs that youwant to commit to purchasing.
In theMemory field, enter the amount, in GB, of memorythat you want to commit to purchasing.
You can specify memory only in increments of 0.25 GB. To specify acustom memory value for your commitment, use gcloud CLIor REST instead.
To commit to GPUs, in theGPUs section, clickAdd GPU and then do the following:
- In theGPU type field, select the type of GPU.
- In theNumber of GPUs field, enter the number of GPUs.
- Optional: If your GPU model supportsNVIDIA RTX Virtual Workstations (vWS) for graphics workloads,and you plan to run graphics-intensive workloads, select theEnable Virtual Workstation (NVIDIA GRID) checkbox.
To commit to Local SSD disks, in theLocal SSDs section, clickAdd SSD and then, in theNumber of SSDs field, specify thenumber of disks.
Note: If you're committing to purchasing any local Titanium SSDdisks for use with C4A, C4D, H4D, or Z3 machine types, thenyou don't need to create and attach reservations forthose disks.To attach one or more existing reservations to the commitment,in theReservations field, selectAttach existing reservations.
The Google Cloud console displays a list of all the reservations inyour project whose region, machine type, and GPU type match with thecommitment. Then, do the following:
- Optional. To view reservations with specific properties, in theFilter menu, add or remove filters for the properties thatyou want.
- Select all the reservations that you want to attach to thecommitment.
To finish purchasing your commitment with the attached reservations,do the following:
- ClickPurchase.
- In thePurchase a committed use discount dialog, if you agreewith theservice specific terms,clickPurchase again.
gcloud
To purchase a commitment by attaching existing reservations, run thegcloud compute commitments create command.In your command, include the--existing-reservation flag to specify anexisting reservation that you want to attach to your commitment. Include anew instance of this flag for every existing reservation that you want toattach. You can attach any number of existing reservations to yourcommitment.
For example, to purchase a commitment by attaching two reservations to it,run the following command:
gcloud compute commitments createCOMMITMENT_NAME \ --region=REGION \ --project=PROJECT_ID \ --resources=vcpu=COMMITTED_VCPUS,memory=COMMITTED_MEMORY,local-ssd=COMMITTED_LOCAL_SSD \ --resources-accelerator=count=COMMITTED_ACCELERATOR_COUNT,type=COMMITTED_ACCELERATOR_TYPE \ --plan=PLAN \ --type=COMMITMENT_TYPE \ --custom-end-time=CUSTOM_END_DATE \ --existing-reservation=name='RESERVATION_NAME_1',zone='RESERVATION_ZONE_1' \ --existing-reservation=name='RESERVATION_NAME_2',zone='RESERVATION_ZONE_2'
Replace the following:
COMMITMENT_NAME: the name of the commitment.REGION: the region where the commitment islocated.PROJECT_ID: the ID of the project where youwant to purchase the commitment with the attached reservations.PLAN: the commitment plan, whichdetermines your CUD rate and the preset term duration. Specify12-monthor36-month.CUSTOM_END_DATE: Optional. A custom end datefor your term, which must be formatted asYYYY-MM-DD. For example, to specify a customend date of April 20, 2024, format it as2024-04-20.COMMITMENT_TYPE: the commitment type. Thefollowing commitment types provide options for GPUs, Local SSD disks, orboth:- For A2 machine types, use
accelerator-optimized - For A3 Edge and A3 High machine types, use
accelerator-optimized-a3 - For A3 Mega machine types, use
accelerator-optimized-a3-megaNote: For A4X, A4, or A3 Ultra machine types, you must purchase your commitments by using thefuture reservations in AI Hypercomputer consumption option. For more information, see Reserve capacity through your account team. - For G2 machine types, use
graphics-optimized - For G4 machine types, use
graphics-optimized-g4 - For C2 machine types, use
compute-optimized - For C2D machine types, use
compute-optimized-c2d - For C3 machine types, use
compute-optimized-c3 - For C3D machine types, use
compute-optimized-c3dCaution: For C3 and C3D commitment types, the machine family that is specified by the commitment type changes depending on the interface:- In the gcloud CLI and REST, the commitment type values useCompute-optimized as the machine family, even though C3 and C3D are part of the general-purpose machine family.
- In the Google Cloud console, the commitment type values use the correct machine series:General-Purpose.
- For N1 machine types, use
general-purpose - For C4 machine types, use
general-purpose-c4 - For C4A machine types, use
general-purpose-c4a - For C4D machine types, use
general-purpose-c4d - For N2 machine types, use
general-purpose-n2 - For N2D machine types, use
general-purpose-n2d - For M1 machine types, use
memory-optimized - For M3 machine types, use
memory-optimized-m3 - For Z3 machine types, use
storage-optimized-z3
- For A2 machine types, use
COMMITTED_VCPUS: the number of vCPUs thatyou want in your commitment. The number must be a positive integer.COMMITTED_MEMORY: the amount, in MB or GB,of memory that you want in your commitment. For example,10240MBor10GB. If you don't specify a unit, Compute Engine uses GB asthe unit.COMMITTED_LOCAL_SSD: the amount, in GB, ofLocal SSD space that you want in your commitment. Each Local SSD diskis 375 GB.COMMITTED_ACCELERATOR_COUNT: the number of GPUsthat you want in your commitment.COMMITTED_ACCELERATOR_TYPE: the GPU type thatyou want in your commitment.RESERVATION_NAME_1andRESERVATION_NAME_2: The names of theexisting reservations that you want to attach to the commitment.RESERVATION_ZONE_1andRESERVATION_ZONE_2: The zones of theexisting reservations that you want to attach to the commitment.
Example: Purchase a commitment by attaching existing reservations
Suppose you have two reservationsres-01 andres-02 in theus-central1-a andus-central1-b zones of the projectmyproject.Suppose that these reservations hold a combined capacity for 4 NVIDIA P100GPUs and 4 Local SSD disks. To purchase a new commitment in theus-central1 region of this project for these GPUs and Local SSD disks,and use these existing reservations as attached reservations, run thefollowing command. Note that the example commitment also contains vCPUs andmemory.
gcloud compute commitments create commitment-01 \ --region=us-central1 \ --project=myproject \ --resources=vcpu=96,memory=624GB,local-ssd=1500 \ --resources-accelerator=type=nvidia-tesla-p100,count=4 \ --plan 12-month \--existing-reservation=name=res-01,zone=us-central1-a \ --existing-reservation=name=res-02,zone=us-central1-b
REST
To purchase a commitment by attaching existing reservations, make aPOSTrequest to theregionCommitments.insert method.In your request, include theexistingReservations field to specify acomma-separated list of all the existing reservations that you want toattach to your commitment. You can attach any number of existingreservations to your commitment.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/commitments{ "name": "COMMITMENT_NAME", "plan": "PLAN", "type":COMMITMENT_TYPE, "resources": [ { "amount": "COMMITTED_VCPUS", "type": "VCPU" }, { "amount": "COMMITTED_MEMORY", "type": "MEMORY" }, { "acceleratorType": "COMMITTED_ACCELERATOR_TYPE", "amount": "COMMITTED_ACCELERATOR_COUNT", "type": "ACCELERATOR" } { "amount": "COMMITTED_LOCAL_SSD", "type": "LOCAL_SSD" } ], "customEndTimestamp": "CUSTOM_END_DATETEND_TIMEZ", "existingReservations": "RESERVATION_URLs"}Replace the following:
COMMITMENT_NAME: the name of the commitment.REGION: the region where the commitment islocated.PROJECT_ID: the ID of the project where youwant to purchase the commitment with the attached reservations.PLAN: the commitment plan, whichdetermines your CUD rate and the preset term duration. SpecifyTWELVE_MONTHorTHIRTY_SIX_MONTH.COMMITMENT_TYPE: the commitment type. Thefollowing commitment types provide options for GPUs, Local SSD disks, orboth:- For A2 machine types, use
ACCELERATOR_OPTIMIZED - For A3 Edge and A3 High machine types, use
ACCELERATOR_OPTIMIZED_A3 - For A3 Mega machine types, use
ACCELERATOR_OPTIMIZED_A3_MEGANote: For A4X, A4, or A3 Ultra machine types, you must purchase your commitments by using thefuture reservations in AI Hypercomputer consumption option. For more information, see Reserve capacity through your account team. - For G2 machine types, use
GRAPHICS_OPTIMIZED - For G4 machine types, use
GRAPHICS_OPTIMIZED_G4 - For C2 machine types, use
COMPUTE_OPTIMIZED - For C2D machine types, use
COMPUTE_OPTIMIZED_C2D - For C3 machine types, use
COMPUTE_OPTIMIZED_C3 - For C3D machine types, use
COMPUTE_OPTIMIZED_C3DCaution: For C3 and C3D commitment types, the machine family that is specified by the commitment type changes depending on the interface:- In the gcloud CLI and REST, the commitment type values useCompute-optimized as the machine family, even though C3 and C3D are part of the general-purpose machine family.
- In the Google Cloud console, the commitment type values use the correct machine series:General-Purpose.
- For N1 machine types, use
GENERAL_PURPOSE - For C4 machine types, use
GENERAL_PURPOSE_C4 - For C4A machine types, use
GENERAL_PURPOSE_C4A - For C4D machine types, use
GENERAL_PURPOSE_C4D - For N2 machine types, use
GENERAL_PURPOSE_N2 - For N2D machine types, use
GENERAL_PURPOSE_N2D - For M1 machine types, use
MEMORY_OPTIMIZED - For M3 machine types, use
MEMORY_OPTIMIZED_M3 - For Z3 machine types, use
STORAGE_OPTIMIZED_Z3
- For A2 machine types, use
COMMITTED_VCPUS: the number of vCPUs that youwant in your commitment. The number must be a positive integer.COMMITTED_MEMORY: the amount, in MB, ofmemory that you want in your commitment. For example,10240MB.COMMITTED_LOCAL_SSD: the amount, in GB, ofLocal SSD storage that you want in your commitment. Each Local SSD disksis 375 GB.COMMITTED_ACCELERATOR_COUNT: the number ofGPUs that you want in your commitment.COMMITTED_ACCELERATOR_TYPE: the GPU type thatyou want in your commitment.CUSTOM_END_DATE: Optional. A custom end datefor your term, which must be formatted asYYYY-MM-DD.For example, to specify a custom end date of April 20, 2024, format itas2024-04-20.END_TIME: 12 AM US and Canadian Pacific Time(UTC-8 or UTC-7), as an offset ofCoordinated Universal Time (UTC).Specify this value only if you specified a custom end date for yourcommitment. Specify one of the following values:- During daylight saving time:
07:00:00 - During other times:
08:00:00
- During daylight saving time:
RESERVATION_URLs: a comma-separated list ofURLs of the existing reservations that you want to attach to thecommitment. For example, to attach two reservations,res-1andres-2,specify the following:"https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/reservations/example-res-1","https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-c/reservations/example-res-2"
Example: Purchase a commitment by attaching existing reservations
Suppose you have two reservationsres-01 andres-02 in theus-central1-a andus-central1-b zones of the projectmyproject.Suppose that these reservations hold a combined capacity for 4 NVIDIA P100GPUs and 4 Local SSD disks. To purchase a new commitment in theus-central1 region of this project for these GPUs and Local SSD disks andto use these existing reservations as attached reservations,make the followingPOST request. Note that the example commitment alsocontains vCPUs and memory.
POST https://compute.googleapis.com/compute/v1/projects/my-project/regions/us-central1/commitments{ "name": "commitment-01", "plan": "TWELVE_MONTH", "type": "GENERAL_PURPOSE" "resources": [ { "amount": "96", "type": "VCPU" }, { "amount": "638976", "type": "MEMORY" }, { "acceleratorType": "nvidia-tesla-p100", "amount": "4", "type": "ACCELERATOR" }, { "amount": "1536000", "type": "LOCAL_SSD" } ], "existingReservations": [ "https://www.googleapis.com/compute/v1/projects/my-project/zone/us-central1-a/reservations/res-01", "https://www.googleapis.com/compute/v1/projects/my-project/zone/us-central1-b/reservations/res-02" ]}Create new reservations to attach
You can create your attached reservations while purchasing your commitment byusing the Google Cloud console, the Google Cloud CLI, or REST.
Permissions required for this task
To perform this task, you must have the followingpermissions:
- To create a commitment:
compute.commitments.createon the project - To create reservations:
compute.reservations.createon the project
Console
Before you purchase a commitment using the Google Cloud console,select the project that you want to use to purchase the commitment. IfCUD sharingis enabled for a Cloud Billing account, you canpurchase the commitment using any project from that Cloud Billingaccount. After you select the project, do the following:
In the Google Cloud console, go to theCommitted use discountspage.
To purchase a commitment, clickPurchase commitment. ThePurchase a committed use discount pageopens and displays theHardware tab.
In theName field, enter a name for your commitment.
In theRegion field, select the region where you want to commit toCompute Engine resources.
In theCommitment type field, select the machine family series foryour committed resources.The following commitment types provideoptions for GPUs, Local SSD disks, or both:
- For A2 machine types, selectAccelerator-optimized A2
- For A3 Edge and A3 High machine types, selectAccelerator-optimized A3
- For A3 Mega machine types, selectAccelerator-optimized A3 MegaNote: For A4X, A4, or A3 Ultra machine types, you must purchase your commitments by using thefuture reservations in AI Hypercomputer consumption option. For more information, see Reserve capacity through your account team.
- For G2 machine types, selectGraphics-optimized G2
- For G4 machine types, selectGraphics-optimized G4
- For C2 machine types, selectCompute-optimized C2
- For C2D machine types, selectCompute-optimized C2D
- For C3 machine types, selectGeneral-Purpose C3
- For C3D machine types, selectGeneral-Purpose C3DCaution: For C3 and C3D commitment types, the machine family that is specified by the commitment type changes depending on the interface:
- In the gcloud CLI and REST, the commitment type values useCompute-optimized as the machine family, even though C3 and C3D are part of the general-purpose machine family.
- In the Google Cloud console, the commitment type values use the correct machine series:General-Purpose.
- For C4 machine types, selectGeneral-Purpose C4
- For C4A machine types, selectGeneral-Purpose C4A
- For C4D machine types, selectGeneral-Purpose C4D
- For N1 machine types, selectGeneral-Purpose N1
- For N2 machine types, selectGeneral-Purpose N2
- For N2D machine types, selectGeneral-Purpose N2D
- For M1 machine types, selectMemory-optimized M1/M2
- For M3 machine types, selectMemory-optimized M3
- For Z3 machine types, selectStorage-optimized Z3
ForDuration, do the following:
- To specify your commitment's plan, select either1 year or3 years. The plan determines the CUD rate and the preset termduration of your commitment.
- Optional. To specify a custom term duration for your commitment,click theExtend end date toggle and then, in theDatefield, specify a custom end date. For more information,seeExtend commitment terms.
In theCores field, enter the number of vCPUs that youwant to commit to.
In theMemory field, enter the amount, in GB, of memorythat you want to commit to.
To commit to GPUs, in theGPUs section, clickAdd GPU and then do the following:
- In theGPU type field, select the type of GPU.
- In theNumber of GPUs field, enter the number of GPUs.
- Optional: If your GPU model supportsNVIDIA RTX Virtual Workstations (vWS) for graphics workloads,and you plan to run graphics-intensive workloads, select theEnable Virtual Workstation (NVIDIA GRID) checkbox.
To commit to Local SSD disks, in theLocal SSDs section, clickAdd SSD and then, in theNumber of SSDs field, specify thenumber of disks.
To create a new reservation and attach it to the commitment, in theReservations field, selectCreate reservations and then do thefollowing. Repeat this step for every new reservation that you want tocreate and attach.
- ClickAdd a reservation. TheNew reservation section appears.
- In theName field, enter a name for your attached reservation.
- In theRegion field, select the same region as your commitment.
- In theZone field, select the zone where you want to reserveyour resources.
In theShare type section, specify how you want to share thisreservation in one of the following ways:
- To create a single-project reservation, selectLocal.
- To create a reservation that is shared with multiple projects,selectShared. Then, to specify the projects to share thethis reservation with, clickAdd projects, andthen select the projects that you want from the currentproject's organization.
In theUse with VM instance field, select how you want VMs toconsume your reservation in one of the following ways:
- To allow VMs with matching properties to automatically consumethis reservation, clickUse reservation automatically(default).
- To consume this reservation's resources only when creating VMswith matching properties that specifically target thisreservation by name, click selectSelect specific reservation.
In theResource details section, do the following:
- In theNumber of VM instances field, enter the number of VMinstances that you want to reserve.
In theMachine configuration section, specify the propertiesof your reserved VMs in one of the following ways:
To specify your the properties of your VMs using an existinginstance template,selectUse instance template.
In theInstance template field, select an instancetemplate that specifies the same machine family series asyour commitment. If you select a regional instance template,the region of that instance template must also match withthe region specified in your commitment.
To manually specify the properties of your VMs, selectSelect machine type and then do the following:
Select the machine family that applies to themachine series that you specified for the commitment:
- General purpose for general-purpose machine series
- Compute optimized for compute-optimized machineseries
- Memory optimized for memory-optimized machineseries
- GPUs for accelerator-optimized machine series
In the table that hasSeries column, select thesame machine series that you specified for thecommitment.
In theMachine type field, specify a predefinedor custom machine type in one of the following ways:
- To choose a predefined machine type, selectPresetand then select the machine type that you want.
- To choose a custom machine type, selectCustomand then specifyCores andMemory that youwant.
To specify a minimum CPU platform, GPUs, or both,expand theCPU Platform and GPU menu and do the following:
- Optional: To specify a minimum CPU platform, in theCPU Plaform list, select an option.
Optional: To reserve GPUs, clickAdd GPU.Then, in theGPU type andNumber of GPUsfields, select the type and number of GPUs for eachVM.
Important: The types and total number of GPUsspecified across all your attached reservations mustmatch with what you specified in your commitment.Otherwise, you won't be able to purchase thecommitment.
To reserve Local SSD disks, do the following:
- In theNumber of disks field, select the numberof Local SSD disks that you want for each VM.
- In theInterface type field, select theinterface for the Local SSD disks.
To finish specifying the properties for this reservation, clickDone.
To finish purchasing your commitment with the attached reservations,do the following:
- ClickPurchase.
- In thePurchase a committed use discount dialog, if you agreewith theservice specific terms,clickPurchase again.
gcloud
To create your attached reservations while purchasing your commitment, runthegcloud compute commitments create command.
Depending on whether you want to attach a single reservation or multiplereservations, run the command in one of the following ways:
To create and attach a single reservation to your commitment, definethe properties of the attached reservation by running the followingcommand:
gcloud compute commitments createCOMMITMENT_NAME \ --region=REGION \ --project=PROJECT_ID \ --planPLAN \ --typeCOMMITMENT_TYPE --resources=vcpu=COMMITTED_VCPUS,memory=COMMITTED_MEMORY,local-ssd=COMMITTED_LOCAL_SSD \ --resources-accelerator=count=COMMITTED_ACCELERATOR_COUNT,type=COMMITTED_ACCELERATOR_TYPE \ --custom-end-time=CUSTOM_END_DATE \ --reservation=RESERVATION_NAME \ --reservation-zone=RESERVATION_ZONE \ --machine-type=RESERVED_MACHINE_TYPE \ --require-specific-reservation=REQUIRE_SPECIFIC_RESERVATION_VALUE \ --vm-count=NUMBER_OF_RESERVED_VMs \ --accelerator=type=RESERVED_ACCELERATOR_TYPE,count=RESERVED_ACCELERATOR_COUNT \ --local-ssd=interface=INTERFACE_1,size=375 \ --local-ssd=interface=INTERFACE_2,size=375 \ --minimum-cpu-platform=MINIMUM_CPU_PLATFORM \ --share-setting=SHARE_SETTING \ --share-with=CONSUMER_PROJECT_ID_1,CONSUMER_PROJECT_ID_2
To create and attach multiple reservations to your commitment, definethe reservation's properties using a YAML file and then specify thatYAML file in the command that you use to purchase your commitment.Optionally, you can also use this YAML file approach to create andattach a single reservation to your commitment. To create your attachedreservations using this approach, do the following:
Create the YAML file in the current directory and specify theconfiguration that you want for each attached reservation. Forexample, to specify the configuration of a shared reservationshared with two projects that specifies GPUs, two Local SSD disks,and a minimum CPU platform, include the following text in your YAMLfile:
-reservation:RESERVATION_NAMEreservation_zone:RESERVATION_ZONErequire_specific_reservation:REQUIRE_SPECIFIC_RESERVATION_VALUEvm_count:NUMBER_OF_RESERVED_VMsmachine_type:RESERVED_MACHINE_TYPEaccelerator:-count:RESERVED_ACCELERATOR_COUNTtype:RESERVED_ACCELERATOR_TYPElocalssd:-interface:INTERFACE_1size:375-interface:INTERFACE_2size:375project:OWNER_PROJECT_IDminimum-cpu-platform:MINIMUM_CPU_PLATFORMshare-setting:SHARE_SETTINGshare-with:-CONSUMER_PROJECT_ID_1-CONSUMER_PROJECT_ID_2To specify the configuration for multiple reservations, repeat theseproperties for each reservation that you want to create. You canattach any number of existing reservations that you want to yourcommitment.
Run the
gcloud compute commitments createcommand and includethe--reservation-from-fileflag.gcloud compute commitments createCOMMITMENT_NAME \ --regionREGION \ --projectPROJECT_ID \ --planPLAN \ --typeCOMMITMENT_TYPE \ --resources=vcpu=COMMITTED_VCPUS,memory=COMMITTED_MEMORY,local-ssd=COMMITTED_LOCAL_SSD \ --resources-accelerator=count=COMMITTED_ACCELERATOR_COUNT,type=COMMITTED_ACCELERATOR_TYPE \ --reservations-from-file=YAML_FILE
Replace the following with the corresponding properties of the commitmentand the attached reservations:
Commitment
COMMITMENT_NAME: the name of the commitment.REGION: the region where the commitment islocated.PROJECT_ID: the ID of the project where youwant to purchase the commitment with the attached reservations.PLAN: the commitment plan, whichdetermines your CUD rate and the preset term duration. Specify12-monthor36-month.CUSTOM_END_DATE: Optional. A custom end datefor your term, which must be formatted asYYYY-MM-DD. For example, to specify a customend date of April 20, 2024, format it as2024-04-20.COMMITMENT_TYPE: the commitment type. Thefollowing commitment types provide options for GPUs, Local SSD disks,or both:- For A2 machine types, use
accelerator-optimized - For A3 Edge and A3 High machine types, use
accelerator-optimized-a3 - For A3 Mega machine types, use
accelerator-optimized-a3-megaNote: For A4X, A4, or A3 Ultra machine types, you must purchase your commitments by using thefuture reservations in AI Hypercomputer consumption option. For more information, see Reserve capacity through your account team. - For G2 machine types, use
graphics-optimized - For G4 machine types, use
graphics-optimized-g4 - For C2 machine types, use
compute-optimized - For C2D machine types, use
compute-optimized-c2d - For C3 machine types, use
compute-optimized-c3 - For C3D machine types, use
compute-optimized-c3dCaution: For C3 and C3D commitment types, the machine family that is specified by the commitment type changes depending on the interface:- In the gcloud CLI and REST, the commitment type values useCompute-optimized as the machine family, even though C3 and C3D are part of the general-purpose machine family.
- In the Google Cloud console, the commitment type values use the correct machine series:General-Purpose.
- For N1 machine types, use
general-purpose - For C4 machine types, use
general-purpose-c4 - For C4A machine types, use
general-purpose-c4a - For C4D machine types, use
general-purpose-c4d - For N2 machine types, use
general-purpose-n2 - For N2D machine types, use
general-purpose-n2d - For M1 machine types, use
memory-optimized - For M3 machine types, use
memory-optimized-m3 - For Z3 machine types, use
storage-optimized-z3
- For A2 machine types, use
COMMITTED_VCPUS: the number of vCPUs thatyou want in your commitment. The number must be a positive integer.COMMITTED_MEMORY: the amount, in MB or GB,of memory that you want in your commitment. For example,10GBor10240MB. If you don't specify a unit, Compute Engine uses GBas the unit.COMMITTED_LOCAL_SSD: the amount, in GB, ofLocal SSD storage that you want in your commitment. Each Local SSDdisk is 375 GB.COMMITTED_ACCELERATOR_COUNT: the number ofGPUs that you want in your commitment.COMMITTED_ACCELERATOR_TYPE: the GPU typethat you want in your commitment.YAML_FILE: The path to the YAML file thatcontains the configuration of the attached reservations.
Attached reservations
RESERVATION_NAME: the name of the attachedreservation.RESERVATION_ZONE: the zone of the attachedreservation.REQUIRE_SPECIFIC_RESERVATION_VALUE: specifiesif the attached reservation is a specifically targeted reservation;eithertrueorfalse. For more information about specificallytargeted reservations, seeHow reservations work.NUMBER_OF_RESERVED_VMS: the number of VMsthat you want to reserve in the attached reservation.RESERVED_MACHINE_TYPE: themachine type that you want for theVMs in your attached reservation.- Forpredefined machine types, use the format
MACHINE_FAMILY-standard-CPUS;for example,n2-standard-4. Forcustom machine types, use the format
MACHINE_FAMILY-custom-CPUS-MEMORY;for examplen2-custom-4-5120. For a full list of restrictions,read thespecificationsfor custom machine types.Replace the following:
MACHINE_FAMILY: the family of machinetypes; for example, specifyn2for N2 VMs.CPUS: the number ofvCPUs.MEMORY: the total memory for areserved VM. Memory must be a multiple of 256 MBand must be supplied in MB; for example, to create an N2 VMwith 4 vCPUs and 5 GB of memory, which is 5120 MB,usen2-custom-4-5120.
- Forpredefined machine types, use the format
RESERVED_ACCELERATOR_COUNT: the number ofGPUs you want to add, per VM, in the attached reservation.RESERVED_ACCELERATOR_TYPE:thetype of accelerator you want to add inthe attached reservation.INTERFACE_1andINTERFACE_2: the type of interface youwant theLocal SSD disks for eachreserved VM to use. Valid options are:scsiandnvme. Each LocalSSD disk is 375 GB. Repeat thelocal_ssdparameter for eachLocal SSD disk that you want to add. You can specify up to 24 LocalSSD disks.OWNER_PROJECT_ID: the ID of the projectwhere you want to purchase the commitment with the attachedreservation. Specify this field if you want to share your attachedreservation across multiple consumer projects.MINIMUM_CPU_PLATFORM: the minimumCPU platform that you want to specify for the attached reservation.SHARE_SETTING: the type of sharing for theattached reservation. Specify this field with the value asprojectsif you want to share your attached reservation across multipleconsumer projects. Exclude this field if you want create asingle-project reservation.CONSUMER_PROJECT_ID_1andCONSUMER_PROJECT_ID_2:theproject IDsof the projects that can share this reservation, for exampleproject-1andproject-2. You can include up to 100 consumerprojects. These projects must be in the same organization as theowner project. Don't include the ID of the project where you createthis reservation, as that project is allowed to consume thisreservation by default. Exclude these fields if you want to createa single-project reservation.
Compute Engine creates the commitment and the attached reservationsonly if there are enough resources of the specified machine type in thetarget zone, and sufficient quota, at the time of your request. If yourpurchase was successful, you see a success message similar to the following:
Created[https://www.googleapis.com/compute/v1/projects/your-project/regions/your-region/commitments/your-commitment-name]
Examples for purchasing commitments by creating new reservations to attach
The following example scenarios and commands show how you can purchase acommitment for GPUs, Local SSD disks, or both by creating new reservationsto attach to that commitment.
Example 1: Purchase a commitment for GPUs by attaching a single new reservation
Suppose you want to purchase a commitmentcommitment-01 in theus-central1 region that includes 4 NVIDIA V100 GPUs. You want to create anew reservationreservation-01 as the attached reservation forthose GPUs. Suppose you also want to specify Compute Engine to usethose reserved GPUs across 2n1-standard-32 VMs in theus-central1-azone. To purchase this example commitment with its attached reservation, runthe following command:
gcloud compute commitments create commitment-01 \ --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
Example 2: Purchase a commitment for GPUs without committing to vCPUs or memory
To commit to and reserve GPUs and Local SSD disks without committing tovCPUs or memory, specify0 as the value for vCPU and memory quantities.For example, suppose you want to purchase a commitmentcommitment-02 for asingle NVIDIA P4 GPU in theus-west2 region. You also want to create a newreservation as the attached reservation and specifyCompute Engine to use the reserved GPU on ann1-standard-2 VM in theus-west2-b zone. To purchase this example commitment with its attachedreservation, run the following command:
gcloud compute commitments create commitment-02 \ --region=us-west2 \ --project=myproject \--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
Example 3: Purchase a commitment for GPUs and Local SSD disks by attaching multiple new reservations
Suppose you want to purchase a commitmentcommitment-03 for 1NVIDIA V100 GPU and 2 Local SSD disks in theus-central1 region. You alsowant to create and attach two reservations in theus-central1-a zone. In the first reservation,res-01, you want toreserve 1n1-standard-2 VM with 1 GPU. You want to makeres-01 atargeted reservation, which means that you must specifically target thatreservation by name to use its reserved VMs. In the second reservation,res-02, you want to reserve 1n1-standard-8 VM with 2 types ofattached Local SSD disks.
To purchase this example commitment with the attached reservations,first create the YAML file with the properties of both reservations.
- 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-8 local_ssd: - interface: scsi size: 375 - interface: nvme size: 375
After you create the YAML file, to finish purchasing the commitment with itsattached reservations, run the following command. Note that the examplecommitment also contains vCPU and memory resources.
gcloud compute commitments create commitment-03 \ --region=us-central1 \ --project=myproject \ --resources=vcpu=96,memory=624,local-ssd=750 \ --resources-accelerator=type=nvidia-tesla-v100,count=1 \ --plan 12-month \--reservations-from-file=YAML_FILE
REST
To create your attached reservations while purchasing your commitment,make aPOST request to theregionCommitments.insert method.In your request, include thereservations field to define a list of allthe new reservations that you want to create and attach. You can attach anynumber of existing reservations that you want to your commitment.
To create your new reservation by manually specifying all the VMproperties, include the
instancePropertiesfield and exclude thesourceInstanceTemplatefield.For example, to manually specify the configuration of a shared reservationshared with two projects that specifies GPUs, two Local SSD disks, and aminimum CPU platform, make the following request:
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/commitments{"name": "COMMITMENT_NAME","plan": "PLAN","type":COMMITMENT_TYPE,"resources":[ { "amount": "COMMITTED_VCPUS", "type": "VCPU" }, { "amount": "COMMITTED_MEMORY", "type": "MEMORY" }, { "acceleratorType": "COMMITTED_ACCELERATOR_TYPE", "amount": "COMMITTED_ACCELERATOR_COUNT", "type": "ACCELERATOR" } { "amount": "COMMITTED_LOCAL_SSD", "type": "LOCAL_SSD" }],"customEndTimestamp": "CUSTOM_END_DATETEND_TIMEZ","reservations":[ { "name": "RESERVATION_NAME", "specificReservation": { "count": "NUMBER_OF_RESERVED_VMS", "instanceProperties": { "guestAccelerators": [ { "acceleratorCount": "RESERVED_ACCELERATOR_COUNT", "acceleratorType": "RESERVED_ACCELERATOR_TYPE" } ], "localSsds": [ { "diskSizeGb": "375", "interface": "RESERVED_INTERFACE_1" }, { "diskSizeGb": "375", "interface": "RESERVED_INTERFACE_2" } ], "machineType": "RESERVED_MACHINE_TYPE", "minCpuPlatform": "MINIMUM_CPU_PLATFORM" } }, "specificReservationRequired":REQUIRE_SPECIFIC_RESERVATION_VALUE", "zone": "RESERVED_ZONE", "shareSettings": { "shareType": "SPECIFIC_PROJECTS", "projectMap": { "CONSUMER_PROJECT_ID_1": { "projectId": "CONSUMER_PROJECT_ID_1" }, "CONSUMER_PROJECT_ID_2": { "projectId": "CONSUMER_PROJECT_ID_2" } } } }]}To create your new reservation by specifying an instance template, includethe
sourceInstanceTemplatefield and exclude theinstancePropertiesfield.POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/commitments{"name": "COMMITMENT_NAME","plan": "PLAN","type":COMMITMENT_TYPE,"resources":[ { "amount": "COMMITTED_VCPUS", "type": "VCPU" }, { "amount": "COMMITTED_MEMORY", "type": "MEMORY" }, { "acceleratorType": "COMMITTED_ACCELERATOR_TYPE", "amount": "COMMITTED_ACCELERATOR_COUNT", "type": "ACCELERATOR" } { "amount": "COMMITTED_LOCAL_SSD", "type": "LOCAL_SSD" }],"customEndTimestamp": "CUSTOM_END_DATETEND_TIMEZ","reservations":[ { "name": "RESERVATION_NAME", "specificReservation": { "count": "NUMBER_OF_RESERVED_VMS", "sourceInstanceTemplate": "projects/PROJECT_ID/LOCATION/instanceTemplates/INSTANCE_TEMPLATE_NAME" }, "specificReservationRequired":REQUIRE_SPECIFIC_RESERVATION_VALUE", "zone": "RESERVED_ZONE", "shareSettings": { "shareType": "SPECIFIC_PROJECTS", "projectMap": { "CONSUMER_PROJECT_ID_1": { "projectId": "CONSUMER_PROJECT_ID_1" }, "CONSUMER_PROJECT_ID_2": { "projectId": "CONSUMER_PROJECT_ID_2" } } } }]}
Replace the following with the corresponding properties of the commitmentand the attached reservations:
Commitment
COMMITMENT_NAME: the name of the commitment.REGION: the region where the commitment islocated.PROJECT_ID: the ID of the project where youwant to purchase the commitment with the attached reservations.PLAN: the commitment plan, whichdetermines your CUD rate and the preset term duration. SpecifyTWELVE_MONTHorTHIRTY_SIX_MONTH.COMMITMENT_TYPE: the commitment type. Thefollowing commitment types provide options for GPUs, Local SSD disks,or both:- For A2 machine types, use
ACCELERATOR_OPTIMIZED - For A3 Edge and A3 High machine types, use
ACCELERATOR_OPTIMIZED_A3 - For A3 Mega machine types, use
ACCELERATOR_OPTIMIZED_A3_MEGANote: For A4X, A4, or A3 Ultra machine types, you must purchase your commitments by using thefuture reservations in AI Hypercomputer consumption option. For more information, see Reserve capacity through your account team. - For G2 machine types, use
GRAPHICS_OPTIMIZED - For G4 machine types, use
GRAPHICS_OPTIMIZED_G4 - For C2 machine types, use
COMPUTE_OPTIMIZED - For C2D machine types, use
COMPUTE_OPTIMIZED_C2D - For C3 machine types, use
COMPUTE_OPTIMIZED_C3 - For C3D machine types, use
COMPUTE_OPTIMIZED_C3DCaution: For C3 and C3D commitment types, the machine family that is specified by the commitment type changes depending on the interface:- In the gcloud CLI and REST, the commitment type values useCompute-optimized as the machine family, even though C3 and C3D are part of the general-purpose machine family.
- In the Google Cloud console, the commitment type values use the correct machine series:General-Purpose.
- For N1 machine types, use
GENERAL_PURPOSE - For C4 machine types, use
GENERAL_PURPOSE_C4 - For C4A machine types, use
GENERAL_PURPOSE_C4A - For C4D machine types, use
GENERAL_PURPOSE_C4D - For N2 machine types, use
GENERAL_PURPOSE_N2 - For N2D machine types, use
GENERAL_PURPOSE_N2D - For M1 machine types, use
MEMORY_OPTIMIZED - For M3 machine types, use
MEMORY_OPTIMIZED_M3 - For Z3 machine types, use
STORAGE_OPTIMIZED_Z3
- For A2 machine types, use
COMMITTED_VCPUS: the number of vCPUs thatyou want in your commitment. The number must be a positive integer.COMMITTED_MEMORY: the amount, in MB, ofmemory that you want in your commitment. For example,10240MB.COMMITTED_LOCAL_SSD: the amount, in GB, ofLocal SSD storage that you want in your commitment. Each Local SSDdisk is 375 GB.COMMITTED_ACCELERATOR_COUNT: the number ofGPUs that you want in your commitment.COMMITTED_ACCELERATOR_TYPE: the GPU typethat you want in your commitment.CUSTOM_END_DATE: Optional. A custom end datefor your term, which must be formatted asYYYY-MM-DD. For example, to specify a customend date of April 20, 2024, format it as2024-04-20.END_TIME: 12 AM US and Canadian Pacific Time(UTC-8 or UTC-7), as an offset ofCoordinated Universal Time (UTC).Specify this value only if you specified a custom end date for yourcommitment. Specify one of the following values:- During daylight saving time:
07:00:00 - During other times:
08:00:00
- During daylight saving time:
Attached reservations
RESERVATION_NAME: the name of the attachedreservation.RESERVATION_ZONE: the zone of the attachedreservation.REQUIRE_SPECIFIC_RESERVATION_VALUE: specifiesif the attached reservation is a specifically targeted reservation;eithertrueorfalse. For more information about specificallytargeted reservations, seeHow reservations work.NUMBER_OF_RESERVED_VMS: the number of VMsthat you want to reserve in the attached reservation.RESERVED_MACHINE_TYPE: themachine type that you want for theVMs in your attached reservation.- Forpredefined machine types, use the format
MACHINE_FAMILY-standard-CPUS;for example,n2-standard-4. Forcustom machine types, use the format
MACHINE_FAMILY-custom-CPUS-MEMORY;for examplen2-custom-4-5120. For a full list of restrictions,read thespecificationsfor custom machine types.Replace the following:
MACHINE_FAMILY: the family of machinetypes; for example, specifyn2for N2 VMs.CPUS: the number ofvCPUs.MEMORY: the total memory for a reservedVM. Memory must be a multiple of 256 MB and mustbe supplied in MB; for example, to create an N2 VM with 4 vCPUsand 5 GB of memory, which is 5120 MB, usen2-custom-4-5120.
- Forpredefined machine types, use the format
RESERVED_ACCELERATOR_COUNT: the number ofGPUs you want to add, per VM, in the attached reservation.RESERVED_ACCELERATOR_TYPE:thetype of accelerator you want to add inthe attached reservation.INTERFACE_1andINTERFACE_2: the type of interface you wanttheLocal SSD disks for each reservedVM to use. Valid options are:scsiandnvme. Each Local SSD diskis 375 GB. Repeat thelocalSsdsparameter for each Local SSDdisk that you want to add. You can specify up to 24 Local SSD disks.MINIMUM_CPU_PLATFORM: the minimumCPU platform that you want to specify for the attached reservation.INSTANCE_TEMPLATE_NAME: the name of theinstance template that you want to use to create your attachedreservation.SHARE_SETTING: the type of sharing for theattached reservation. Specify this field with the value asSPECIFIC_PROJECTSif you want to share your attached reservationacross multiple consumer projects. Exclude this field if you wantcreate a single-project reservation.CONSUMER_PROJECT_ID_1andCONSUMER_PROJECT_ID_2:theproject IDsof the projects that can share this reservation; for example,project-1andproject-2. You can include up to 100 consumerprojects. These projects must be in the same organization as theowner project. Don't include the ID of the project where you createthis reservation, as that project is allowed to consume thisreservation by default. Exclude these fields if you want to create asingle-project reservation.
Compute Engine creates the commitment and the attached reservations onlyif there are enough resources of the specified machine type in the targetzone, and sufficient quota, at the time of your request. If your purchasewas successful, Compute Engine returns a200 status for yourREST API request.
Examples for purchasing commitments by creating new reservations to attach
The following example scenarios and commands show how you can purchase acommitment for GPUs, Local SSD disks, or both by creating new reservationsto attach to that commitment.
Example 1: Purchase a commitment for GPUs by attaching a single new reservation
Suppose you want to purchase a commitmentcommitment-01 in theus-central1 region that includes 4 NVIDIA V100 GPUs. You want tocreate a new reservationreservation-01 as the attachedreservation for those GPUs. Suppose you also want to specifyCompute Engine to use those reserved GPUs across 2n1-standard-8VMs in theus-central1-a zone. To purchase this example commitmentwith its attached reservation, make the followingPOST request:
POST https://compute.googleapis.com/compute/v1/projects/my-project/regions/us-central1/commitments{ "name": "commitment-01", "plan": "TWELVE_MONTH", "type": "GENERAL_PURPOSE" "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" } ]}Example 2: Purchase a commitment for GPUs without committing to vCPUs or memory
To commit to and reserve GPUs and Local SSD disks without committing tovCPUs or memory, specify0 as the value for vCPU and memory quantities.For example, suppose you want to purchase a commitmentcommitment-02 fora single NVIDIA P4 GPU in theus-west2 region. You also want to createa new reservation as the attached reservation and specifyCompute Engine to use the reserved GPU on ann1-standard-2 VM intheus-west2-b zone. To purchase this example commitment with its attachedreservation, make the followingPOST request:
POST https://compute.googleapis.com/compute/v1/projects/my-project/regions/us-west2/commitments{ "name": "commitment-02", "plan": "TWELVE_MONTH", "type": "GENERAL_PURPOSE", "resources": [ { "amount": "0", "type": "VCPU" }, { "amount": "0", "type": "MEMORY" }, { "acceleratorType": "nvidia-tesla-p4", "amount": "4", "type": "ACCELERATOR" } ], "reservations": [ { "name": "reservation-01", "specificReservation": { "count": "1", "instanceProperties": { "guestAccelerators": [ { "acceleratorCount": 4, "acceleratorType": "nvidia-tesla-p4" } ], "machineType": "n1-standard-2" } }, "specificReservationRequired": false, "zone": "us-west2-b" } ]}Example 3: Purchase a commitment for GPUs and Local SSD disks by attaching multiple new reservations
Suppose you want to purchase a commitmentcommitment-03 for 1NVIDIA V100 GPU and 2 Local SSD disks in theus-central1 region. You alsowant to create and attach two reservations in theus-central1-a zone. In the first reservation,res-01, you want toreserve 1n1-standard-2 VM with 1 GPU. You want to makeres-01 atargeted reservation, which means that you must specifically target thatreservation by name to use its reserved VMs. In the second reservation,res-02, you want to reserve 1n1-standard-8 VM with 2 types ofattached Local SSD disks. To purchase this example commitment with theattached reservations, make the followingPOST request. Note that theexample commitment also contains vCPU and memory resources.
POST https://compute.googleapis.com/compute/v1/projects/my-project/regions/us-central1/commitments{ "name": "commitment-03", "plan": "TWELVE_MONTH", "type": "GENERAL_PURPOSE", "resources": [ { "amount": "96", "type": "VCPU" }, { "amount": "638976", "type": "MEMORY" }, { "acceleratorType": "nvidia-tesla-v100", "amount": "1", "type": "ACCELERATOR" }, { "amount": "768000", "type": "LOCAL_SSD" } ],"reservations": [ { "name": "res-01", "specificReservation": { "count": "1", "instanceProperties": { "guestAccelerators": [ { "acceleratorCount": 1, "acceleratorType": "nvidia-tesla-v100" } ], "machineType": "n1-standard-2" } }, "specificReservationRequired": true, "zone": "us-central1-a" }, { "name": "res-02", "specificReservation": { "count": "1", "instanceProperties": { "localSsds": [ { "diskSizeGb": "375", "interface": "SCSI" }, { "diskSizeGb": "375", "interface": "NVME" } ] "machineType": "n1-standard-8" } }, "specificReservationRequired": false, "zone": "us-central1-a" } ]}After you purchase a commitment with attached reservations, the reservationsremain active as long as the commitment is active. When your commitment expires,Compute Engine automatically deletes any attached reservations. If thereservations areautomatically consumed reservations,and you delete them, then any VM instances that were consuming it continue torun. You keep incurring charges for those VMs.
For the duration of your commitment's term, you cannot delete or resize anyattached reservations that contain GPUs, Local SSD disks, or both. However,you can replace the commitment's existing attached reservations with new ones.For more information on what can and cannot be changed for your attachedreservations, seeReplace reservations that are attached to commitments.
Purchase commitments for licenses
You can purchase commitments for your licenses if you run your workloads on VMsthat use the following operating system (OS) images:
- SUSE Linux Enterprise Server (SLES) images
- SLES for SAP images
- Red Hat Enterprise Linux (RHEL) images
The CUD percentages that you receive for license commitments of each OS imagedepends on the number of vCPUs that your VM uses. The following tables show theCUD percentages for each type of software license commitment:
| License commitment type | Number of vCPUs | 1-year CUD percentage | 3-year CUD percentage |
|---|---|---|---|
| SLES images | 1-2 | 77% | 79% |
| SLES images | 3-4 | 54% | 59% |
| SLES images | 5+ | 45% | 50% |
| SLES for SAP images | 1-2 | 59% | 63% |
| SLES for SAP images | 3-4 | 59% | 63% |
| SLES for SAP images | 5+ | 59% | 63% |
| RHEL images | 1-8 | 20% | Unavailable |
| RHEL images | 9-127 | 20% | Unavailable |
| RHEL images | 128+ | 20% | Unavailable |
When you purchase a commitment for licenses, the commitment forms a "pool" oflicenses that automatically apply to any running VM instances within a selectedproject in a specified region. The licenses in the commitment are not tied toany one particular VM. When a VM starts, it takes a committed license from thepool, and when the VM stops it returns the license to the pool, where thelicense can be used by another VM. As long as there are available committedlicenses 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 inus-central1and 5 VMs inus-west1) and under the same project ID, you must purchase 5licenses in each region to cover those running VMs. For each commitment, yourcommitted licenses can apply to any 5 concurrently running VMs at any timeduring the year in the respective region. You are billed monthly for thecommitments regardless of your usage.
After you purchase a commitment, your commitment becomes active on thefollowing day at 12 AM US and Canadian Pacific Time (UTC-8, or UTC-7 duringdaylight saving time).Compute Enginemaintains a lien on your project for each region in yourproject where you purchase a commitment. When you purchasea new commitment for any region in your project,Compute Engine associates the lien for that region withthe newly created commitment.
Between the time of your commitment purchase and its activation time, thestatus of your commitment remains asNOT_YET_ACTIVE (or asPENDING on theGoogle Cloud console). After activation, the status of your commitment changes toACTIVE.For example, suppose you purchase your commitment on January 20, 2024, at 10:00 PMUS and Canadian Pacific Time (UTC-8 or UTC-7). Compute Engine creates yourcommitment immediately with its status asNOT_YET_ACTIVE. Yourcommitment becomesACTIVE on January 21, 2024, at 12:00 AM USand Canadian Pacific Time (UTC-8 or UTC-7).
You can't cancel a license commitment after you purchase it. When your licensecommitments expire, your running VMs continue to run and you are charged for thelicenses at on-demand image prices.
Important: Always verify that committed use discount contracts orcommitments for your licenses are in the correct project ID and regions to avoidbeing double charged. You must purchase your license commitment in the sameproject and region as the machine using the license. For example, if youpurchase your license commitment in Project A, but the running VMs that requirethe OS images are in Project B, you are charged for the license commitment inProject A and the on-demand image price for the VMs running in Project B.Permissions required for this task
To perform this task, you must have the followingpermissions:
compute.commitments.createto create a license for committed use discounts.
Purchase a license commitment using the Google Cloud console, the Google Cloud CLI,or REST.
Console
Before you purchase a commitment using the Google Cloud console, selectthe project where you want to use the resources and apply your CUDs. If you enabledCUD sharingfor your project's Cloud Billing account, then you can purchasethe commitment for any project from that Cloud Billing account.
After you select the project, perform the following steps:
In the Google Cloud console, go to theCommitted Use Discountspage.
TheCommitment list page appears and displays theHardware commitments tab.
ClickSoftware license commitments.
ClickPurchase commitment.
ThePurchase a committed use discount page appears.
In theName field, enter a name for your commitment.
In theRegion field, select the region where you want to useresources at committed-use-discounted prices.
In theDuration field, select acommitment plan,a1-year or3-year plan.
In theLicense family field, select the OS license for which youwant to purchase the commitment.
In theLicense type and quantity section, do the following:
- ForType, select the number of vCPUs that applies.
- ForNumber of licenses, select the number of OS licenses thatyou want to commit to purchasing.
ClickPurchase.
To finish purchasing your commitment, do the following:
- ClickPurchase.
- In thePurchase a committed use discount dialog, if you agreewith theservice specific terms, clickPurchase again.
gcloud
Using the gcloud CLI, run thegcloud compute commitments create-licensecommand to purchase a license commitment.
gcloud compute commitments create-licenseCOMMITMENT_NAME \ --license `LICENSE_URI` --amountNUMBER_OF_LICENSES \ --cores-per-licenseCORES_PER_LICENSE \ --planPLAN \ --regionREGION \
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-12NUMBER_OF_LICENSES: the number of licenses youplan to purchase.CORES_PER_LICENSE: the number of cores perlicense. Enter1-23-4, or5+.PLAN: enter the plan length:12-monthor36-month.REGION: the region where this commitment applies.
For example, the following commitment is for 4 SAP licenses with 3-4 coresper license for 36 months in theus-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 with1-2 cores per license for 12 months in theus-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
REST
Use theregionCommitments.insert methodand include thelicenseResource field to define the license commitment'sproperties.
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-12NUMBER_OF_LICENSES: the number of licenses youplan to purchase.CORES_PER_LICENSE: the number of cores perlicense. Enter1-23-4, or5+.PLAN: enter the plan length:12-monthor36-month.REGION: the region where this commitment applies.
For example, the following commitment is for 4 SLES for SAPlicenses with 3-4 cores per license for 36 months in theus-central1region.
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" }}Apply committed use discount recommendations
Google Cloud analyzes your VM spending trends with and without a commitmentand generates CUDs recommendations. You can use CUD recommendations to optimizeyour compute costs. You can compare the costs with and without a commitment, andestimate how much you can save each month with a commitment.
CUD recommendations are available in the Google Cloud console.TheRecommender generates a card withinformation about your VM usage over the last 30 days. If your VMs show a trendof uncommitted usage over 30 days, the Recommender classifies this asan opportunity to purchase commitments 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 previous 30 days ofusage history into consideration.
Recommendations for CUDs are generated by two separate algorithms, which youcan 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 resourcesthat are not on all the time.
To learn more about how CUD recommendations work, seeCommitted use discount Recommender.
Review and accept a recommendation
To learn how to purchase the recommended commitments, seePurchasing recommendations
Dismiss a recommendation
To learn how to dismiss your commitment recommendations or to restorerecommendations that were previously dismissed, seeDismissing recommendations
History of recommendations
To learn how to view the history of your applied and dismissed commitmentrecommendations, seeViewing the history of recommendations.
View your commitments
View the list of all your commitments in the Google Cloud console, theGoogle Cloud CLI, or REST.
Console
In the Google Cloud console, view a list of commitments in theCommitted use discounts page.
gcloud
Make a request using thecommitments 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
REST
You can get a list of commitments across all regions by making anaggregatedList requestto the following URL:
https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/aggregated/commitmentsWhich 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" }] }]Modify a commitment
You can modify your active commitments in the following ways:
- You can change the auto-renew status for your commitment. For more information,seeRenew commitments automatically.
- You can extend your commitment's term length beyond the preset duration of 1 or 3years by specifying a custom end date for your commitment. For moreinformation, seeExtend commitment terms.
- You can modify the amount of resources in your hardware commitments by eithermerging or splitting your existing commitments. For more information, seeMerge and split commitments.
- You can upgrade your 1-year hardware commitments and convert theminto 3-year commitments. For more information, seeUpgrade commitments.
- You can change the Cloud Billing account that is linked to, and paysfor, the project where you purchased your resource-based commitments.Learn about changing the Cloud Billing account for a project.
After you create the commitment, you can't modify the commitment's project,type, or region.
Cancel a commitment
After you create a commitment, you can't cancel it. You must pay the agreed uponmonthly amount for the duration of the commitment. Commitments are not affectedby future changes toon-demand prices of yourcommitted Compute Engine resources.
If you accidentally purchased a commitment or made a mistake while configuringyour commitment, then you have 14 calendar days from the commitment start dateto contactCloud Billing support for help. Approvalof any changes is subject to Google's discretion and isn't assured untilconfirmed by Google.
Understand your bill with committed use discounts
Read the following documents to gain a better understanding of your billing:
- View and download the cost details of your invoice or statement.
- Analyze the effectiveness of your committed use discounts.
- Understand your savings with cost breakdown reports.
Support
If you have any questions regarding committed use discounts on your bill,you cancontact Google Cloud support.
What's next
- Learn how torenew resource-based commitments automatically.
- Learn how toextend the term of resource-based commitments.
- Learn how toupgrade resource-based commitments.
- Learn how tomerge and split resource-based commitments.
- Learn how toanalyze the effectiveness of your CUDs.
- Review theprices of your resources with and without CUDs.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.