Disable graceful shutdown in a Compute Engine instance Stay organized with collections Save and categorize content based on your preferences.
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
- 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 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 the permission, which is required to disable graceful shutdown in a compute instance.compute.instances.update on the 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
In the Google Cloud console, go to theVM instances page.
In theName column, click the instance name to view its details.
The details page of the instance opens andDetails tab is selected.
ClickEdit.
In theManagement section, clear theGracefully shut down the VMcheckbox.
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=ZONEReplace the following:
INSTANCE_NAME: the name of the instance.ZONE: the zone where the instance is located.
REST
Create an empty JSON file.
To view the properties of an existing instance, make a
GETrequest tothebetainstances.getmethod:GET https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAMEReplace 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.
In the empty JSON file that you created in the previous steps, do thefollowing:
Enter the instance properties from the
GETrequest output.Locate the
gracefulShutdown.enabledfield, and then change itsvalue tofalse:{ ... "scheduling": { ..."gracefulShutdown": { "enabled": false } }, ...}
To update the instance, make a
PUTrequest to thebetainstances.updatemethod.Include the following:In the request URL, include the
mostDisruptiveAllowedActionqueryparameter.In the request body, include the instance properties from the JSONfile that you created and updated in the previous steps.
The
PUTrequest 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 } }, ...}Replace
ALLOWED_ACTIONwith 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.