阅读背景:

从linux命令行停止一个linux aws实例

来源:互联网 

Is there a way to stop and AWS ec2 instance from the VM itself? If i start a ec2 linux based instance, is there a way for me to stop that instance by giving some linux command like "shutdown now"?

是否有办法停止和AWS ec2实例从VM本身?如果我启动一个基于ec2的linux实例,是否有办法通过提供一些linux命令来停止这个实例,比如“现在关闭”?

1 个解决方案

#1


2  

Yes, with a couple of caveats.

是的,有几个注意事项。

  1. If you are using an instance store backed instance, your only option will be to terminate. Without EBS volumes, the instance cannot exist in a stopped state.

    如果您使用的是实例存储支持实例,那么您的惟一选项将是终止。没有EBS卷,实例不能以停止状态存在。

  2. There is also a flag that can be set on the instance as to how instance initiated shutdown is handled. This can be stop or terminate. If you want to stop your instance, make sure that this flag is configured correctly.

    对于如何处理实例发起的关机,还可以在实例上设置一个标志。这可以停止或终止。如果希望停止实例,请确保该标志已正确配置。

Other than that, you would use the normal Linux shutdown commands. shutdown now

除此之外,还可以使用常规的Linux关机命令。关闭现在


分享到: