Disable graceful shutdown in a Compute Engine instance
This document explains how to disable graceful shutdown in an existing
Compute Engine instance. To learn more about graceful shutdown, including how
to skip graceful shutdown for individual stop or delete operations, see
Graceful shutdown overview.
If you've enabled graceful shutdown in an instance, then you can disable it to
do the following:
Speed up stop or delete operations to avoid unnecessary charges.
Update instance properties that require a restart.
Before you begin
If you haven't already, set up authentication.
Authentication verifies your identity for access to Trusted Cloud by S3NS 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 Trusted Cloud console to access Trusted Cloud by S3NS services and
APIs, you don't need to set up authentication.
This predefined role contains the
compute.instances.update on the instance
permission,
which is required to
disable graceful shutdown in a compute instance.
You can disable graceful shutdown in a compute instance without restarting the
instance. However, you can't disable graceful shutdown while the instance is in
the process of gracefully shutting down (PENDING_STOP).
To disable graceful shutdown in an instance, select one of the following
options:
Console
In the Trusted Cloud console, go to the VM instances page.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[[["\u003cp\u003eThis document provides instructions on how to disable graceful shutdown for Compute Engine instances, which is a feature that delays the stop or delete process.\u003c/p\u003e\n"],["\u003cp\u003eDisabling graceful shutdown can speed up stop or delete operations and is required before updating certain instance properties that require a restart.\u003c/p\u003e\n"],["\u003cp\u003eThe process of disabling graceful shutdown can be done without needing to restart the instance, and can be accomplished through the Google Cloud console, \u003ccode\u003egcloud\u003c/code\u003e command-line tool, or REST API.\u003c/p\u003e\n"],["\u003cp\u003eTo disable graceful shutdown, users need the \u003ccode\u003ecompute.instances.update\u003c/code\u003e permission, which is typically granted through the Compute Instance Admin (v1) IAM role.\u003c/p\u003e\n"],["\u003cp\u003ePre-GA products or features, like the ones discussed within, are "as is" and may feature limited support, along with terms specified within the "Pre-GA Offerings Terms".\u003c/p\u003e\n"]]],[],null,["# Disable graceful shutdown in a Compute Engine instance\n\n*** ** * ** ***\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis document explains how to disable graceful shutdown in an existing\nCompute Engine instance. To learn more about graceful shutdown, including how\nto skip graceful shutdown for individual stop or delete operations, see\n[Graceful shutdown overview](/compute/docs/instances/graceful-shutdown-overview).\n\nIf you've enabled graceful shutdown in an instance, then you can disable it to\ndo the following:\n\n- Speed up stop or delete operations to avoid unnecessary charges.\n\n- Update instance properties that require a restart.\n\nBefore you begin\n----------------\n\n- If you haven't already, set up [authentication](/compute/docs/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:\n\n Select the tab for how you plan to use the samples on this page: \n\n ### Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n ### gcloud\n\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n ### REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\n### Required roles\n\n\nTo get the permission that\nyou need to disable graceful shutdown in a compute instance,\n\nask your administrator to grant you the\n\n\n[Compute Instance Admin (v1)](/iam/docs/roles-permissions/compute#compute.instanceAdmin.v1) (`roles/compute.instanceAdmin.v1`)\nIAM role on your project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThis predefined role contains the\n` ``compute.instances.update`` on the instance`\npermission,\nwhich is required to\ndisable graceful shutdown in a compute instance.\n\n\nYou might also be able to get\nthis permission\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\n\nDisable graceful shutdown in an instance\n----------------------------------------\n\nYou can disable graceful shutdown in a compute instance without restarting the\ninstance. However, you can't disable graceful shutdown while the instance is in\nthe process of gracefully shutting down (`PENDING_STOP`).\n\nTo disable graceful shutdown in an instance, select one of the following\noptions: \n\n### Console\n\n1. In the Google Cloud console, go to the **VM instances** page.\n\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n2. In the **Name** column, click the instance name to view its details.\n\n The details page of the instance opens and **Details** tab is selected.\n3. Click edit **Edit**.\n\n4. In the **Management** section, clear the **Gracefully shut down the VM**\n checkbox.\n\n5. Click **Save**.\n\n### gcloud\n\nTo disable graceful shutdown in an instance, use the\n[`gcloud beta compute instances update` command](/sdk/gcloud/reference/beta/compute/instances/update)\nwith the `--no-graceful-shutdown` flag: \n\n gcloud beta compute instances update \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e \\\n --no-graceful-shutdown \\\n --zone=\u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e: the name of the instance.\n\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone where the instance is located.\n\n### REST\n\n1. Create an empty JSON file.\n\n2. To view the properties of an existing instance, make a `GET` request to\n the\n [beta `instances.get` method](/compute/docs/reference/rest/beta/instances/get):\n\n GET https://compute.googleapis.com/compute/beta/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/zones/\u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e/instances/\u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project where the\n instance is located.\n\n - \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone where the instance is located.\n\n - \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e: the name of an existing instance.\n\n3. In the empty JSON file that you created in the previous steps, do the\n following:\n\n 1. Enter the instance properties from the `GET` request output.\n\n 2. Locate the `gracefulShutdown.enabled` field, and then change its\n value to `false`:\n\n {\n ...\n \"scheduling\": {\n ...\n \"gracefulShutdown\": {\n \"enabled\": false\n }\n },\n ...\n }\n\n4. To update the instance, make a `PUT` request to the\n [beta `instances.update` method](/compute/docs/reference/rest/beta/instances/update).\n Include the following:\n\n - In the request URL, include the `mostDisruptiveAllowedAction` query\n parameter.\n\n - In the request body, include the instance properties from the JSON\n file that you created and updated in the previous steps.\n\n The `PUT` request to update the instance is similar to the following: \n\n PUT https://compute.googleapis.com/compute/beta/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/zones/\u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e/instances/\u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e?mostDisruptiveAllowedAction=\u003cvar translate=\"no\"\u003eALLOWED_ACTION\u003c/var\u003e\n\n {\n ...\n \"scheduling\": {\n ...\n \"gracefulShutdown\": {\n \"enabled\": false\n }\n },\n ...\n }\n\n Replace \u003cvar translate=\"no\"\u003eALLOWED_ACTION\u003c/var\u003e with one of the following\n values:\n - **`NO_EFFECT`**: the request checks if your update request is valid\n and if the resources are available, but it doesn't update the\n instance.\n\n - **`REFRESH`**: if the modified instance properties don't require the\n instance to restart, then Compute Engine updates the\n instance.\n\nFor more information about updating the properties of an instance, see\n[Update instance properties](/compute/docs/instances/update-instance-properties#update).\n\nWhat's next\n-----------\n\n- [Limit the run time of a VM](/compute/docs/instances/limit-vm-runtime)\n\n- [Running shutdown scripts](/compute/docs/shutdownscript)"]]