A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/compute/docs/instances/suspend-resume-instance below:

Suspend or resume a Compute Engine instance | Compute Engine Documentation

Skip to main content Suspend or resume a Compute Engine instance

Stay organized with collections Save and categorize content based on your preferences.

Linux Windows

This document explains how to suspend or resume Compute Engine instances. To learn more about suspending, stopping, or resetting instances, see Suspend, stop, or reset Compute Engine instances.

If you want to keep your Compute Engine instance around, but you don't want to incur charges for it when the instance isn't in use, then you can suspend the instance. Suspending an instance preserves the instance and migrates the contents of the instance's memory to storage. After resuming the instance, Compute Engine migrates the instance's memory from storage back to the instance, and the instance starts running again.

Suspending a Compute Engine instance is useful for the following:

Before you begin Required roles

To get the permissions that you need to suspend or resume a compute instance, ask your administrator to grant you the Compute Instance Admin (v1) (roles/compute.instanceAdmin.v1) IAM role on the instance. For more information about granting roles, see Manage access to projects, folders, and organizations.

This predefined role contains the permissions required to suspend or resume a compute instance. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to suspend or resume a compute instance:

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

Limitations

When suspending a compute instance, the following limitations apply:

Enable suspend operations in Debian 8 or 9

If a compute instance is running Debian 8 and 9 as its guest OS, then, before suspending the instance, you must enable suspend and resume operations by doing one of the following:

Configure the ACPID

To enable the suspend and resume operation in Debian 8 or 9, you can configure the Advanced Configuration and Power Interface events Daemon (ACPID) to handle the sleep button event. After enabling the deep sleep button event, you can add a shell script for handling the sleep event as described in this section.

To configure the ACPID to support suspend and resume operations, do the following:

  1. If you haven't already, then connect to your Linux instance.

  2. Create the events folder in the acpi folder:

    sudo mkdir -p /etc/acpi/events/
    
  3. Configure the ACPID to handle the sleep button event:

    cat <<EOF | sudo tee /etc/acpi/events/sleepbtn-acpi-support
    event=button[ /]sleep
    action=/etc/acpi/sleepbtn-acpi-support.sh
    EOF
    
  4. Create the sleep event handling script:

    cat <<EOF | sudo tee /etc/acpi/sleepbtn-acpi-support.sh
    #!/bin/sh
    echo mem > /sys/power/state
    EOF
    
  5. Set up the permissions for the script:

    sudo chmod 755 /etc/acpi/sleepbtn-acpi-support.sh
    
  6. To make the changes effective, restart the ACPID:

    sudo systemctl restart acpid.service
    
Install D-Bus

To enable the suspend and resume operation in Debian 8 or 9, you can install D-Bus.

To install D-Bus in your compute instance's guest OS when the OS is using Debian 8 or 9, do the following:

  1. If you haven't already, then connect to your Linux instance.

  2. Install D-Bus:

    sudo apt-get install dbus
    
  3. To make the changes effective, restart logind:

    sudo systemctl restart systemd-logind.service
    
Suspend an instance

If the guest OS of your compute instance is using Debian 8 or 9, then, before suspending the instance, you must configure the guest OS to support suspend and resume operations as described in this document.

To suspend an instance, use of the following methods based on whether the instance has Local SSD disks attached:

Suspend an instance without Local SSD disks

You can suspend multiple compute instances simultaneously or individual instances. For multiple instances, use the Google Cloud console or, for instances located in the same zone, the Google Cloud CLI. For individual instances, select any of the following options:

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

    Go to VM instances

  2. Select one or more instances to suspend.

  3. Click pause Suspend, and then click Suspend to confirm.

gcloud

To suspend one or more instances in a single zone, use the gcloud compute instances suspend command:

gcloud compute instances suspend INSTANCE_NAMES \
    --zone=ZONE

Replace the following:

Go Java Node.js PHP Python REST

To suspend an instance, make a POST request to the instances.suspend method:

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

Replace the following:

Suspend an instance with Local SSD disks

Based on how many compute instances you want to suspend simultaneously and whether you need to preserve the data of their attached Local SSD disks, do the following:

To suspend one or more instances that have Local SSD disks attached, select one of the following options:

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

    Go to VM instances

  2. Select one or more instances to suspend.

  3. Click pause Suspend, and then click Suspend to confirm.

gcloud

When suspending one or more instances in a single zone that have Local SSD disks attached, specify whether to discard or preserve Local SSD data as follows:

Replace the following:

REST

When suspending an instance that has Local SSD disks attached, specify whether to discard or preserve Local SSD data as follows:

Replace the following:

Resume a suspended instance

Before resuming a suspended compute instance, consider the following:

You can resume multiple instances simultaneously or individual instances. For multiple instances, use the Google Cloud console or, for instances located in the same zone, the gcloud CLI. For individual instances, select any of the following options:

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

    Go to VM instances

  2. Select one or more suspended instances to resume.

  3. Click play_arrow Start / Resume, and then click Start.

gcloud

To resume one or more suspended instances in a single zone, use the gcloud compute instances resume command:

gcloud compute instances resume INSTANCE_NAMES \
    --zone=ZONE

Replace the following:

Go Java Node.js PHP Python REST

To resume a suspended instance, make a POST request to the instances.resume method:

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

Replace the following:

What's next

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 2025-08-07 UTC.

[[["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 2025-08-07 UTC."],[[["This document provides instructions on how to suspend and resume Compute Engine instances, which can be used to pause billing for instances that are not in active use while preserving the instance's state."],["Suspending an instance involves migrating its memory to storage, and resuming it brings the memory back from storage, allowing for cost savings and quicker reinitialization compared to creating new instances."],["There are specific limitations for suspending instances, such as restrictions based on the guest OS, attached GPUs, certain types of instances, memory size, and the use of CSEK-protected disks."],["Suspending instances with Local SSD disks requires choosing whether to discard or preserve the data, and preserving the data requires enough storage quota."],["Resuming a suspended instance requires sufficient capacity in the instance's zone and may involve remounting Local SSD disks if their data was preserved during suspension."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4