[ Web Proxy ]
URL:
Viewing: https://docs.cloud.google.com/compute/docs/instances/decrease-shutdown-time [Back]  [Original]

Decrease Compute Engine instances shutdown time  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

Decrease Compute Engine instances shutdown time Stay organized with collections Save and categorize content based on your preferences.

This document explains how to decrease the shutdown time for a Compute Engine instance by configuring the instance to skip the guest OS shutdown on stop or deletion.

If you configure an instance to skip the guest OS shutdown on stop or deletion, then Compute Engine immediately shuts down the guest OS when the instance state changes to STOPPING. This action helps you release quota or resources faster by speeding up an instance stop or deletion. To learn more about the phases that an instance goes through during stop or deletion, including the default interval for clean guest OS shutdown, see Stop operation.

Warning: An abrupt shutdown of the guest OS can cause permanent data loss or file system corruption. Configure an instance to skip the guest OS shutdown only if you plan to delete the instance, or if you plan to stop an instance but you aren't concerned about the integrity of the data on the instance boot disk.

Before you begin

Required roles

To get the permissions that you need to configure an instance to skip the guest OS shutdown, ask your administrator to grant you the Compute Instance Admin (v1) (roles/compute.instanceAdmin.v1) IAM role on your project. For more information about granting roles, see Manage access to projects, folders, and organizations.

This predefined role contains the permissions required to configure an instance to skip the guest OS shutdown. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to configure an instance to skip the guest OS shutdown:

You might also be able to get these permissions with custom roles or other predefined roles.

Configure instances to skip guest OS shutdown

To configure a compute instance to skip the guest OS shutdown when you stop or delete the instance, use one of the following methods:

Configure guest OS shutdown in an existing instance

You can only configure a compute instance to skip the guest OS shutdown if the instance is stopped (TERMINATED).

To configure an instance to skip the guest OS shutdown, select one of the following options:

gcloud

  1. If you haven't already, then stop the instance.

  2. To configure an instance to skip the guest OS shutdown, use the gcloud beta compute instances set-scheduling command with the --skip-guest-os-shutdown flag:

    gcloud compute instances set-scheduling INSTANCE_NAME \
        --skip-guest-os-shutdown \
        --zone=ZONE
    

    Replace the following:

    • INSTANCE_NAME: the name of the instance.

    • ZONE: the zone where the instance exists.

REST

  1. If you haven't already, then stop the instance.

  2. To configure an instance to skip the guest OS shutdown, make a POST request to the instances.setScheduling method. In the request body, include the skipGuestOsShutdown field and set it to true:

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/setScheduling
    
    {
      "skipGuestOsShutdown": true
    }
    

For more information on how to update an instance, see Update instance properties.

Configure guest OS shutdown while you create an instance

To create a compute instance that is configured to skip the guest OS shutdown, select one of the following options:

gcloud

To create an instance that is configured to skip the guest OS shutdown, use the gcloud compute instances create command with the --skip-guest-os-shutdown flag:

gcloud compute instances create INSTANCE_NAME \
    --machine-type=MACHINE_TYPE \
    --skip-guest-os-shutdown \
    --zone=ZONE

Replace the following:

REST

To create an instance that is configured to skip the guest OS shutdown, make a POST request to the instances.insert method. In the request body, include the skipGuestOsShutdown field set to true:

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances

{
  "name": "INSTANCE_NAME",
  "machineType": "zones/ZONE/machineTypes/MACHINE_TYPE",
  "disks": [
    {
      "boot": true,
      "initializeParams": {
        "sourceImage": "projects/IMAGE_PROJECT/global/images/IMAGE"
      }
    }
  ],
  "networkInterfaces": [
    {
      "network": "global/networks/default"
    }
  ],
  "scheduling": {
    "skipGuestOsShutdown": true
  }
}

Replace the following:

For more information on how to create an instance, see Create and start a Compute Engine instance.

Configure guest OS shutdown while you create instances in bulk

To create compute instances in bulk that are configured to skip the guest OS shutdown, select one of the following options:

gcloud

To create instances in bulk that are configured to skip the guest OS shutdown, use the gcloud compute instances bulk create command with the --skip-guest-os-shutdown flag.

For example, to create instances in bulk that use a name pattern in a single zone, run the following command:

