Modify reservations Stay organized with collections Save and categorize content based on your preferences.
This document explains how to modify reservations. To modify reservations thatare attached to commitments, seeReplace reservations that are attached to commitmentsinstead.
Modify a reservation when, for example, your capacity needs change or you wantto change which workloads can consume a reservation.
Limitations
Before you modify a reservation, consider the following:
You can modify a shared reservation only in the same project where youcreated it.
You can modify an auto-created reservation only after the following:
For a future reservation created in AI Hypercomputer, you canmodify the reservation only after its start time.
For a future reservation created in Compute Engine, you can modify thereservation only after its end time.
You can modify an auto-created reservation for a future reservation inAI Hypercomputer only toallow or disallow Vertex AI jobs from consuming it.
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.
Required roles
To get the permissions that you need to modify reservations, ask your administrator to grant you theCompute Admin (roles/compute.admin) IAM role on the project. For more information about granting roles, seeManage access to projects, folders, and organizations.
This predefined role contains the permissions required to modify reservations. To see the exact permissions that are required, expand theRequired permissions section:
Required permissions
The following permissions are required to modify reservations:
- To modify the auto-delete option in a reservation, the consumer projects in a shared reservation, or whether Vertex AI jobs can consume a reservation of instances with attached GPUs:
compute.reservations.updateon the project - To modify the number of instances in a reservation:
compute.reservations.resizeon the project
You might also be able to get these permissions withcustom roles or otherpredefined roles.
Modify reservations
Based on the properties that you want to modify in a reservation, use one of thefollowing methods:
To enable or disable the automatic deletion of a reservation, or change thedate and time when Compute Engine automatically deletes thereservation,modify the automatic deletion of a reservation.
To add or remove consumer projects that can consume a shared reservation,modify the consumer projects in a shared reservation.
To increase or decrease the number of reserved Compute Engineinstances in a reservation,modify the number of reserved compute instances in a reservation.
To allow or disallow a reservation of GPU instances to be consumed by customtraining jobs or prediction jobs in Vertex AI,modify the sharing policy of a reservation.
To change any properties that aren't mentioned in this list, you must create anew reservation. For instructions, seeChange other properties in a reservationin this document.
Modify the automatic deletion of a reservation
Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.
You can modify when Compute Engine automatically deletes an existingreservation by doing one of the following:
Enable theauto-delete optionor change when the reservation is automatically deleted.
Disable the auto-delete option.
To modify the automatic deletion of a reservation, select one of the followingoptions:
Console
In the Google Cloud console, go to theReservations page.
On theOn-demand reservations tab (default), in theName column,click the name of the reservation that you want to to modify.
The details page of the reservation opens.
In theAuto-delete time row, clickEdit auto-delete time.
In theUpdate reservation pane, do one of the following:
To delete the reservation at a specific date and time, do thefollowing:
If the auto-delete option isn't already enabled, click theEnable auto-delete toggle to the on position.
In theAuto-delete time field, enter a date and time whenCompute Engine automatically deletes the reservation.
Otherwise, click theEnable auto-delete toggle to the offposition.
ClickSubmit.
Modifying your reservation might take a few seconds to complete.
gcloud
When you enable the auto-delete option in a reservation, you can specify adate and time when the reservation should be deleted or specify a durationafter which the reservation should be deleted.
To enable the auto-delete option or change when the reservation should bedeleted, do one of the following:
To delete the reservation at a specific date and time, use the
gcloud beta compute reservations updatecommandwith the--delete-at-timeflag.gcloud beta compute reservations updateRESERVATION_NAME \ --delete-at-time=DELETE_AT_TIME \ --zone=ZONEReplace the following:
RESERVATION_NAME: the name of an existingreservation.DELETE_AT_TIME: a date and time formatted as anRFC 3339 timestamp.ZONE: the zone where the reservation is located.
To delete the reservation after a specific duration, use the
gcloud beta compute reservations updatecommandwith the--delete-after-durationflag.gcloud beta compute reservations updateRESERVATION_NAME \ --delete-after-duration=DELETE_AFTER_DURATION \ --zone=ZONEReplace the following:
RESERVATION_NAME: the name of an existingreservation.DELETE_AFTER_DURATION: a duration in days, hours,minutes, or seconds before the reservation is automatically deleted.For example, specify30mfor 30 minutes, or1d2h3m4sfor 1 day,2 hours, 3 minutes, and 4 seconds.ZONE: the zone where the reservation is located.
To disable the auto-delete option, use thegcloud beta compute reservations update commandwith the--disable-auto-delete flag.
gcloud beta compute reservations updateRESERVATION_NAME \ --disable-auto-delete \ --zone=ZONEReplace the following:
RESERVATION_NAME: the name of an existingreservation.ZONE: the zone where the reservation is located.
REST
When you enable the auto-delete option in a reservation, you can specify adate and time when the reservation should be deleted or specify a durationafter which the reservation should be deleted.
To enable the auto-delete option or change when the reservation should bedeleted, do one of the following:
To delete the reservation at a specific date and time, make a
PATCHrequest to thebeta.reservations.updatemethod.In the request URL, include thepathsquery parameter set todeleteAtTime.PATCH https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/reservations/RESERVATION_NAME?paths=deleteAtTime{ "name": "RESERVATION_NAME", "deleteAtTime": "DELETE_AT_TIME"}Replace the following:
PROJECT_ID: the ID of the project where thereservation is located.ZONE: the zone where the reservation is located.RESERVATION_NAME: the name of an existingreservation.DELETE_AT_TIME: a date and time formatted as anRFC 3339 timestamp.
To delete the reservation after a specific duration, make a
PATCHrequest to thebeta.reservations.updatemethod.In the request URL, include thepathsquery parameter set todeleteAfterDuration.seconds.PATCH https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/reservations/RESERVATION_NAME?paths=deleteAfterDuration.seconds{ "name": "RESERVATION_NAME", "deleteAfterDuration": { "seconds": "DELETE_AFTER_DURATION" }}Replace the following:
PROJECT_ID: the ID of the project where thereservation is located.ZONE: the zone where the reservation is located.RESERVATION_NAME: the name of an existingreservation.DELETE_AFTER_DURATION: a duration in secondsbefore the reservation is automatically deleted. For example,specify86400for 86,400 seconds (1 day).
To disable the auto-delete option, make aPATCH request to thebeta.reservations.update method.In the request, specify thepaths=deleteAtTime&paths=deleteAfterDuration query parameter and omit therequest body.
PATCH https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/reservations/RESERVATION_NAME?paths=deleteAtTime&paths=deleteAfterDurationReplace the following:
PROJECT_ID: the ID of the project where thereservation is located.ZONE: the zone where the reservation is located.RESERVATION_NAME: the name of an existingreservation.
Modify the consumer projects in a shared reservation
To avoid errors when you modify the consumer projects for a shared reservation,consider the following:
Removal of projects: you can disallow consumer projects from consuming ashared reservation only if no compute instances in those projects consumethe reservation. To stop instances from consuming a reservation,stop ordelete the instances.
Addition of projects: you can allow consumer projects to consume ashared reservation only if these projects are in the same organization asthe owner project. To migrate a project to the owner project's organization,seeMigrating projects between organization resourcesin the Resource Manager documentation.
After you modify the consumer projects for a shared reservation, the consumptionof the reservation might change. For example, if you configured the reservationto let any matching instances consume it (the default configuration), then anynewly added consumer projects might immediately start consuming the reservation.To learn more about which matching reservations projects consume first, see thereservations consumption order.
To modify the consumer projects that can consume a shared reservation, selectone of the following options:
Console
In the Google Cloud console, go to theReservations page.
On theOn-demand reservations tab (default), in theName column,click the name of the reservation you want to describe.
The details page for the reservation opens.
ClickEdit.
In theSelected projects section, do one of the following:
To stop sharing the reservation with a specific consumer project,clickDelete.
To start sharing the reservation with one or more specific projects,do the following:
ClickAdd projects.
Select the checkbox for each project from the owner project'sorganization that you want to share the reservation with. Youcan share a shared reservation with up to 100 consumer projects.
ClickSelect.
To confirm your changes, clickSave.
Modifying your reservation might take a few seconds to complete.
gcloud
When you modify the consumer projects for a shared reservation, you mustspecify a comma-separated list of IDs of projects that you want to allow, orstop allowing, to consume the shared reservation. These projects must be inthe same organization as the owner project. Don't specify the owner projectin the list. By default, it's already allowed to consume the sharedreservation.
To modify the consumer projects for a shared reservation, do one of thefollowing:
To allow one or more projects to consume a shared reservation, use the
gcloud compute reservations updatecommandwith the--add-share-withflag.gcloud compute reservations updateRESERVATION_NAME \ --add-share-with=CONSUMER_PROJECT_IDS \ --zone=ZONEReplace the following:
RESERVATION_NAME: the name of an existing sharedreservation.CONSUMER_PROJECT_IDS: a comma-separated list ofIDs of projects to share the reservation with—for example,project-1,project-2. You can share a shared reservation with up to100 consumer projects.ZONE: the zone where the shared reservation islocated.
To stop allowing one or more projects to consume a shared reservation,use the
gcloud compute reservations updatecommandwith the--remove-share-withflag.gcloud compute reservations updateRESERVATION_NAME \ --remove-share-with=CONSUMER_PROJECT_IDS \ --zone=ZONEReplace the following:
RESERVATION_NAME: the name of an existing sharedreservation.CONSUMER_PROJECT_IDS: a comma-separated list ofIDs of projects that you want to stop sharing the reservationwith—for example,project-1,project-2.ZONE: the zone where the shared reservation islocated.
To replace the list of projects that can consume a shared reservation,use the
gcloud beta compute reservations updatecommandwith the--share-withflag.Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.
gcloud beta compute reservations updateRESERVATION_NAME \ --share-with=CONSUMER_PROJECT_IDS \ --zone=ZONEReplace the following:
RESERVATION_NAME: the name of an existing sharedreservation.ZONE: the zone where the shared reservation islocated.CONSUMER_PROJECT_IDS: a comma-separated list ofIDs of projects to share the reservation with—for example,project-1,project-2. You can share a shared reservation with up to100 consumer projects.
REST
When you modify the consumer projects for a shared reservation, you mustspecify the IDs of the projects that you want to allow, or stop allowing, toconsume the shared reservation. These projects must be in the sameorganization as the owner project. Don't specify the owner project. Bydefault, it's already allowed to consume the shared reservation.
To modify the consumer projects for a shared reservation, do one of thefollowing:
To allow one or more projects to consume a shared reservation, make a
PATCHrequest to thereservations.updatemethod.In the request URL, include thepaths=shareSettings.projectMap.PROJECT_IDqueryparameter for each project that you want to share the reservation with.For example, to allow two projects to consume a shared reservation, makea
PATCHrequest as follows. You can share a shared reservation with upto 100 consumer projects.PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/reservations/RESERVATION_NAME?paths=shareSettings.projectMap.CONSUMER_PROJECT_ID_1&paths=shareSettings.projectMap.CONSUMER_PROJECT_ID_2{ "name": "RESERVATION_NAME", "shareSetting": { "projectMap": { "CONSUMER_PROJECT_ID_1": { "projectId": "CONSUMER_PROJECT_ID_1" }, "CONSUMER_PROJECT_ID_2": { "projectId": "CONSUMER_PROJECT_ID_2" } } }}Replace the following:
PROJECT_ID: the ID of the owner project, which isthe project used to create the shared reservation.ZONE: the zone where the shared reservation islocated.RESERVATION_NAME: the name of an existing sharedreservation.CONSUMER_PROJECT_ID_1andCONSUMER_PROJECT_ID_2: the IDs of two projectsthat you want to share the reservation with.
To stop allowing one or more projects to consume a shared reservation,make a
PATCHrequest to thereservations.updatemethod.In the request URL, include thepaths=shareSettings.projectMap.PROJECT_IDqueryparameter for each project that you want stop sharing the reservationwith. Additionally, you must omit theshareSettingfield from therequest body.For example, to stop allowing two projects to consume a sharedreservation, make a
PATCHrequest as follows:PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/reservations/RESERVATION_NAME?paths=shareSettings.projectMap.CONSUMER_PROJECT_ID_1&paths=shareSettings.projectMap.CONSUMER_PROJECT_ID_2{ "name": "RESERVATION_NAME"}Replace the following:
PROJECT_ID: the ID of the owner project, which isthe project used to create the shared reservation.ZONE: the zone where the shared reservation islocated.RESERVATION_NAME: the name of an existing sharedreservation.CONSUMER_PROJECT_ID_1andCONSUMER_PROJECT_ID_2: the IDs of two projectsthat you want to stop sharing the reservation with.
Modify the number of reserved instances in a reservation
You can increase or decrease the number of reserved compute instances in areservation. However, before you modify the number of instances, consider thefollowing to avoid errors:
To increase the number of instances in any reservation, ensure thefollowing:
You can't exceed themaximum instance count for a reservation.
You must have enough unused quota for the additional resources toreserve. To increase quota, seeView and manage quotas inthe Cloud Quotas documentation.
There must be enough resources available in the zone of the reservation.If not, then your request fails with a resource availability error. Totroubleshoot this error, seeTroubleshooting resource availability errors.
To decrease the number of instances in aspecific reservation,ensure that the number of instances that consume the reservation doesn'texceed the new, smaller number. If it does, then do one of the followingwith the instances in excess of the new number:
To modify the number of reserved instances in a reservation, select one of thefollowing options:
Console
In the Google Cloud console, go to theReservations page.
On theOn-demand reservations tab (default), in theName column,click the name of the reservation that you want to modify.
The details page for the reservation opens.
ClickEdit.
In theNumber of VM instances field, enter the updated number ofinstances to reserve.
To confirm, clickSave.
Modifying your reservation might take a few seconds to complete.
gcloud
To modify the number of reserved instances in a reservation, use thegcloud compute reservations update command.
gcloud compute reservations updateRESERVATION_NAME \ --vm-count=NUMBER_OF_VMS \ --zone=ZONEReplace the following:
RESERVATION_NAME: the name of an existing reservation.NUMBER_OF_VMS: the new number of instances to reserve.ZONE: the zone where the reservation is located.
REST
To modify the number of reserved instances in a reservation, make aPOSTrequest to thereservations.resize method.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/reservations/RESERVATION_NAME/resize{ "specificSkuCount": "NUMBER_OF_VMS"}Replace the following:
PROJECT_ID: the ID of the project where the reservationis located.ZONE: the zone where the reservation is located.RESERVATION_NAME: the name of an existing reservation.NUMBER_OF_VMS: the new number of instances to reserve.
Modify the sharing policy of a reservation
When you modify thesharing policyof a reservation of GPU compute instances, you control whetherVertex AI training or prediction jobs consume the reservation.
Before you disallow Vertex AI jobs from consuming a reservation,stop any Vertex AI jobs that use it. Otherwise, you encountererrors.
To modify the sharing policy of a reservation of GPU instances, select one ofthe following options:
Console
In the Google Cloud console, go to theReservations page.
On theOn-demand reservations tab (default), in theName column,click the name of the reservation of GPU instances that you want tomodify. A page that gives the details of the reservation appears.
In theShare with other Google Cloud services row, clickEdit service sharing settings.
In theReservation sharing pane, do one of the following:
To allow Vertex AI jobs to consume the reservation,selectShare reservation.
To disallow Vertex AI jobs to consume thereservation, selectDon't share reservation.
ClickSave.
Modifying your reservation might take a few seconds to complete.
gcloud
To modify the sharing policy of a reservation of GPU instances, use thegcloud compute reservations update commandwith the--reservation-sharing-policy flag.
gcloud compute reservations updateRESERVATION_NAME \ --reservation-sharing-policy=SHARING_POLICY \ --zone=ZONEReplace the following:
RESERVATION_NAME: the name of an existingreservation.SHARING_POLICY: the sharing policy of thereservation. Specify one of the following values:To allow Vertex AI jobs to consume the reservation:
ALLOW_ALLTo disallow Vertex AI jobs to consume thereservation:
DISALLOW_ALL
ZONE: the zone where the reservation exists
REST
To modify the sharing policy of a reservation of GPU instances, make aPATCH request to thereservations.update method.In the request URL, include thepaths query parameter set toreservationSharingPolicy.serviceShareType.
PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/reservations/RESERVATION_NAME?paths=reservationSharingPolicy.serviceShareType{ "name": "RESERVATION_NAME", "reservationSharingPolicy": { "serviceShareType": "SHARING_POLICY" }}Replace the following:
PROJECT_ID: the ID of the project where thereservation exists.ZONE: the zone where the reservation exists.RESERVATION_NAME: the name of an existingreservation.SHARING_POLICY: the sharing policy of thereservation. Specify one of the following values:To allow Vertex AI jobs to consume the reservation:
ALLOW_ALLTo disallow Vertex AI jobs to consume thereservation:
DISALLOW_ALL
Change other properties in a reservation
If you want to modify a property that isn't mentioned in theModify reservationssection, then you must create a replacement reservation instead.
To replace a reservation without risking an unintended reduction in yourreserved capacity, do the following:
Create a newsingle-projectorshared reservationwith updated properties.
If you don't need the original reservation anymore, thendelete the reservation.
Troubleshoot
Learn how totroubleshoot issues with reservation updates.
What's next
Learn how toview your reservations.
Learn how toconsume reservations.
Learn how todelete reservations.
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 2025-12-15 UTC.