前段时间有一个新闻在业界沸沸扬扬,即指责X云主机在关机状态下仍然计费不合理,给用户带来了困扰,比如以下场景:
1 测试环境场景:
每次搭建复杂的测试场景,需要花费大量时间精力,本次测试到下次测试间,资源处于闲置状态。
用户痛点:如果保留环境资源,需要为资源支付费用;如果释放资源,则下次测试需要大量重复部署工作。
用户期望:既能保留测试环境,又无需为空闲资源支付额外费用。
当前主要公有云厂商的方案:
AWS:http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-ug.pdf
Stopping an instance
When an instance is stopped, the instance performs a normal shutdown, and then transitions to a stopped state. All of its Amazon EBS volumes remain attached, and you can start the instance again at alater time.You are not charged for additional instance usage while the instance is in a stopped state. A minimum of one minute is charged for every transition from a stopped state to a running state. If the instance typewas changed while the instance was stopped, you will be charged the rate for the new instance typeafter the instance is started. All of the associated Amazon EBS usage of your instance, including rootdevice usage, is billed using typical Amazon EBS prices.When an instance is in a stopped state, you can attach or detach Amazon EBS volumes. You can alsocreate an AMI from the instance, and you can change the kernel, RAM disk, and instance type.
Terminating an instance
When an instance is terminated, the instance performs a normal shutdown, then the attached AmazonEBS volumes are deleted unless the volume's deleteOnTermination attribute is set to false. Theinstance itself is also deleted, and you can't start the instance again at a later time.To prevent accidental termination, you can disable instance termination. If you do so, ensure thatthe disableApiTermination attribute is set to true for the instance. To control the behaviorof an instance shutdown, such as shutdown -h in Linux or shutdown in Windows, set theinstanceInitiatedShutdownBehavior instance attribute to stop or terminate as desired.Instances with Amazon EBS volumes for the root device default to stop, and instances with instancestoreroot devices are always terminated as the result of an instance shutdown.
AWS中实例提供两种状态,停止实例(stopping)和释放实例(Terminating)。
停止实例状态下,EBS卷仍然挂载在实例上,用户可以快速启动实例;
用户无需为停止状态的实例付费,每次从停止到运行状态至少会计费1分钟;
如果在停止时改变了实例类型规格,启动后按新的实例类型收费;
而实例所使用的EBS存储则会按EBS的计价进行计费;
释放实例状态下,EBS卷会被删除,除非进行另外的设置;实例也会被删除;
可见,AWS在停止实例状态下,用户的配置得以保存,而用户需要为存储而无需为计算实例付费。
aliyun:https://help.aliyun.com/knowledge_detail/40653.html