如何在不终止实例的情况下停止计算引擎实例? [英] how to stop compute engine instance without terminating the instance?

查看:72
本文介绍了如何在不终止实例的情况下停止计算引擎实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用debian作为源图像的Google Compute Engine.我知道只要实例运行,我都会按小时收费,无论我是否使用ssh. shutdown -h命令显然将实例置于终止模式,而下一次我将不得不再次创建该实例.

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说: https://developers.google.com/compute/docs/troubleshooting 如果使用sudo shutdown或sudo poweroff关闭实例,则相当于终止实例.无法冻结"实例并在以后重新启动它.如果选择关闭实例,则必须重新创建实例.从内部关闭实例后,它会进入TERMINATED状态,但仍会出现在API中(例如,当您列出实例时).要将其从列表中删除,必须显式删除该实例.但是,TERMINATED实例的正常运行时间不计入费用.

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.

推荐答案

我的问题是,如何关闭虚拟机而不终止虚拟机?这是一个选择吗?

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

不幸的是,你不能.在关闭时保留实例时,AWS EC2是一个例外.甚至OpenStack提供程序都不是开箱即用的.解决方法是根据所需快照创建映像,然后根据该映像创建新实例.

Unfortunately, you can't. AWS EC2 is the exception when it comes to preserving instances on shutdown. Not even OpenStack providers support that out of the box. The workaround is to create an image based on the snapshot you want and then create a new instance based on that image.

这篇关于如何在不终止实例的情况下停止计算引擎实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