简体   繁体   中英

AWS automatically keep on creating ECS instance.

I was playing with ECS service and ended up deleting all services and related clusters. But in ec2 dashboard, as soon as I kill instances like "ECS Instance - EC2ContainerService-default-8f8f5fd5-dbfc-4f81-843a-c028e86a1657" it creates another instance. Do any one have pointers how can I disable this automatic build.

Did you create the instance thru Elastic Beanstalk? Chances are ELB, or an autoscaling policy is interpreting your instance being shutdown as a crash, so its creating a new one to replace it, ie doing what it is supposed to do.

Make sure any autoscale policies you have in place are also turned off.

In my case it was the autoscalling policy and as I am pretty new to AWS from GCP it was a bit of a doozy to find.

On the EC2 console page just scroll down on the left to the Auto Scaling or: https://console.aws.amazon.com/ec2/autoscaling/home?region=us-east-1#AutoScalingGroups :

Deregister container instances and delete cluster. Click the "x" of the cluster you want to delete. It will stop creating a new instance automatically. Regards, Thirumal Peesari

事实证明,存在一些自动缩放策略,它正在推动新虚拟机的创建

对我来说,重新创建终止实例的是 CloudFormation 策略。

For me it was "Spot Request". Even though I terminated the instance, the spot request would make a new one everytime my bid could be fulfilled.

In the instance details page, under tags you could find which one of the on-demand instance would have created the instance. ECS supports spot instance selection and in case if you have deleted the cluster, most likely it wouldnt have deleted the spot requests which you could find under (change it for your region) https://us-east-2.console.aws.amazon.com/ec2/home?region=us-east-2#SpotInstances :

deleting the spot request resource would kill you phantom instances

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM