[英]AWS EC2 how to change instance type when the instance is connected to an autoscaling group?
I'm getting puzzled by this,我对此感到困惑,
I need to increase the specs of an EC2 instance and following this tutorial: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-resize.html#change-instance-type-of-ebs-backed-instance我需要增加 EC2 实例的规格并遵循本教程: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-resize.html#change-instance-type-of-ebs -支持的实例
but it appears that the instance is connected to an autoscaling group, so as soon as I stop it another one is spawn, and the one I stopped is terminated, so I can't change its type.但似乎该实例已连接到一个自动缩放组,因此一旦我停止它,就会产生另一个实例,而我停止的实例已终止,因此我无法更改其类型。
I tried detatching the instance from the autoscaling group, but it doesn't do it because there needs to be at least one.我尝试从自动缩放组中分离实例,但它没有这样做,因为至少需要一个。
and if I change the minimum capacity it actually also terminates it and can't update its type.如果我更改最小容量,它实际上也会终止它并且无法更新它的类型。
how can I change the instance type of this EC2 box?如何更改此 EC2 框的实例类型?
Try creating a new launch configuration with the new ami and point the auto scaling group to use it尝试使用新的 ami 创建新的启动配置,并指向 Auto Scaling 组以使用它
EDIT:编辑:
Try following this: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html尝试以下操作: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html
Auto Scaling groups have either a Launch Template or Launch Configuration attached to them. Auto Scaling 组具有附加的启动模板或启动配置。 These specify what kind of properties have the instances which are launched by the auto scaling group.这些指定哪些属性具有由 Auto Scaling 组启动的实例。
If you want to modify the type of an instance controlled by an ASG, you have to update the Launch Configuration/Launch Template.如果要修改由 ASG 控制的实例的类型,则必须更新启动配置/启动模板。 Afterwards, you can terminate the running instances one by one, the auto scaling group will relaunch them with the updated properties.之后,您可以逐个终止正在运行的实例,Auto Scaling 组将使用更新的属性重新启动它们。
The correct way to modify the instance size is by changing the Launch Template or Launch Configuration .修改实例大小的正确方法是更改 Launch Template 或 Launch Configuration 。 Note that this will only apply to newly launched instances, not existing instances.请注意,这仅适用于新启动的实例,不适用于现有实例。
If you particularly want to keep an existing instance, you could suspend autoscaling processes with:如果您特别想保留现有实例,可以使用以下命令暂停自动缩放过程:
aws autoscaling suspend-processes
Then you can stop/modify/start the instance.然后您可以停止/修改/启动实例。 Then, reactivate processes with:然后,使用以下命令重新激活进程:
aws autoscaling resume-processes
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.