gcloud compute instances bulk create \
    --count=COUNT \
    --machine-type=MACHINE_TYPE \
    --name-pattern="NAME_PATTERN" \
    --skip-guest-os-shutdown \
    --zone=ZONE

Replace the following:

REST

To create instances in bulk that are configured to skip the guest OS shutdown, make a POST request to the instances.bulkInsert method. In the request body, include the skipGuestOsShutdown field set to true.

For example, to create instances in bulk that use a name pattern in a single zone, make a POST request as follows:

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/bulkInsert

{
  "count": COUNT,
  "namePattern": "NAME_PATTERN",
  "instanceProperties": {
    "machineType": "MACHINE_TYPE",
    "disks": [
      {
        "boot": true,
        "initializeParams": {
          "sourceImage": "projects/IMAGE_PROJECT/global/images/IMAGE"
        }
      }
    ],
    "networkInterfaces": [
      {
        "network": "global/networks/default"
      }
    ],
    "scheduling": {
      "skipGuestOsShutdown": true
    }
  }
}

Replace the following:

For more information on how to create instances in bulk, see Create instances in bulk.

Configure guest OS shutdown while you create an instance template

After you create an instance template configured to skip the guest OS shutdown when you stop or delete compute instances, you can use the instance template to do the following:

To create an instance template that is configured to skip the guest OS shutdown, select one of the following options:

gcloud

To create an instance template that is configured to skip the guest OS shutdown, use the gcloud compute instance-templates create command with the --skip-guest-os-shutdown flag.

For example, to create a regional instance template that specifies to skip the guest OS shutdown, run the following command. If you want to create a global instance template, then use the same command without the --instance-template-region flag.

gcloud compute instance-templates create INSTANCE_TEMPLATE_NAME \
    --instance-template-region=REGION \
    --machine-type=MACHINE_TYPE \
    --skip-guest-os-shutdown

Replace the following:

REST

To create an instance template that is configured to skip the guest OS shutdown, make a POST request to one of the following methods:

In the request body, include the skipGuestOsShutdown field set to true.

For example, to create a regional instance template that specifies to skip the guest OS shutdown, make a POST request as follows:

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/instanceTemplates

{
  "name": "INSTANCE_TEMPLATE_NAME",
  "properties": {
    "disks": [
      {
        "boot": true,
        "initializeParams": {
          "sourceImage": "projects/IMAGE_PROJECT/global/images/IMAGE"
        }
      }
    ],
    "machineType": "MACHINE_TYPE",
    "networkInterfaces": [
      {
        "network": "global/networks/default"
      }
    ],
    "scheduling": {
      "skipGuestOsShutdown": true
    }
  }
}

Replace the following:

For more information about creating an instance template, see Create instance templates.

View guest OS shutdown setting

You can check whether Compute Engine skips the guest OS shutdown when you stop or delete a compute instance.

To view the guest OS shutdown time in an instance, select one of the following options:

gcloud

To view the details of an instance and whether it skips the guest OS shutdown, use the gcloud compute instances describe command:

gcloud compute instances describe INSTANCE_NAME \
    --zone=ZONE

Replace the following:

If you configured the instance to skip the guest OS shutdown, then the output contains the skipGuestOsShutdown field set to true, such as in the following example:

...
scheduling:
  automaticRestart: true
  skipGuestOsShutdown: true
  onHostMaintenance: MIGRATE
  preemptible: false
  provisioningModel: STANDARD
...

Otherwise, if the skipGuestOsShutdown field is missing or is set to false, the guest OS uses the default shutdown time.

REST

To view the details of an instance and whether it skips the guest OS shutdown, make a GET request to the instances.get method:

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

Replace the following:

If you configured the instance to skip the guest OS shutdown, then the output contains the skipGuestOsShutdown field set to true, such as in the following example:

{
  ...
  "scheduling": {
    "automaticRestart": true,
    "skipGuestOsShutdown": true,
    "onHostMaintenance": "MIGRATE",
    "preemptible": false,
    "provisioningModel": "STANDARD"
  },
  ...
}

Otherwise, if the skipGuestOsShutdown field is missing or is set to false, the guest OS uses the default shutdown time.

What's next

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-12 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-12 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page