amazon-archives/ec2-scheduler

Support for pausing autoscale groups when shutting down connected instances

peitschie opened this issue · 2 comments

Hi,

I was wondering if it would be possible to support pausing connected or tagged autoscale groups when deactivating instances. I have a few setups that are linked to autoscale groups so the pools can be expanded during peak use during the day, but it's also very handy to have a central place to go to shutdown all the instances over night.

Currently, I can add individual scheduled actions to set min/desired to 0 to match the ec2 schedules, but this can get tricky when these groups are being churned (E.g., trialing new cloudformation stacks in dev), and it introduces the possibility of a different time being used for the ASGroup.

Thanks!

The instances in the AutoScaling Group (ASG) are terminated. You can't stop and start instances in the ASG.

You can't stop and start instances in the ASG

Yep... I can appreciate that there is no on/off switch on ASG. However, without being able to disable the ASG, ec2 scheduler and the ASG end up fighting, starting and stopping instances during the off hours.

An implementation idea to turn "off" an ASG is if the ASG's Desired count is non-zero, store this number in a non-propagating tag on the ASG, and then update the Desired count to 0. To turn it back "on", check if the ASG's Desired count is still 0, and then set the ASG's Desired count off the tag value, and remove the tag.

The upside of that approach is it doesn't require any db sync or similar which may get out of whack with the ASG, and is pretty easy to visually verify the ASG has been disabled by ec2-scheduler.

Is that something you could possibly see this project supporting? I'm could contribute code to help if you'd be willing to accept such a feature.