Modify reservations

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

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.update on the project
  • To modify the number of instances in a reservation: compute.reservations.resize on 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 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

  1. In the Google Cloud console, go to theReservations page.

    Go to Reservations

  2. 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.

  3. In theAuto-delete time row, clickEdit auto-delete time.

  4. In theUpdate reservation pane, do one of the following:

    • To delete the reservation at a specific date and time, do thefollowing:

      1. If the auto-delete option isn't already enabled, click theEnable auto-delete toggle to the on position.

      2. 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.

  5. 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 thegcloud beta compute reservations update commandwith the--delete-at-time flag.

    gcloud beta compute reservations updateRESERVATION_NAME \    --delete-at-time=DELETE_AT_TIME \    --zone=ZONE

    Replace 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 thegcloud beta compute reservations update commandwith the--delete-after-duration flag.

    gcloud beta compute reservations updateRESERVATION_NAME \    --delete-after-duration=DELETE_AFTER_DURATION \    --zone=ZONE

    Replace 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, specify30m for 30 minutes, or1d2h3m4s for 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=ZONE

Replace 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 aPATCHrequest to thebeta.reservations.update method.In the request URL, include thepaths query 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 aPATCHrequest to thebeta.reservations.update method.In the request URL, include thepaths query 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,specify86400 for 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=deleteAfterDuration

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.

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

  1. In the Google Cloud console, go to theReservations page.

    Go to Reservations

  2. 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.

  3. ClickEdit.

  4. 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:

      1. ClickAdd projects.

      2. 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.

      3. ClickSelect.

  5. 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 thegcloud compute reservations update commandwith the--add-share-with flag.

    gcloud compute reservations updateRESERVATION_NAME \    --add-share-with=CONSUMER_PROJECT_IDS \    --zone=ZONE

    Replace 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 thegcloud compute reservations update commandwith the--remove-share-with flag.

    gcloud compute reservations updateRESERVATION_NAME \    --remove-share-with=CONSUMER_PROJECT_IDS \    --zone=ZONE

    Replace 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 thegcloud beta compute reservations update commandwith the--share-with flag.

    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=ZONE

    Replace 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 aPATCH request to thereservations.update method.In the request URL, include thepaths=shareSettings.projectMap.PROJECT_ID queryparameter for each project that you want to share the reservation with.

    For example, to allow two projects to consume a shared reservation, makeaPATCH request 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_1 andCONSUMER_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 aPATCH request to thereservations.update method.In the request URL, include thepaths=shareSettings.projectMap.PROJECT_ID queryparameter for each project that you want stop sharing the reservationwith. Additionally, you must omit theshareSetting field from therequest body.

    For example, to stop allowing two projects to consume a sharedreservation, make aPATCH request 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_1 andCONSUMER_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 modify the number of reserved instances in a reservation, select one of thefollowing options:

Console

  1. In the Google Cloud console, go to theReservations page.

    Go to Reservations

  2. 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.

  3. ClickEdit.

  4. In theNumber of VM instances field, enter the updated number ofinstances to reserve.

  5. 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=ZONE

Replace 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

  1. In the Google Cloud console, go to theReservations page.

    Go to Reservations

  2. 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.

  3. In theShare with other Google Cloud services row, clickEdit service sharing settings.

  4. 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.

  5. 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=ZONE

Replace 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_ALL

    • To 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_ALL

    • To 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:

  1. Create a newsingle-projectorshared reservationwith updated properties.

  2. If you don't need the original reservation anymore, thendelete the reservation.

Troubleshoot

Learn how totroubleshoot issues with reservation updates.

What's next

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.