Suspend, stop, or reset Compute Engine instances


This document explains the behavior, billing, and limitations for suspending, stopping, or resetting a Compute Engine instance. To learn how to perform these operations, see the following instead:

You can suspend, stop, or reset an instance to do the following:

  • Save costs.

  • Perform maintenance.

  • Troubleshoot issues.

  • Free up resources.

You can repeatedly suspend and resume, stop and restart, or reset a running instance until its deletion.

About suspending, stopping, or resetting an instance

Stop, suspend, or reset a compute instance depending on your needs. Specifically:

  • Suspend an instance

    Suspending an instance is analogous to closing the lid of your laptop, and it's useful in the following scenarios:

    • You want to stop paying for the core and memory costs of running an instance, and pay the comparatively cheaper cost of storage, to preserve the state of your instance instead.

    • You don't need the instance at this time, but you want to be able to bring it back up quickly with its OS and application state where you left it.

    To learn more, see Suspending an instance in this document.

  • Stop an instance

    Stopping an instance is analogous to shutting down your laptop, and it's useful in the following scenarios:

    • You no longer need the instance, but you want to remove and reuse the resources attached to the instance—such as its internal IP addresses or Google Cloud Hyperdisk volumes.

    • You don't need to preserve the guest OS memory, device state, or application state.

    • You want to change certain properties of the instance that require you to first stop the instance.

    To learn more, see Stopping an instance in this document.

  • Reset an instance

    Resetting an instance is analogous to doing a hard reset on your computer, such as when you press a reset button or press and hold the power button. Resetting an instance is useful in the following scenarios:

    • You want to re-initialize the instance to its boot state to help ensure optimal performance and stability.

    • You want to resume your workload after your guest OS has crashed and is unresponsive, and you have no other options than resetting the instance.

    To learn more, see Resetting an instance in this document.

To see an overview of the differences between stopping, suspending, or resetting an instance, see the comparison table in this document.

Suspending an instance

When you suspend a compute instance, Compute Engine sends an ACPI S3 suspend signal to the guest OS in the instance and sets the state of the instance to SUSPENDING. Then, Compute Engine uses persistent storage to store the following:

  • The guest OS memory

  • The device state

  • The application state of the instance

The storing operation might take some time to complete, depending on the amount of data to store. After Compute Engine has completed storing data, the instance state transitions to SUSPENDED within a few seconds, and the suspend operation completes. All resources attached to the instance, like Hyperdisk volumes and static IP addresses, remain attached to the instance, and you continue to incur charges for them. However, any ephemeral IP addresses are released unless you promote them to a static IP address.

Unless you resume or delete the instance, the instance remains in the SUSPENDED state for up to 60 days. After that, Compute Engine automatically transitions the instance state to TERMINATED, and the instance loses the preserved guest OS memory, device state, and application state.

Stopping an instance

When you stop a compute instance, Compute Engine sends an ACPI S2 shutdown signal to the guest OS in the instance, sets the state of the instance to STOPPING, and then waits a short time for the guest OS to cleanly shut down. The shutdown time of the guest OS varies based on the type of instance as follows:

  • Spot VMs: For Spot VMs and preemptible instances, the shutdown period lasts 30 seconds, which is the same length of the preemption process.

  • Other instance types: For any other instance types, the shutdown period lasts at least 90 seconds.

If a shutdown script is still running at the end of the shutdown period, then Compute Engine ends it and forcefully shuts down the guest OS. However, if a user stops the instance from within its guest OS, then the OS shuts down only after any shutdown scripts have finished running. After the guest OS has finished shutting down, the instance state transitions to TERMINATED within a few seconds, and the stop operation completes.

After an instance is stopped, you can restart it to resume your workload, or delete the instance if you no longer need it.

Resetting an instance

When you reset or reboot a compute instance, Compute Engine sends the ACPI reset signal to the guest OS in the instance, which shuts down and then restarts. When resetting an instance, Compute Engine does the following:

  • Re-initializes the instance to its initial boot state with its original metadata, OS image, and disks.

  • Wipes the instance's memory contents unless you back up the data.

  • Keeps the instance state to RUNNING throughout the reset operation.

Resetting an instance doesn't change any of its instance properties. The instance retains its ephemeral IPs, static external IPs, attached disks, machine type, and Local SSD disks (if any) and the disks' data.

