Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Compute Engine VM Instance Doesn't Stop. How to force stop?

Tags:

I have a Google Compute Engine VM Instance that runs Ubuntu 16.04.

I stopped the instance more than an hour ago but it still hasn't stopped. It says "Unknown error." on notification panel.

I can't do any action on VM right now, because the process is still ongoing. It doesn't let me to stop, start, reset, delete, or access.

How can I force stop the instance? I need to access to the disk attached to VM, but I can't even create snapshot before stopping the VM.

Edit:
Instance stopped after 1.5 hours being stuck at "stopping" state. But I still couldn't find a way to force stop an instance.

like image 234
burakcalik Avatar asked Jun 29 '18 04:06

burakcalik


People also ask

How do I stop a Google VM instance?

To stop a VM, use the Google Cloud console, the gcloud CLI, or the Compute Engine API. In the Google Cloud console, go to the VM instances page. Select one or more VMs that you want to stop. Click Stop.

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

You might want to stop a VM for several reasons: You no longer need the VM but want the resources that are attached to the VM—such as its internal IPs, MAC address, and persistent disk. You don't need to preserve the guest OS memory, device state, or application state.

How do I reset Google Compute Engine?

In the vSphere vCenter, select the virtual machine. Right-click the VM and select Migrate for Google Compute Engine Operations > Restart.

Does GCP charge for stopped instances?

A stopped instance does not incur charges, but all of the resources that are attached to the instance will still be charged. For example, you are charged for persistent disks and external IP addresses according to the price sheet, even if an instance is stopped.


1 Answers

You can take a look into Stopping or Deleting an Instance this article or you can use the following gcloud command line tool in order to stop the instance temporarily so you can come back to it at a later time:

$ gcloud compute instances stop INSTANCE_NAMES [INSTANCE_NAMES …]

If the gcloud command line unable to stop the instance then, you can take a look into activity log or stackdriver logs which will help you to debug further. Also at the same time I would recommend running the gcloud command along with flag ‘--verbosity=debug’. Either the activity logs, stackdriver logs or gcloud command line with ‘--verbosity=debug’ flag will give you a better output which will help you to review from what point it is failing.

like image 102
Shaiq Avatar answered Oct 11 '22 10:10

Shaiq