Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to permanently delete Google managed VMs

I am unable to permanently delete Google App Engine managed VMs I've created. I've deleted them multiple times both from the developer's console and by using the gcloud command. In every case the command completes successfully and the VM is deleted, but then almost immediately Google creates a brand new VM to take its place.

Does anyone know how to permanently delete managed VMs? Thanks.

like image 377
Howard Avatar asked Mar 05 '15 17:03

Howard


3 Answers

We are working on improving this experience. For now, though, one workaround is to deploy a non-Managed VM instance as the default version and delete any other versions that are Managed VM-based. Again, this issue is on our radar to be fixed.

[Chris Ramsdale, Product Manager for App Engine]

like image 63
Chris Ramsdale Avatar answered Nov 09 '22 05:11

Chris Ramsdale


I wanted to update this post with some of my solutions to deploying (with versions) and deleting instances on Google Compute Engine's managed VMs. Here's a solution I found for deleting the default GCE managed VM:

  • Make sure you have the up-to-date GCE components. Run gcloud components update in the Google Cloud SDK Shell.
  • In your app.yaml, remove the vm:true, resources: section, and manual scaling: section.
  • Navigate to Compute -> App Engine -> Versions and record the <default-version-number>. Mine looks like 20150722t1245032 with the words (default) indicating the default version.
  • Deploy the application, set the default, and specify the default version. gcloud preview app deploy "...\app.yaml" --set-default --version=<default-version-number>.
  • Navigate to Compute -> Compute Engine -> VM instances. Select the default instance and delete.

I was also taught how to stop deploying additional instances:

  • The key is to specify the version number gcloud preview app deploy "...\app.yaml" --set-default --version=<version-number>. @ZacharyNewman was able to help me with this problem.

And finally, this is how to delete the additional versions of an instance:

  • Navigate to Compute -> App Engine -> Versions and delete the versions you don't want.
  • Navigate to Compute -> Compute Engine -> VM instances. Select the instances you don't want and delete.

Hope this helps!

like image 3
Aaron Yan Avatar answered Nov 09 '22 06:11

Aaron Yan


There might be a simpler way to explain this -- "basically, you cannot delete a version that's receiving 100% of the traffic."

Therefore, you just need to create a non managed VM, like a simple helloworld application. Then, you can move all of the traffic to this helloworld application (see graphic, I named mine version 0), then, delete version 20160... or whatever the name of your vm is.

enter image description here

At some point in time, you're probably going to experiment or spin up your managed VM again. When you do that, it will automatically start getting 100% of the traffic.

Or, if you happen to know version number receiving 100% of the traffic, you can always deploy a simple, non managed VM, with this version.

like image 1
Mike Chirico Avatar answered Nov 09 '22 06:11

Mike Chirico