You have 4 options to stop your instance.
If you would like to stop your instance using Google Cloud Platform Console, you may use this guide:
- Go to the VM instances page in the GCP Console.
- Select one or more instances that you want to stop.
- At the top of the VM instances page, click Stop.
To stop your instance using gcloud tool, please follow this procedure.
- Open your Google Cloud Shell in GCP.
- Use the instances stop command and specify one or more instances that you want to stop.
$ gcloud compute instances stop your-instance1 your-instance-2
In the API, construct a POST request to stop an instance.
POST https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/instances/example-instance/stop
To stop your instance through the OS for Linux and Windows.
- In the GCP Console, go to the VM Instances page.
- In the list of virtual machine instances, click SSH in the row of the instance that you want to connect to.
- Use the sudo shutdown -h now or sudo poweroff commands. Execute one of these commands while you are logged into the virtual machine:
$ sudo shutdown -h now
$ sudo poweroff
You can reboot a Windows instance, similar to sudo reboot above, using the Start menu. In the Start menu, click on the arrow next to Log off and click Restart.