Compute Engine offers the ability to purchase committed use contracts in return for deeply discounted prices for VM usage. These discounts are referred to as committed use discounts.
Committed use discounts are ideal for workloads with predictable resources needs. When you purchase a committed use contract, you purchase a certain amount of vCPUs, memory, GPUs, and local SSDs at a discounted price in return for committing to paying for those resources for 1 year or 3 years. The discount is up to 57% for most resources like machine types or GPUs. The discount is up to 70% for memory-optimized machine types. To see the committed use prices for different machine types, visit the VM instance pricing page.
Once purchased, you are billed monthly for the resources you purchased, for the duration of the term you selected, whether or not you use the services. If you have a predictable workload, you can use commitment use discounts to help you cut costs on resources that you need.
Committed use discounts work on all Compute Engine non-shared core machine types, including predefined and custom machine types. Committed use discounts are simple and flexible, and require no upfront costs. Discounts apply to the aggregate number of vCPUs, memory, GPUs and local SSDs within a region, so they are not affected by changes to your instance's machine setup.
Before you begin
- If you want to use the command-line examples in this guide:
- Install or update to the latest version of the gcloud command-line tool.
- Set a default region and zone.
- If you want to use the API examples in this guide, set up API access.
How does a committed use discount work?
To use committed use discounts, you must purchase commitments
through the Compute Engine API, the gcloud
command-line tool, or the
Google Cloud Console. After you have purchased commitments, they are
automatically applied to your project for concurrent usage.
Purchase commitments for specific resources you know you will use. For example, if you purchase a commitment for 8 cores, and you run 24 cores during the month, you will receive committed use discounts for 8 cores. The other 16 cores will be billed at standard, non-committed use rates. Keep in mind that after you purchase a set amount of commitments, you're billed for those commitments monthly, even if you don't use them. For example, if you purchase commitments for 8 cores, you're billed the committed use rates for those 8 cores for the whole month, even if you might have only run these cores for a part of the month. As such, it is to your advantage to purchase commitments only in increments you know you will use.
Committed use discounts apply to vCPUs and memory simultaneously. You cannot buy a committed use discount for vCPUs or memory independently. As with custom machine types, when you buy a committed use discount, you must purchase memory in specific increments.
Commitments cannot be stacked for burst scenarios. For example, if you purchased 10 cores for the month and then ran 20 cores for half the month, commitments would not apply for the full 20 cores just because the usage was half the month.
Committed use discounts are subject to Google Cloud commitment-based pricing and billing. By purchasing a committed use discount, you agree to these terms. Committed use discounts do not renew so you must create a new commitment to continue receiving discounts.
Specifications
You can only purchase commitments if you have quota for commitments. Check the Quotas page to ensure you have enough quota to create a commitment. If commitments are not listed on the quotas page or you require additional quota, request a quota increase.
Commitments must be purchased on a per-region basis.
To use the
gcloud
tool to manage commitments, you must be runninggcloud
version 147.0.0 or later. To update thegcloud
tool to the latest version:gcloud components update
To check the version of the
gcloud
tool you are running:gcloud version
Any remaining vCPUs and memory that are not covered by committed use discounts will be eligible for sustained use discounts.
Restrictions
- Committed use discounts automatically apply to VMs by Google Kubernetes Engine, Dataproc, and Compute Engine. Committed use discounts do not apply to VMs created using App Engine flexible environment, Dataflow, or Cloud SQL.
- Projects that are in the free tier period with free tier credit and projects that do not have any payment history do not qualify for committed use discounts.
- You can purchase commitments only on a per-region basis.
- Committed use discounts apply to usage in the project in which those discounts are purchased.
- Committed use discounts do not apply to preemptible VM instances, shared-core machine types, or extended memory.
- You must purchase commitments for vCPUs and memory together:
- For general-purpose commitments
- N1 machine types: You must purchase between 0.9 GB and 6.5 GB per vCPU. The total memory must be a multiple of 256 MB.
- N2 machine types: You must purchase between 0.5 GB to 8 GB per vCPU. The total memory must be a multiple of 256 MB.
- (Beta) E2 machine types: You must purchase between 0.5 GB to 8 GB per vCPU. The total memory must be a multiple of 256 MB.
- (Beta) For memory-optimized commitments, you must purchase between 14 GB and 40 GB per vCPU to accommodate the range of available memory-optimized machine types. The total memory must be a multiple of 256 MB.
- For compute-optimized commitments, you must purchase between 2 GB and 4 GB per vCPU to accommodate the range of available compute-optimized machine types. The total memory must be a multiple of 256 MB.
- For general-purpose commitments
- For committed use discounted pricing for GPUs and local SSDs, you must create a reservation when purchasing the commitment.
- If a reservation is attached to a committed use discount, the reservation cannot be deleted for the duration of the commitment.
- You can only buy a 1-year commitment on K80 GPUs.
Pricing
Committed use discount pricing for VM instances, with or without GPUs or local SSDs, differs depending on the region. See the Pricing page for current rates.
Commitment types
You can purchase commitments for the following resources.
Commitment types | Resources for which you can purchase discounts | Applicable to the following resource types |
---|---|---|
General-purpose N1 commitments |
|
|
General-purpose N2 commitments |
|
|
General-purpose (Beta) E2 commitments |
|
|
(Beta) Memory-optimized commitments |
|
m1-ultramem , m1-megamem , m2-ultramem |
Compute-optimized commitments |
|
c2-standard |
You cannot purchase commitments for f1-micro
,
g1-small
, e2-micro
, e2-small
, or e2-medium
machine types, or the
sole-tenant premium charge.
Commitments for machine types
Purchase the appropriate commitment type for the machine types you are using.
For example, if you plan to use any of the n1-standard
, n1-highmem
, or
n1-highcpu
machine types and want to purchase commitments for these machine
types, purchase a general-purpose commitment type.
General-purpose commitments
Purchase a general-purpose commitment type if you want the commitment to apply to custom machine types, sole-tenant nodes, or the predefined machine types. Depending on the machine type, you must purchase between a certain amount of memory per vCPU, inclusive:
- N1 machine types: Purchase between 0.9 GB and 6.5 GB of memory per vCPU
- N2 machine types: Purchase between 0.5 GB and 8 GB of memory per vCPU
- E2 machine types: Purchase between 0.5 GB and 8 GB of memory per vCPU
Discounts for general-purpose commitments are applied to resources in the following order:
- N1, N2, or E2 custom machine types, depending on which commitment you purchased.
- Sole-tenant nodes
- Either the N1, N2, or E2 predefined machine types, depending on which commitment you purchased.
When you purchase general-purpose commitments, you pick which generation the commitment applies to. For example, if you purchase general-purpose N1 commitments, they only apply to N1 machine types, and vice-versa if you purchase general-purpose N2 or E2 commitments. These two commitments never overlap.
For example, assume you have a region with the following mix:
- 10 N2 custom machine type vCPUs
- 30 GB of custom machine type memory
- 2
n2-standard-4
predefined machine types
You purchase N2 commitments for 15 vCPUs and 13.5 GB of memory for committed use. The committed use discounts would be applied first to the N2 custom machine types and any remaining discounts would be applied to the N2 predefined machine types. In this case, all 10 vCPUs of the N2 custom machine types would be charged at committed use prices and 13.5 GB of custom machine type memory would be charged at committed use prices.
Finally, the remaining 5 vCPUs of committed use would apply to 5 random vCPUs
across the two n2-standard-4 machine
types. Any resources that aren't
covered by committed use discounts would qualify for sustained use discounts.
Read Purchasing commitments for machine types to purchase a commitment for general-purpose machine types.
Memory-optimized commitments
Purchase memory-optimized commitments if you intend to use memory-optimized machine types. For memory-optimized machine types, you must purchase between 14 GB and 40 GB of memory per vCPU, inclusive.
When you purchase a memory-optimized commitment, the discount is applied without any ordering to the following machine types:
m1-ultramem
machine typesm1-megamem
machine typesm2-ultramem
machine types
Read Purchasing commitments for machine types to purchase a commitment for memory-optimized machine types.
Compute-optimized commitments
Purchase compute-optimized commitments if you intend to use compute-optimized
machine types. For compute-optimized machine types, you must purchase between
2 GB and 4 GB of memory per vCPU, inclusive. Compute-optimized machine
types include all of the c2-standard
machine types.
Read Purchasing commitments for machine types to purchase a commitment for compute-optimized machine types.
Commitments for GPUs and local SSD
To purchase commitments for GPUs or local SSDs, you must also reserve the resources when purchasing the commitment. Reserving these resources is required to ensure that the resources are always available for you (whether you use them or not). There are no additional charges for reserving the resources.
You must purchase commitments by specific GPU types. For example, you can purchase GPUs for either Tesla P100s or Tesla V100s, but you cannot purchase commitments for Tesla P100 GPUs and expect to apply them to other GPU types.
Read Purchasing commitments for GPUs and local SSD to purchase a commitment for GPUs and local SSDs.
To learn more about reservations, read Reserving zonal resources.
Committed and sustained use discounts
You cannot combine sustained use and committed use discounts. The two different discount types never apply to the same portion of a vCPU or GB of memory.
Resources that are not covered by committed use discounts will automatically qualify for sustained use discounts on a machine type family basis.
For example:
You run an n2-standard-2
for a portion of the month and run an n2-standard-8
for another portion of the same month, Compute Engine combines the two
and applies sustained use discounts for the portion not covered by committed use
discounts because both machine types belong to the n2-standard
family.
Requesting quota for commitments
You can only purchase commitments if you have quota for commitments. Check the Quotas page to ensure you have enough quota to create a commitment.
When making a request using the gcloud
tool or the API, the server
returns
the following error if you have no commitment quota:
"Quota 'COMMITMENTS' exceeded. Limit: 0.0"
To check quota in the console:
- Go to the Quota Information page in the Google Cloud Console.
- Expand the Quota type dropdown menu and select All quotas.
- Expand the Metric dropdown menu.
- Click None to hide all quotas and then type
commitments
in the search box to search for commitments quota. Select Commitments from the results list.
Check the quota for commitments in your desired region. If you do not have quota for commitments, the quota will list
0
.
To request quota for commitments
- Go to the Quota Increase page in the Google Cloud Console.
- Expand the Quota type dropdown menu and select All quotas.
- Expand the Metric dropdown menu.
- Click None to hide all quotas and then type
commitments
in the search box to search for commitments quota. Select Commitments from the results list.
Select the checkbox next to commitments for the desired region and click the Edit Quotas button.
If prompted, fill in your first and last name, and phone number. Click Next.
Fill out the request form and click Next.
Click Submit Request to submit your request.
Increasing committed resource quotas
If you do not have enough quota for COMMITTED CPUs, COMMITTED Local SSDs, or
COMMITTED GPUs (for example, for COMMITTED_NVIDIA_V100_GPUS
), request a quota
increase from the Quotas page. To utilize
the committment, you also need sufficient resource quota (for example,
NVIDIA_V100_GPUS
). You can request these quota increases at any time.
Purchasing commitments for machine types
Purchasing commitments for machine types can be done in the
Cloud Console, the gcloud
command-line tool, or
programmatically through the API. To purchase commitments for GPUs or local
SSDs, see
Purchasing commitments for GPUs and local SSDs.
After purchasing a commitment, the commitment is effective starting at midnight the following day. For example, a commitment purchased on Monday afternoon at 3 PM PST would be effective on Tuesday at 12 AM PST. The discounts will automatically be applied to applicable instances in the region you specified.
Once a commitment is purchased, you cannot cancel the commitment.
Console
- Go to the Committed Use Discounts page in the Cloud Console.
- Click Purchase Commitment to purchase a new commitment.
- Name your commitment and choose the region where you want it to apply.
- Choose the commitment type. Select either General-Purpose N1 for N1 types, General-Purpose N2 for N2 machine types, General-Purpose E2 for E2 machine types, Memory-optimized, or Compute-optimized.
- Choose a duration amount of the commitment, either 1 or 3 years.
Choose the input mode for the commitment:
(Recommended) Custom input allows you to customize the number of vCPUs and the of memory.
Basic input allows you to choose the number of vCPUs and Compute Engine will automatically populate the amount of memory for the number of vCPUs.
Enter the quantities of vCPU and memory that you want to purchase. Memory per vCPU must be a specific ratio depending on the discount type that you select. Depending on the type of the commitment, specify the following memory:
- General-purpose N1: Creates a commitment for N1 machine types. Use between 0.9 GB and 6.5 GB per vCPU.
- General-purpose N2: Creates a commitment for N2 machine types. Use between 0.5 GB and 8 GB per vCPU.
- (Beta) General-purpose E2: Creates a commitment for E2 machine types. Use between 0.5 GB and 8 GB per vCPU.
- Compute-optimized: Use between 2 GB and 4 GB per vCPU. The total memory must be a multiple of 256 MB.
- (Beta) Memory-optimized : Use between 14 GB and 40 GB per vCPU.
Click the Purchase button to purchase the commitment.
Read the terms of purchase and click Purchase again once you are ready to purchase the commitment.
gcloud
Using the gcloud
tool, run the
beta compute commitments create
command:
gcloud beta compute commitments create [COMMITMENT_NAME] --region [REGION] \
--resources vcpu=[NUMBER_VCPUS],memory=[MEMORY] --plan [DURATION] \
--type [COMMITMENT_TYPE]
where:
[COMMITMENT_NAME]
is the name you want to identify this commitment with.[REGION]
is the region this commitment applies to. Each region has different commitment prices. For current prices, see the price sheet.[NUMBER_VCPUS]
is the number of vCPUs you are willing to purchase commitments for. The number of vCPUs must be 1 or higher and can be even or odd.[MEMORY]
is the amount of memory inMB
orGB
you are willing to purchase commitments for. For example,1000MB
. If units are not specified, the default unit used isGB
. Depending on the type of the commitment, specify the following memory:general-purpose
: Creates a commitment for N1 machine types. Use between 0.9 GB and 6.5 GB per vCPU.general-purpose-n2
: Creates a commitment for N2 machine types. Use between 0.5 GB and 8 GB per vCPU.- (Beta)
general-purpose-e2
: Creates a commitment for E2 machine types. Use between 0.5 GB and 8 GB per vCPU. - (Beta)
memory-optimized
: Use between 14 GB and 40 GB per vCPU. compute-optimized
: Use between 2 GB and 4 GB per vCPU.
[DURATION]
is the term of the commitment, either12-month
or36-month
.[COMMITMENT_TYPE]
is one of:general-purpose
for general-purpose N1 machine type commitments.general-purpose-n2
for general-purpose N2 machine type commitments.- (Beta)
general-purpose-e2
for general-purpose E2 machine type commitments. - (Beta)
memory-optimized
for the memory-optimized commitments. compute-optimized
for compute-optimized commitments.If you do not specify this flag,
general-purpose
is the default value.
To create a general-purpose commitment for N1 machine types, you might use the following example:
gcloud compute commitments create example-commitment --region us-central1 \
--resources vcpu=5,memory=33280MB --plan 12-month
To create a compute-optimized commitment, use the
gcloud compute commitments create
command, which purchases a 1 year commitment for a compute-optimized machine type:
gcloud compute commitments create example-compute-optimized-commitment \
--region us-central1 --resources vcpu=2,memory=3814GB --plan 12-month \
--type compute-optimized
To create a memory-optimized commitment:
gcloud beta compute commitments create example-memory-optimized-commitment \
--region us-central1 --resources vcpu=96,memory=1434MB \
--plan 12-month --type memory-optimized
To create a GPU or local SSD commitment, you must
create a reservation when purchasing the commitment
using the gcloud compute commitments create
command.
For example, the following commitment includes 4 GPUs and a reservation for
those GPUs to be used in 2 instances in us-central1-a
.
gcloud compute commitments create example-reservation-commitment \ --region=us-central1 \ --resources=vcpu=96,memory=624GB \ --resources-accelerator=type=nvidia-tesla-v100,count=4 \ --plan 12-month \ --reservation=reservation-01 \ --reservation-zone=us-central1-a \ --machine-type=n1-standard-32 --accelerator=type=nvidia-tesla-v100,count=2 \ --vm-count=2
API
In the API, make a POST
request to the following URL, with a request
body that contains information about the commitment:
https://compute.googleapis.com/compute/beta/projects/[PROJECT_ID]/regions/[REGION]/commitments?requestId=[OPTIONAL_UNIQUE_ID]
The resource body should contain:
name
for the name of the commitment.plan
for the term of the commitment, eitherTWELVE_MONTH
orTHIRTY_SIX_MONTH
.resources
to specify the amount of memory and vCPU. Memory must be be specified in MB. You must specify bothVCPU
andMEMORY
in theresources
section.type
of commitment, eitherGENERAL_PURPOSE
,MEMORY_OPTIMIZED
,COMPUTE_OPTIMIZED
, orGENERAL_PURPOSE_N2
.
For example, the following creates a commitment for 1 year with 5 vCPUs and 18.75 GB of memory:
{
"name": "example-commitment",
"plan": "TWELVE_MONTH",
"type": "GENERAL_PURPOSE",
"resources": [
{
"amount": "5",
"type": "VCPU"
},
{
"amount": "19200",
"type": "MEMORY"
}
]
}
To create a memory-optimized commitment, use the Beta API and include
the type
property. The following example shows a purchase of a 1-year
commitment for an n1-megamem-96
machine type:
{
"name": "example-memory-optimized-commitment",
"plan": "TWELVE_MONTH",
"type": "MEMORY_OPTIMIZED",
"resources": [
{
"amount": "96",
"type": "VCPU"
},
{
"amount": "1434",
"type": "MEMORY"
}
]
}
To create a compute-optimized commitment, include the type
property. The
following example, purchases a 1 year commitment for a c2-standard-16
machine type:
{
"name": "example-compute-optimized-commitment",
"plan": "TWELVE_MONTH",
"type": "COMPUTE_OPTIMIZED",
"resources": [
{
"amount": "16",
"type": "VCPU"
},
{
"amount": "1434",
"type": "MEMORY"
}
]
}
Purchasing commitments for GPUs and local SSDs
To purchase a commitment for GPUs or local SSDs:
- You must purchase a general-purpose N1 commitment. GPUs are only supported with N1 machine types.
- You must create a reservation that includes either GPUs or local SSDs at the same time when you are purchasing your commitment.
- You do not need to commit to vCPUs or memory.
You must purchase commitments for specific GPU types. For example, you might purchase either Tesla P100s or Tesla V100s, but you cannot purchase commitments for Tesla P100 GPUs and expect to apply them to other GPU types.
The amount of GPUs and local SSDs that you reserve must be equal to the amount that you commit to. For example, if you want to reserve 4 V100 GPUs, then you must also commit to 4 V100 GPUs. However, the amount of vCPU and memory that you reserve can be more or less than what you commit to.
If you only want to commit to GPUs or local SSDs, you can specify 0
for vCPU
and memory commitments. But the reservation that you attach to your commitment
must contain the same GPUs and local SSDs as the commitment, as well as the
machine types (with vCPUs and memory) that you want to reserve.
Purchase a commitment with an attached reservation using the console, the
gcloud
tool, or the API.
Console
- Go to the Committed Use Discounts page in the Cloud Console.
- Click Purchase commitment to purchase a new commitment.
- Name your commitment and choose the region where you want it to apply.
- For Commitment type, select General Purpose.
- Choose a duration amount of the commitment, either 1 or 3 years.
Choose the input mode for the commitment:
(Recommended) Custom input allows you to customize the number of vCPUs and the of memory.
Basic input allows you to choose the number of vCPUs and Compute Engine will automatically populate the amount of memory for the number of vCPUs.
Enter the quantities of vCPU and memory that you want to purchase. Memory per vCPU must be a specific ratio depending on the discount type that you select. Use between 0.9 GB and 6.5 GB per vCPU for standard committed use discounts. The total memory must be a multiple of 256 MB.
If you only want to commit to and reserve GPUs or local SSDs without committing to vCPUs and memory, specify
0
for the vCPU and memory commitment quantities.Click Add GPUs and select the GPU type and Number of GPUs that you want to commit to.
Click Add local SSD and specify the number of disk that you want to commit to.
Click Add new reservation to create one or more reservations for instances that will use the GPUs and local SSDs.
- Name your reservation.
- Under Use with VM instance:
- If you want to use this reservation's resources only when creating matching instances that specifically target this reservation by name, select Select specific reservation.
- If you want matching instances to automatically use this reservation, select Use reservation automatically.
- Choose the Region and Zone where you want to reserve resources.
- Specify the Number of VM instances that you want to reserve.
- Specify the resources that you want to reserve for each instance:
- If you have an instance template, click Use instance template and select an instance template from the list.
- Otherwise, click Specify machine type.
- For predefined machine types, select what you need from the drop-down menu.
- For custom machine types, including minimum CPU platform, or to add GPUs, click Customize and make your selections.
- Optionally, specify the number of Local SSD disks that you want to add to each instance and specify the Interface type to use.
- Click the Done button to create the reservation.
Click the Purchase button to purchase the commitment.
Read the terms of purchase and click Purchase again once you are ready to purchase the commitment.
gcloud
Use the gcloud compute commmitments create
command to purchase a commitment, and include flags to create an attached
reservation.
For example, the following commitment includes 4 GPUs and a new reservation
for those 4 GPUs to be used across 2 n1-standard-32
instances in
us-central1-a
.
gcloud compute commitments create commitment-01 \ --region=us-central1 \ --resources=vcpu=96,memory=624GB \ --resources-accelerator=type=nvidia-tesla-v100,count=4 \ --plan 12-month \ --reservation=reservation-01 \ --reservation-zone=us-central1-a \ --machine-type=n1-standard-16 \ --accelerator=type=nvidia-tesla-v100,count=2 \ --vm-count=2
If you want to commit to and reserve GPUs or local SSDs without committing
to vCPUs and memory, specify 0
for the vCPU and memory commitment
quantities.
gcloud compute commitments create commitment-01 \ --region=us-west2 \ --resources=vcpu=0,memory=0 \ --resources-accelerator=type=nvidia-tesla-p4,count=1 \ --plan 12-month \ --reservation=reservation-01 \ --reservation-zone=us-west2-b \ --machine-type=n1-standard-1 \ --accelerator=type=nvidia-tesla-p4,count=1 \ --vm-count=1
To create multiple reservations when purchasing a commitment, use a YAML file. For example:
gcloud compute commitments create commitment-01 \ --region=us-central1 \ --resources=vcpu=96,memory=624,local-ssd=750 \ --resources-accelerator=type=nvidia-tesla-v100,count=1 \ --plan 12-month \ --reservations-from-file=[YAML_FILE]
Where [YAML_FILE]
contains the reservation properties.
For example, the following YAML file contains 2 reservations. The first
reservation, res-01
, contains 1 n1-standard-1
instance with 1 GPU, and
it is a targeted reservation, which means that you must specifically target
that reservation by name to use its reserved instances. The second
reservation, res-02
, contains 1 n1-standard-1
VM instance with 2 types
of attached local SSDs.
- reservation: res-01
reservation_zone: us-central1-a
require_specific_reservation: true
vm_count: 1
machine_type: n1-standard-1
accelerator:
- count: 1
type: nvidia-tesla-v100
- reservation: res-02
reservation_zone: us-central1-a
vm_count: 1
machine_type: n1-standard-1
local_ssd:
- interface: scsi
size: 375
- interface: nvme
size: 375
API
Use the regionCommitments.insert
API and include the reservations
field to define the reservation's
properties. For example, the following commitment includes 4 GPUs and a
reservation for those 4 GPUs to be used across 2 instances in
us-central1-a
.
POST https://compute.googleapis.com/compute/v1/projects/[PROJECT_ID]/regions/[REGION]/commitments { "name": "commitment-01", "plan": "TWELVE_MONTH", "resources": [ { "amount": "96", "type": "VCPU" }, { "amount": "638976", "type": "MEMORY" }, { "acceleratorType": "nvidia-tesla-v100", "amount": "4", "type": "ACCELERATOR" } ], "reservations": [ { "name": "reservation-01", "specificReservation": { "count": "2", "instanceProperties": { "guestAccelerators": [ { "acceleratorCount": 2, "acceleratorType": "nvidia-tesla-v100" } ], "machineType": "n1-standard-8" } }, "specificReservationRequired": false, "zone": "us-central1-a" } ] }
If you only want to commit to and reserve GPUs or local SSDs without
committing to vCPUs and memory, specify 0
for the VCPU
and MEMORY
commitment amounts. For example:
POST https://compute.googleapis.com/compute/v1/projects/[PROJECT_ID]/regions/[REGION]/commitments { "name": "commitment-01", "plan": "TWELVE_MONTH", "resources": [ { "amount": "0", "type": "VCPU" }, { "amount": "0", "type": "MEMORY" }, { "acceleratorType": "nvidia-tesla-v100", "amount": "4", "type": "ACCELERATOR" } ], "reservations": [ { "name": "reservation-01", "specificReservation": { "count": "2", "instanceProperties": { "guestAccelerators": [ { "acceleratorCount": 2, "acceleratorType": "nvidia-tesla-v100" } ], "machineType": "n1-standard-8" } }, "specificReservationRequired": false, "zone": "us-central1-a" } ] }
The commitment will be successfully created only if there are enough resources in the target zone, and sufficient quota, at the time of the request.
When you create a commitment with an attached reservation, you cannot delete the reservation for the duration of the commitment. When your commitment expires, Compute Engine automatically deletes any attached reservations.
If you need to transfer GPUs or local SSDs across committed reservations, see Modifying reservations that are attached to commitments.
Combining reservations with commitments
A committed use discount provides a 1- or 3-year discounted price agreement, but it does not reserve capacity in a specific zone. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. By combining a reservation with a commitment, you get discounted, reserved resources.
To purchase a commitment and get discounted prices for GPUs and local SSDs, create a reservation when purchasing the commitment. For these resources, the location and size of the reservation cannot be changed for the duration of your commitment.
For information about reservations, see Combining reservations with committed use discounts.
Modifying a commitment
After you purchase a commitment, you cannot change it. If you need to modify a commitment, purchase a new commitment with a new expiration date for the incremental amount.
For example, if you want to increase the amount of vCPUs for a commitment from 10 vCPUs to 15 vCPUs, purchase a new commitment for the difference. In this case, purchase a new commitment for 5 vCPUs.
You cannot decrease the resources already purchased in a commitment. For example, you cannot change a commitment for 15 vCPUs to 10 vCPUs.
Viewing active commitments
View commitments in the console or the API.
Console
View a list of commitments in the Committed use discounts page in the Google Cloud Console.
gcloud
Make a request using the commitments list
command:
gcloud compute commitments list
The tool returns a list of commitments:
NAME REGION END_TIMESTAMP STATUS my-commitment us-east1 2018-03-17T00:00:00.000-07:00 NOT_YET_ACTIVE
API
You can get a list of commitments across all regions by making an
aggregatedList
request
to the following URL:
https://compute.googleapis.com/compute/v1/projects/[PROJECT_ID]/aggregated/commitments
Which returns a list of commitments:
"commitments": [ { "kind": "compute#commitment", "id": "3294122326373778983", "creationTimestamp": "2017-02-09T15:18:32.411-08:00", "name": "example-commitment", "region": "https://compute.googleapis.com/compute/v1/projects/example-project/regions/us-central1", "selfLink": "https://compute.googleapis.com/compute/v1/projects/example-project/regions/us-central1/commitments/example-commitment", "status": "NOT_YET_ACTIVE", "statusMessage": "The commitment is not yet active (its startTimestamp is in the future). It will not apply to current resource usage.", "plan": "TWELVE_MONTH", "startTimestamp": "2017-02-10T00:00:00.000-08:00", "endTimestamp": "2018-02-10T00:00:00.000-08:00", "resources": [ { "type": "VCPU", "amount": "5" }, { "type": "MEMORY", "amount": "32500" }] } ]
A commitment can have one of the following statuses:
CREATING
: The commitment is being created.NOT_YET_ACTIVE
: The commitment has been created but is not yet active. Commitments are effective at midnight the following day.ACTIVE
: The commitment is active.EXPIRED
: The commitment has expired. Compute Engine reserves the right to remove expired commitments older than 210 days from the expiration date.
Canceling a commitment
After you create a commitment, it is not possible to cancel it. You must pay the agreed upon monthly amount for the duration of the commitment. Commitments are not affected by future pricing changes to the standard prices for Compute Engine resources.
If you accidentally purchased a commitment or made a mistake configuring your commitment, contact Google Cloud Billing Support for help.
Understanding your bill with committed use discounts
Google Cloud uses a balance sheet billing format. On your bill, the full charges for your resources appear as a line item, followed by credits to offset the amount that is actually covered by committed use, and then finally, the committed use charges you would actually pay. Use the following example bills to understand the charges on your own bill.
Example
In this scenario, the customer has purchased a commitment that covers all their usage. Row A displays the standard (non-committed use) charges for these resources. Row B are credits that fully offset row A because all usage is covered by a commitment. Row C is the discounted committed use price that the customer is actually charged. The total bill amount is the sum of debits minus the credits. In this case, the final bill amount is $7.17 because a commitment covered all usage.
Example
In this scenario, the customer purchased commitments that cover a portion of their bill. Row A.1 and A.2 show the standard (non-committed use) charges for vCPU and memory. Row B.1 and B.2 show credits that offset the portion of charges that are covered by committed use. Row C.1 and C.2 show the discounted committed use price for the portion of resources described in rows B.1 and B.2. The total of this bill is the sum of the committed use charges in rows C.1 and C.2 and the remaining portion of the bill that isn't covered by committed usage.
Support
If you have any questions regarding committed use discounts on your bill, you can contact Google Cloud support.
What's next
- Create some instances with custom machine types.
- Review the pricing information for committed use discounts.