Stay organized with collections Save and categorize content based on your preferences.
Linux Windows
This document explains how to reboot or reset a Compute Engine instance. To learn more about the effects of resetting an instance, as well as the differences between suspending, stopping, or resetting an instance, see Suspend, stop, or reset Compute Engine instances.
Rebooting or resetting an instance can help ensure optimal performance and stability, or help resolve issues like a frozen, slow, or crashing guest operating system (OS). Based on the state of the guest OS of your instance, do one of the following:
Reboot the instance. If your guest OS is slow or frozen, then rebooting gives it enough time to finish running tasks before shutting down.
Reset the instance. Reset an instance only if the guest OS has crashed or is unresponsive, and you have no other options. Resetting an instance doesn't allow the guest OS to cleanly shut down. This action can discard unsaved data and might corrupt the file systems of any disks.
Select the tab for how you plan to use the samples on this page:
ConsoleWhen you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloudInstall the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:
gcloud init
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
.To use the Go samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
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
.
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
JavaTo use the Java samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
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
.
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
Node.jsTo use the Node.js samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
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
.
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
PHPTo use the PHP samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
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
.
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
PythonTo use the Python samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
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
.
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
RESTTo 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.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
For more information, see Authenticate for using REST in the Google Cloud authentication documentation.
To get the permissions that you need to reset or reboot 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 reset or reboot a compute instance. To see the exact permissions that are required, expand the Required permissions section:
Required permissionsThe following permissions are required to reset or reboot a compute instance:
compute.instances.reset
compute.instances.setMetadata
You might also be able to get these permissions with custom roles or other predefined roles.
Reboot an instanceRebooting a compute instance allows the guest OS in the instance to finish running tasks before Compute Engine sends the ACPI shutdown signal. This helps to ensure a clean shutdown of the guest OS.
Rebooting an instance erases the memory used by the instance. If you're using RAM disks with your instances, and you need to preserve that data, then back up the data before rebooting the instance.
To reboot an instance, select one of the following options:
Reset an instanceResetting an instance erases all data in the memory of the instance, including any temporary files stored on RAM disks. This data is permanently lost and Compute Engine doesn't create backups before resetting the instance.
Warning: Only reset an instance as a last resort when the guest OS has crashed and is unresponsive. This action forces an abrupt shutdown of the guest OS, which can cause data loss and file system corruption. To restart an instance cleanly, reboot it instead.You can reset multiple 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:
ConsoleIn the Google Cloud console, go to the VM instances page.
Select the instances to reset.
Click Reset, and then click Reset to confirm.
To reset one or more running instances in a single zone, use the gcloud compute instances reset
command:
gcloud compute instances reset INSTANCE_NAMES \
--zone=ZONE
Replace the following:
INSTANCE_NAMES
: a whitespace-separated list of names of instances—for example, instance-01 instance-02 instance-03
.
ZONE
: the zone where the instances are located.
To reset a running instance, make a POST
request to the instances.reset
method:
POST https://compute.googleapis.com//compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/reset
Replace the following:
INSTANCE_NAME
: the name of the instance.
PROJECT_ID
: the ID of the project where the instance is located.
ZONE
: the zone where the instance is located.
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 reboot or reset a Compute Engine instance, which can resolve issues like a frozen or crashing operating system."],["Rebooting an instance allows the guest OS to shut down cleanly by giving it time to finish running tasks, while resetting forces an abrupt shutdown which is only recommended when the guest OS has crashed and is unresponsive."],["Resetting an instance results in permanent data loss from the instance's memory without backups, while rebooting only erases the memory used by the instance."],["Before resetting or rebooting a Compute Engine instance you must have the `Compute Instance Admin (v1)` role, which provides the necessary permissions, or a custom role that includes `compute.instances.reset` to reset and `compute.instances.setMetadata` to reboot."],["The article provides instructions for rebooting instances in both Linux and Windows, as well as resetting instances through various methods, including the Google Cloud console, gcloud CLI, Go, Java, Node.js, PHP, Python, and REST."]]],[]]
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