How to permanently delete Google managed VMs

痴心易碎 提交于 2019-11-30 12:44:47

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]

Aaron Yan

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!

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.

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.

In Google Cloud Console under App Engine -> Versions , select the default version of your managed VM application and use STOP button to turn it off.

I ran into the same problem this is how i was able to stop the managed VM permanently. Just go to appengine -> settings -> disable application. This will automatically stop and delete your VM. In future if you want to run managed vm just enable application this will redeploy your application to the last known version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!