Reputation: 902
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.
Upvotes: 10
Views: 6742
Reputation: 81
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
Upvotes: 1
Reputation: 1476
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.
Upvotes: 2
Reputation: 271
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:
Upvotes: 14
Reputation: 1674
For me it was CloudFormation policy that re created terminated instances.
Upvotes: 1
Reputation: 21
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
Upvotes: 2
Reputation: 902
It turned out that some autoscale policy is there which is kicking the creation of new vm
Upvotes: 1
Reputation: 46879
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, i.e. doing what it is supposed to do.
Make sure any autoscale policies you have in place are also turned off.
Upvotes: 25