Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to stop compute engine instance without terminating the instance?

I am playing with Google Compute Engine with debian as the source image. I understand that I will be charged by the hour for as long as the instance is running, regardless whether i ssh in or not. The shutdown -h command apparently put the instance in terminated mode, and i would have to create the instance again for next time.

My question is, how do i just shut the VM down without terminating it? is that an option?

Google Say that : https://developers.google.com/compute/docs/troubleshooting If you shut down your instance using sudo shutdown or sudo poweroff, it is the equivalent of terminating it. There is no way to "freeze" an instance and restart it at a later time. You must recreate your instance if you choose to shut it down. When an instance is shut down from inside, it goes into the TERMINATED state but will still appear in the API (such as when you list instances). To remove it from the list, you must delete the instance explicitly. However, uptime for a TERMINATED instance is not billed.

like image 458
user2773013 Avatar asked Nov 22 '13 20:11

user2773013


People also ask

Why should you stop your VM instance when you're done?

When it transforms into a green checkmark, your virtual machine is running. At that point, you can tap on "RDP" to connect with your remote desktop session. Again, unless you want to keep your virtual machine running to service clients, be sure to shut it down when you're done so that you minimize the cost.

What is difference between stop and suspend in GCP?

Suspending an instance differs from stopping an instance in the following ways: Suspended instances preserve the guest OS memory, device state, and application state. Google charges for the storage necessary to save instance memory. You can only suspend an instance for up to 60 days.


1 Answers

I know this thread is a bit old, but the Shutdown/Start feature has now been introduced in the Developers console and command line, so no need to create snapshots anymore.

Documentation is available here

like image 127
Marius I Avatar answered Nov 16 '22 03:11

Marius I