Consume reservations
Stay organized with collections
Save and categorize content based on your preferences.
This document explains how to consume reservations in Compute Engine. To learn
how to consume reservations in other Google Cloud products, see the following
documentation:
After you create a reservation, or Compute Engine automatically creates
a reservation for you to fulfill a future reservation, Compute Engine
holds your reserved resources for you. You can then use those reserved resources
to create Compute Engine instances that match the reservation's
properties. This action is known as consuming a reservation. You can use your
reserved capacity for creating instances until the reservation is
fully consumed.
Limitations
You can't consume a reservation to create the following Compute Engine
resources:
Flex-start VMs
Spot VMs or preemptible instances
Sole-tenant nodes
Before you begin
If you haven't already, set up authentication.
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:
To use the Go samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
To use the Java samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
To use the Node.js samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
To use the Python samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
To consume a shared reservation from a consumer project:
Compute Instance Admin (v1) (roles/compute.instanceAdmin.v1)
on the owner project and the consumer project
These predefined roles contain
the permissions required to consume reservations. To see the exact permissions that are
required, expand the Required permissions section:
Required permissions
The following permissions are required to consume reservations:
To create reservations:
compute.reservations.create on the project
To create instances:
compute.instances.create on the project
To use a custom image to create the VM: compute.images.useReadOnly on the image
To use a snapshot to create the VM: compute.snapshots.useReadOnly on the snapshot
To use an instance template to create the VM: compute.instanceTemplates.useReadOnly on the instance template
To assign a legacy network to the VM: compute.networks.use on the project
To specify a static IP address for the VM: compute.addresses.use on the project
To assign an external IP address to the VM when using a legacy network: compute.networks.useExternalIp on the project
To specify a subnet for the VM: compute.subnetworks.use on the project or on the chosen subnet
To assign an external IP address to the VM when using a VPC network: compute.subnetworks.useExternalIp on the project or on the chosen subnet
To set VM instance metadata for the VM: compute.instances.setMetadata on the project
To set tags for the VM: compute.instances.setTags on the VM
To set labels for the VM: compute.instances.setLabels on the VM
To set a service account for the VM to use: compute.instances.setServiceAccount on the VM
To create a new disk for the VM: compute.disks.create on the project
To attach an existing disk in read-only or read-write mode: compute.disks.use on the disk
To attach an existing disk in read-only mode: compute.disks.useReadOnly on the disk
To create instance templates:
compute.instanceTemplates.create on the project
The examples in the following sections show how to consume a reservation by
creating a single compute instance. You can also consume reservations by
creating instances that match the reservations' properties using a different
deployment option, or by
updating the properties of existing instances to match automatically consumed
reservations.
To consume a reservation, use one of the following methods:
Automatically consumed reservations allow any compute instances that match the
reservation's properties to automatically consume it. This consumption behavior
applies to both new and existing, running instances. When you create
reservations, or Compute Engine automatically creates a reservation to
fulfill a future reservation, this reservation type is the default setting.
If the properties of a single-project, automatic reservation and a shared,
automatic reservation match, then the instances in your project consume the
single-project reservation first, and then they consume the shared reservation.
For more information, see the
consumption order for reservations.
To create and consume an example automatic reservation, select one of the
following options:
Specifically targeted reservations allow new compute instances that match the
reservation's properties and target the reservation to consume it. Instances are
successfully created only if their properties match the reservation properties.
Otherwise, you encounter errors.
Based on the creation method that you want to use, create specific reservations
and instances that target them as follows:
When you create instances to consume the reservation
Google Cloud console
In the Use with VM instance section, select
Select specific reservation.
In the Advanced pane, in the Reservations section,
select Choose a reservation. Then, follow the prompts to select a
reservation.
Google Cloud CLI
Include the --require-specific-reservation flag.
Include the following flags:
The --reservation-affinity flag set to
specific.
The --reservation flag set to the resource path to
the reservation, formatted as
projects/OWNER_PROJECT_ID/reservations/RESERVATION_NAME.
Go
Include the SpecificReservationRequired field set to
true.
In the ReservationAffinity field, include the following
fields:
The ConsumeReservationType field set to
SPECIFIC_RESERVATION.
The Key field set to
compute.googleapis.com/reservation-name.
The Values field set to the resource path to the
reservation, formatted as
projects/OWNER_PROJECT_ID/reservations/RESERVATION_NAME.
Java
Include the setSpecificReservationRequired field set to
true.
In the ReservationAffinity field, include the following
fields:
The setConsumeReservationType field set to
SPECIFIC_RESERVATION.
The setKey field set to
compute.googleapis.com/reservation-name.
The addValues field set to the resource path to the
reservation, formatted as
projects/OWNER_PROJECT_ID/reservations/RESERVATION_NAME.
Node.js and REST API
Include the specificReservationRequired field set to
true.
In the reservationAffinity field, include the following
fields:
The consumeReservationType field set to
SPECIFIC_RESERVATION.
The key field set to
compute.googleapis.com/reservation-name.
The values field set to a list that contains a
single item with the resource path to the reservation, formatted as
projects/OWNER_PROJECT_ID/reservations/RESERVATION_NAME.
Python
Include the specific_reservation_required field set to
true.
In the reservation_affinity field, include the following
fields:
The consume_reservation_type field set to
SPECIFIC_RESERVATION.
The key field set to
compute.googleapis.com/reservation-name.
The values field set to the resource path to the
reservation, formatted as
projects/OWNER_PROJECT_ID/reservations/RESERVATION_NAME.
Terraform
Include the specific_reservation_required field set to
true.
In the reservation_affinity field, include the following
fields:
The type field set to
SPECIFIC_RESERVATION.
The specific_reservation field, which includes the
following fields:
The key field set to
compute.googleapis.com/reservation-name.
The values field set to a list that contains a
single item with the resource path to the reservation, formatted
as
projects/OWNER_PROJECT_ID/reservations/RESERVATION_NAME.
To create an example specific reservation and an instance to consume it, select
one of the following options:
Consume an auto-created reservation for a request in calendar mode
This reservation type allows new compute instances to consume a reservation that
Compute Engine automatically creates (auto-creates) to fulfill a
future reservation in calendar mode.
To consume this type of reservation, you must create an instance as follows:
In the Google Cloud console, if you specify a supported machine type
for future reservations in calendar mode, then the reservation-bound
model is automatically selected.
In the gcloud CLI, include the --provisioning-model flag
set to reservation-bound.
In the REST API, include the provisioningModel field set to
RESERVATION_BOUND.
The following example creates a future reservation request in calendar mode for
A3 Ultra instances. The example also shows the fields to specify when you create
a standalone A3 Ultra instance to consume the auto-created reservation for the
request.
To consume the example auto-created reservation, select one of the following
options:
To check the current reservation usage and see the number of instances that
are consuming a reservation, and how many more instances can consume it,
view reservations.
To monitor reservations consumption data, which updates every 30 minutes,
and receive alerts when reservations are consumed,
monitor reservations consumption.
To analyze reservation consumption by using Cloud Billing data exported
to BigQuery, see the following examples:
To view reservations consumption data, which updates every 24 hours, do
one of the following:
To receive consumption reports in a Cloud Storage bucket to analyze
consumption trends and identify unconsumed reservations,
view reservations usage report.
To analyze consumption trends and plan for future capacity needs by
viewing past and forecasted reservation consumption,
use Capacity Planner.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-07-17 UTC."],[],[]]