1 Answer
- Newest
- Most votes
- Most comments
2
Added the comment here as an answer for anybody who finds this in the future: Is the issue just around the instances getting replaced from the "double the size" launch? If so, it sounds like an Instance Maintenance Policy might work for you. https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html
You can now add both a MinimumHealthyPercent and MaxHealthyPercent to your Instance Refresh settings. This would avoid needing to double the instance count ahead of time. You could (for example) set MinHP to 100%; and MaxHP to 150%. This would mean the ASG would run 2 batches of replacements, but it would start by launching new instances first before terminating anything
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 5 months ago
Just confirming, your feature request here is essentially "skip instances newer than X date"? Can you give some more details on when you would need this flag in an instance refresh vs a Max Instance Lifetime? https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html
Yes our feature request is "skip instances newer than X time"
During instance launch it pulls new configs. And it creates a volume from an updated snapshot and attach to the instance itself. We do continuous deployment, it will happen at least 10 times a day. Updating launch template each time is not an appropriate idea for this.
Also we want to keep 100% of instances all the times. So if we set instance healthy percentage to 100% Instance Refresh replaces instance 1 at a time, which increases deployment time. Therefore we double the instances and set 40% as healthy percentage. By using this approach it replaces newly launched instances too, which is unnecessary.
Therefore we currently running a script to double the instance count and once ready terminate the old instances.
we can't use maximum instance lifetime because instances launched at 12:01 PM may have newer configs while instances launched at 12:00 PM may have older configs. In this case, how do you set max instance lifetime? If we start the deployment at 12:02 by setting instance lifetime as 60 seconds, then it would run indefinitely because warmup time is 3mins. And AWS recommends to use 1 Day as max instance lifetime.
Yes, Looks like this new feature is promising. We may need to choose "Launch before terminating" and set max percentage as 200%. We will evaluate it. Thank you.
Is the issue just around the instances getting replaced from the "double the size" launch? If so, it sounds like an Instance Maintenance Policy might work for you. https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html
You can now add both a MinimumHealthyPercent and MaxHealthyPercent to your Instance Refresh settings. This would avoid needing to double the instance count ahead of time. You could (for example) set MinHP to 100%; and MaxHP to 150%. This would mean the ASG would run 2 batches of replacements, but it would start by launching new instances first before terminating anything