Disable graceful shutdown in a Compute Engine instance

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.

This document explains how to disable graceful shutdown in an existingCompute Engine instance. To learn more about graceful shutdown, including howto skip graceful shutdown for individual stop or delete operations, seeGraceful shutdown overview.

If you've enabled graceful shutdown in an instance, then you can disable it todo the following:

  • Speed up stop or delete operations to avoid unnecessary charges.

  • Update instance properties that require a restart.

Before you begin

Required roles

To get the permission that you need to disable graceful shutdown in a compute instance, ask your administrator to grant you theCompute Instance Admin (v1) (roles/compute.instanceAdmin.v1) IAM role on your project. For more information about granting roles, seeManage access to projects, folders, and organizations.

This predefined role contains thecompute.instances.update on the instance permission, which is required to disable graceful shutdown in a compute instance.

You might also be able to get this permission withcustom roles or otherpredefined roles.

Disable graceful shutdown in an instance

You can disable graceful shutdown in a compute instance without restarting theinstance. However, you can't disable graceful shutdown while the instance is inthe process of gracefully shutting down (PENDING_STOP).

To disable graceful shutdown in an instance, select one of the followingoptions:

Console

  1. In the Google Cloud console, go to theVM instances page.

    Go to VM instances

  2. In theName column, click the instance name to view its details.

    The details page of the instance opens andDetails tab is selected.

  3. ClickEdit.

  4. In theManagement section, clear theGracefully shut down the VMcheckbox.

  5. ClickSave.

gcloud

To disable graceful shutdown in an instance, use thegcloud beta compute instances update commandwith the--no-graceful-shutdown flag:

gcloud beta compute instances updateINSTANCE_NAME \    --no-graceful-shutdown \    --zone=ZONE

Replace the following:

  • INSTANCE_NAME: the name of the instance.

  • ZONE: the zone where the instance is located.

REST

  1. Create an empty JSON file.

  2. To view the properties of an existing instance, make aGET request tothebetainstances.get method:

    GET https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME

    Replace the following:

    • PROJECT_ID: the ID of the project where theinstance is located.

    • ZONE: the zone where the instance is located.

    • INSTANCE_NAME: the name of an existing instance.

  3. In the empty JSON file that you created in the previous steps, do thefollowing:

    1. Enter the instance properties from theGET request output.

    2. Locate thegracefulShutdown.enabled field, and then change itsvalue tofalse:

      {  ...  "scheduling": {    ..."gracefulShutdown": {      "enabled": false    }  },  ...}
  4. To update the instance, make aPUT request to thebetainstances.update method.Include the following:

    • In the request URL, include themostDisruptiveAllowedAction queryparameter.

    • In the request body, include the instance properties from the JSONfile that you created and updated in the previous steps.

    ThePUT request to update the instance is similar to the following:

    PUT https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME?mostDisruptiveAllowedAction=ALLOWED_ACTION{  ...  "scheduling": {    ...    "gracefulShutdown": {      "enabled": false    }  },  ...}

    ReplaceALLOWED_ACTION with one of the followingvalues:

    • NO_EFFECT: the request checks if your update request is validand if the resources are available, but it doesn't update theinstance.

    • REFRESH: if the modified instance properties don't require theinstance to restart, then Compute Engine updates theinstance.

For more information about updating the properties of an instance, seeUpdate instance properties.

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.