Comparison table

The following table shows how stopping, suspending, and resetting a compute instance affects the instance and its resources:

Suspend an instance Stop an instance Reset an instance
Billing While an instance is in the SUSPENDING or SUSPENDED state, you don't incur charges for CPU usage. However, you keep incurring charges for the resources attached to the instance until you delete them. While an instance is in the STOPPING or TERMINATED state, you don't incur charges for CPU usage. However, you keep incurring charges for the resources attached to the instance until you delete them. Because the instance remains in the RUNNING state when it's resetting, you keep incurring charges for the instance according to standard instance prices.
Instance state SUSPENDED TERMINATED RUNNING
Attached disks Attached disks are maintained and you keep incurring charges for them. Attached disks are maintained and you keep incurring charges for them. Attached disks are maintained and you keep incurring charges for them.
Memory and instance state The guest OS and application state are preserved and restored when the instance is resumed.

You incur charges at a specific rate for storing the preserved data. For more information, see the pricing for suspended instances.
The instance resets to power-on state and no data is saved. The instance resets to power-on state and no data is saved.
GPUs Not supported.

If a GPU is attached to an instance, then you can't suspend the instance.
You don't incur charges for GPUs when an instance is stopped.

A GPU that is attached to an instance with a TERMINATED state doesn't count against your project quota.
You incur charges at standard GPU prices.
Local SSD disks When you suspend an instance, you can choose whether to discard or preserve the data on the attached Local SSD disks.

If you want to preserve Local SSD data, then Compute Engine migrates the Local SSD data to persistent storage, and you incur charges for the used storage space until you resume or delete the instance.
When you stop an instance, you can choose whether to discard or preserve the data on the attached Local SSD disks.

If you want to preserve Local SSD data, then Compute Engine migrates the Local SSD data to persistent storage, and you incur charges for the used storage space until you restart or delete the instance.
Local SSD disks and their data are maintained.
External ephemeral IP addresses Compute Engine releases ephemeral IP addresses when an instance is suspended, and it assigns a new ephemeral IP address to the instance when the instance resumes. To retain an external IP address, promote it to a static IP address. Compute Engine releases ephemeral IP addresses when an instance is suspended, and it assigns a new ephemeral IP address to the instance when the instance resumes. To retain an external IP address, promote it to a static IP address. Compute Engine releases ephemeral IP addresses when an instance is suspended, and it assigns a new ephemeral IP address to the instance when the instance resumes. To retain an external IP address, promote it to a static IP address.
External static IP addresses Static external IP addresses are maintained.

If you reserve a static external IP address and don't assign it to an instance, then you're charged at a higher rate than for static and ephemeral external IP addresses that are in use. For more information, see External IP address pricing.
Static external IP addresses are maintained.

If you reserve a static external IP address and don't assign it to an instance, or you assign it an instance in the TERMINATED state, then you're charged at a higher rate than for static and ephemeral external IP addresses that are in use. For more information, see External IP address pricing.
Static external IP addresses are maintained.
Internal IP or MAC addresses Internal IP and MAC addresses are maintained. Internal IP and MAC addresses are maintained. Internal IP and MAC addresses are maintained.
VM metadata VM metadata is maintained. VM metadata is maintained. VM metadata is maintained.

Pricing

The following sections outlines the pricing for stopping, suspending, or resetting a compute instance.

Pricing for suspending an instance

After a compute instance is suspended and its state transitions to SUSPENDED, you no longer incur charges for CPU usage. However, you continue incurring charges for the following resources attached to the instance:

  • The instance's memory.

  • Any disks attached attached to the instance.

  • Any static IP addresses assigned to the instance.

Pricing for stopping an instance

After a compute instance is stopped and its state transitions to TERMINATED, you no longer incur charges for CPU usage. However, you continue incurring charges for any resources attached to the instance, such as disks and external IP addresses, until you delete them.

Additionally, you might still incur charges for your software license fees. For example, if you suspend Windows Server instances, you don't incur Windows Server license fees. However, you might still incur charges for other types of licenses.

Pricing for resetting an instance

Since the state of a compute instance remains RUNNING when you reset it, you continue to incur charges for the instance according to its standard prices.

What's next