Stay organized with collectionsSave and categorize content based on your preferences.
Work with legacy slot reservations
The BigQuery Reservation API lets you purchase dedicated slots (calledcommitments), create pools
of slots (calledreservations),
and assign projects, folders, and organizations to those reservations.
Reservations allow you to assign a dedicated number of slots
to a workload. For example, you might not want
a production workload to compete with test workloads for slots. You could
create a reservation namedprodand assign your production workloads to this
reservation. For more information, seeReservations.
Create reservations
Required permissions
To create a reservation, you need the following Identity and Access Management (IAM)
permission:
bigquery.reservations.createon theadministration projectthat maintains ownership of the commitments.
Each of the following predefined IAM roles includes this
permission:
In theReservation namefield, enter a name for the reservation.
In theLocationdrop-down list, select the location.
In theCapacity Modelsection, select the capacity model.
If you select theFlat-Rateoption, underBaseline slots, enter
the number of slots for the reservation.
In theMax reservation size selectorlist, select the maximum reservation size.
Optional: In theBaseline slotsfield, enter the number of baseline
slots for the reservation. To use only the specified slot capacity,
click theIgnore idle slotstoggle.
The amount of autoscaling slots available to you is determined by
subtracting the baseline slots value from the maximum reservation
size value. For example, if you create a reservation with 100 baseline
slots and a max reservation size of 400, your reservation has 300
autoscaling slots. For more information about baseline slots, seeUsing reservations with baseline and autoscaling
slots.
ADMIN_PROJECT_ID: the project ID of theadministration projectthat owns the reservation resource
LOCATION: thelocationof the reservation. If you select aBigQuery Omni
location, your edition
option is limited to the Enterprise edition.
RESERVATION_NAME: the name of the
reservation
It must start and end with a lowercase letter or a number
and contain only lowercase letters, numbers, and dashes.
NUMBER_OF_BASELINE_SLOTS: the number of baseline slots to
allocate to the reservation. You cannot set theslot_capacityoption and theeditionoption in the same reservation.
EDITION: the edition of the reservation. Assigning a reservation to an edition comes with feature and pricing changes. For more information, seeIntroduction to BigQuery editions.
NUMBER_OF_AUTOSCALING_SLOTS: the number of autoscaling slots assigned to the reservation. This is equal to the value of the max reservation size minus the number of baseline slots.
LOCATION: thelocationof the reservation. If you select aBigQuery Omni
location, your edition
option is limited to the Enterprise edition.
NUMBER_OF_BASELINE_SLOTS: the number of baseline slots to
allocate to the reservation
RESERVATION_NAME: the name of the reservation
EDITION: the edition of the reservation. Assigning a reservation to an edition comes with feature and pricing changes. For more information, seeIntroduction to BigQuery editions.
NUMBER_OF_AUTOSCALING_SLOTS: the number of autoscaling slots assigned to the reservation. This is equal to the value of the max reservation size minus the number of baseline slots.
For information about the--ignore_idle_slotsflag, seeIdle slots. The default
value isfalse.
# TODO(developer): Set project_id to the project ID containing the# reservation.project_id="your-project-id"# TODO(developer): Set location to the location of the reservation.# See: https://cloud.google.com/bigquery/docs/locations for a list of# available locations.location="US"# TODO(developer): Set reservation_id to a unique ID of the reservation.reservation_id="sample-reservation"# TODO(developer): Set slot_capicity to the number of slots in the# reservation.slot_capacity=100# TODO(developer): Choose a transport to use. Either 'grpc' or 'rest'transport="grpc"# ...fromgoogle.cloud.bigquery_reservation_v1.servicesimportreservation_servicefromgoogle.cloud.bigquery_reservation_v1.typesimport(reservationasreservation_types,)reservation_client=reservation_service.ReservationServiceClient(transport=transport)parent=reservation_client.common_location_path(project_id,location)reservation=reservation_types.Reservation(slot_capacity=slot_capacity)reservation=reservation_client.create_reservation(parent=parent,reservation=reservation,reservation_id=reservation_id,)print(f"Created reservation:{reservation.name}")
Update reservations
You can make the following updates to a reservation:
Change the reservation size by adding or removing slots.
Configure whether queries in this reservation use idle slots.
Change the amount of baseline or autoscaling slots allocated to a reservation.
Required permissions
To update a reservation, you need the following Identity and Access Management (IAM)
permission:
bigquery.reservations.updateon theadministration projectthat maintains ownership of the commitments.
Each of the following predefined IAM roles includes this
permission:
ADMIN_PROJECT_ID: the project ID of theadministration projectthat owns the reservation resource
LOCATION: thelocationof the reservation, for exampleeurope-west9.
RESERVATION_NAME: the name of the
reservation. It must start and end with a lowercase letter or a number
and contain only lowercase letters, numbers, and dashes.
NUMBER_OF_BASELINE_SLOTS: the number of baseline slots to
allocate to the reservation.
# TODO(developer): Set project_id to the project ID containing the# reservation.project_id="your-project-id"# TODO(developer): Set location to the location of the reservation.# See: https://cloud.google.com/bigquery/docs/locations for a list of# available locations.location="US"# TODO(developer): Set reservation_id to a unique ID of the reservation.reservation_id="sample-reservation"# TODO(developer): Set slot_capicity to the new number of slots in the# reservation.slot_capacity=50# TODO(developer): Choose a transport to use. Either 'grpc' or 'rest'transport="grpc"# ...fromgoogle.cloud.bigquery_reservation_v1.servicesimportreservation_servicefromgoogle.cloud.bigquery_reservation_v1.typesimport(reservationasreservation_types,)fromgoogle.protobufimportfield_mask_pb2reservation_client=reservation_service.ReservationServiceClient(transport=transport)reservation_name=reservation_client.reservation_path(project_id,location,reservation_id)reservation=reservation_types.Reservation(name=reservation_name,slot_capacity=slot_capacity,)field_mask=field_mask_pb2.FieldMask(paths=["slot_capacity"])reservation=reservation_client.update_reservation(reservation=reservation,update_mask=field_mask)print(f"Updated reservation:{reservation.name}")print(f"\tslot_capacity:{reservation.slot_capacity}")
Configure whether queries use idle slots
The--ignore_idle_slotsflag controls whether queries running in a reservation
can use idle slots from other reservations. For more information, seeIdle slots. You can update this
configuration on an existing reservation.
To update a reservation, use thebq updatecommand with the--reservationflag . The following example sets--ignore_idle_slotstotrue,
meaning the reservation will only use slots allocated to the reservation.
TheignoreIdleSlotsfield contains the configuration setting.
Delete reservations
When you delete a reservation, any jobs that are currently executing with slots
from that reservation will fail. To prevent errors, allow running jobs to
complete before deleting the reservation.
Required permissions
To delete a reservation, you need the following Identity and Access Management (IAM)
permission:
bigquery.reservations.deleteon theadministration projectthat maintains ownership of the commitments.
Each of the following predefined IAM roles includes this
permission:
# TODO(developer): Set project_id to the project ID containing the# reservation.project_id="your-project-id"# TODO(developer): Set location to the location of the reservation.# See: https://cloud.google.com/bigquery/docs/locations for a list of# available locations.location="US"# TODO(developer): Set reservation_id to a unique ID of the reservation.reservation_id="sample-reservation"# TODO(developer): Choose a transport to use. Either 'grpc' or 'rest'transport="grpc"# ...fromgoogle.cloud.bigquery_reservation_v1.servicesimportreservation_servicereservation_client=reservation_service.ReservationServiceClient(transport=transport)reservation_name=reservation_client.reservation_path(project_id,location,reservation_id)reservation_client.delete_reservation(name=reservation_name)print(f"Deleted reservation:{reservation_name}")
Add BigQuery Reservation API to VPC Service Controls
The BigQuery Reservation API supportsVPC Service Controls.
To integrate the BigQuery Reservation API with VPC Service Controls, follow the
instructions inCreate a service perimeter,
and add the BigQuery Reservation API to the protected services.
A service perimeter protects access to reservations, commitments, and
assignments within administration projects that are specified in the perimeter.
When creating an assignment, the VPC Service Controls protects the
administration project and assignee project, folder, and organization.
[[["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 2025-09-04 UTC."],[[["\u003cp\u003eThe BigQuery Reservation API allows you to purchase dedicated slots (commitments), create pools of slots (reservations), and assign projects, folders, and organizations to these reservations, enabling dedicated capacity for specific workloads.\u003c/p\u003e\n"],["\u003cp\u003eYou can create, update, and delete reservations using the Google Cloud console, SQL, \u003ccode\u003ebq\u003c/code\u003e command-line tool, or Python, and each method provides options for specifying baseline slots, max reservation size, and whether to ignore idle slots.\u003c/p\u003e\n"],["\u003cp\u003eUpdating a reservation allows you to change its size by adding or removing slots, adjust the allocation of baseline or autoscaling slots, and configure whether queries in the reservation can use idle slots from other reservations.\u003c/p\u003e\n"],["\u003cp\u003eDeleting a reservation will cause any currently running jobs using slots from that reservation to fail, so it is recommended to allow running jobs to finish before deleting a reservation.\u003c/p\u003e\n"],["\u003cp\u003eThe BigQuery Reservation API supports VPC Service Controls, allowing you to protect access to reservations, commitments, and assignments within specified administration projects.\u003c/p\u003e\n"]]],[],null,[]]