Questions tagged with Amazon EC2 Auto Scaling
Content language: English
Sort by most recent
Autoscaling group points to old version of launch template
Hello, I'm creating a launch template and autoscaling group through cloud formation. The auto-scaling group is currently pointed to the DefaultVersion of the launch template, which is version 1. The latest version of the launch template is version 2. I updated the default version of the launch template to version 3, but I don't see it reflected in the auto-scaling group. I know we update the launch template version through instance refresh, but I would like to know if this is expected behavior to still see version 1 in the autoscaling group even though the default version is now version 2. I want to handle the updates through cloud formation. The problem I'm trying to solve is how do I push changes through cloud formation and handle the updates gracefully in the auto-scaling group. For example - I have two autoscaling groups using the same launch template. Then I decide to update one auto-scaling group to have a different ami. There will be two versions of the launch template, version 1 will have the old ami, and version 2 will have the latest ami. I'd like to gracefully roll out the changes to the autoscaling group 2 through cloud formation. Question 1 - How can I change the auto-scaling group through cloud formation and replace instances gracefully? Question 2 - If I change the version number in the cloud formation template, does it terminate instances first and then redeploy the new ec2 or the other way around?
Auto Scale EC2 Instances using Lambda function/CloudWatch Metrics
Hello, I have a task that I have to do on my work and I would really appreciate if anyone can assist me on this. The assignment that I have to implement, is to create an 'Auto scaling group' using a value that is returned from a 'lambda function'. After an exhausting research, I have found that i have to Create an 'AutoSG', then select 'Predictive policy' and then choosing 'Custom cloudWatch Metric'. From their somehow i have to select the metric that came from lambda function. My problem their is how to construct 'JSON-formatted payload that contains the custom metric definition on Predictive Policy.' Moreover, do I need to add some additional code in my lambda function to send the returned value to 'Auto scaling Group'? Forgot to mention that my lambda function will executing a query on AWS RDS(mySQL) and return that value. Relative resources: https://docs.aws.amazon.com/autoscaling/ec2/userguide/predictive-scaling-customized-metric-specification.html https://aws.amazon.com/blogs/containers/autoscaling-amazon-ecs-services-based-on-custom-cloudwatch-and-prometheus-metrics/
Bug Report - Copy Launch configuration to launch template
Proceed as follows: step 1: go to Launch configurations console. step 2: choose a Launch configuration. step 3: copy to launch template > Copy selected > Copy. I got an error message: "The security group ID 'awseb-e-yy32fjb***-stack-AWSEBSecurityGroup-RKGBZ9JQ****' is not valid. The expected format is sg-xxxxxxxx or sg-xxxxxxxxxxxxxxxxx." After investigating, I realized that AWS is taking "Security name" data instead of "Security ID" when copying Launch configuration to launch template. as in my case above, 'awseb-e-yy32fjbzmp-stack-AWSEBSecurityGroup-RKGBZ9JQ****' is the security group name, AWS sends this data as security group ID, so get above error.
EC2 Instance Terminated Itself, Termination Protection was Enabled
I have a scary situation that is currently unfolding. Our production server, which has been running for nearly three years, suddenly terminated itself. We have no idea why or more importantly how since the instance had termination protection enabled. As soon as I learned the server was down I checked the details in AWS and saw that somehow termination protection had been changed to disabled. How is any of this possible? Why would an instance terminate itself? Isn't the point of termination protection to make sure this doesn't happen? I've now got a production environment completely offline and I have no idea why. I'm fortunate that my senior developers were able to jump right in, but they are not AWS experts. So who knows how long it will take to get everything back online. I'd just really like to know how this could happen. Especially with the amount of money I pay each month. I'm just dumbfounded.
Is Elastic Beanstalk affected by ec2 Autoscaling Launch Configurations deprecation?
I received information that Amazon EC2 Launch Configurations will Deprecate support for new Instances (https://aws.amazon.com/blogs/compute/amazon-ec2-auto-scaling-will-no-longer-add-support-for-new-ec2-features-to-launch-configurations/). When running inventory check I see that all Elastic Beanstalk clusters are using deprecated functionality but there is no migration path in documentation. How does the change impacts Elastic beanstalk users?
Code Deploy Stuck for 30 mins on afterInstall hook
So, I set up bitbucket pipelines this morning for a wordpress-php website. I have a afterInstall script which changes the permissions & user of wordpress directories etc. The problem is when the deployment starts, it took only 9 seconds for install step. but on afterInstall step, the code deploy stuck for nearly 30 mins, and then it reached to last step. and when the deployment ends, on bitbucket it says Failed, but my latest code is successfully deployed on servers. my zip folder is of 138MB Why the code deploy process stucks at afterInstall. there is nothing showing up in code deploy logs of that specific ec2 instance on which deployment is running.
EFS mount on ec2 not tolerant of zone failure
Hi, I use a efs mount on my ec2s that are part of a auto scaling group. Whilst doing some house keeping I spotted that the efs was spread across three subnets that I didn't intend. I used the manage network option within the EFS console and removed a zone and then added it back with the correct subnet. This caused the mount on my ec2's to become unresponsive. I simple reboot resolved the issue. This got me thinking about what would happen with a zone failure so I did some tests. It appears that if you remove a zone from an EFS, if the ec2 mount isn't using that zone then everything is ok, however, if that zone is currently being used, then the ec2 mount doesn't failover to another zone and the mount becomes un-responsive. Is there any way to mitigate a zone failure on a efs mount or is this a single point of failure in a system using efs mounts? My fstab entry options are; nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0 Thanks for any advice.
adding a schedule to your auto scaling group to run Monday-Friday, 8am to 5pm
hi Guys, So, I was tasked with adding a schedule to the auto scaling group to run Monday-Friday, 8am to 5pm only. So my schedule look like this:![screenshot of the schedule](/media/postImages/original/IMxn55yOIGRfOaQ346EAE49A) Apparently, the schedule is not working as it should and I can't find what is wrong. Can anyone identify what is wrong with this configuration. So the EC2 should only run between hours of 8am to 5pm MON-FRI. Thank you.
EC2 Blue/Green CodeDeploy fails with "You must specify a PredictiveScalingConfiguration"
I followed the instructions in https://docs.amazonaws.cn/en_us/autoscaling/ec2/userguide/predictive-scaling-customized-metric-specification.html to try to add predictive auto-scaling to the current deployment group in my running Blue/Green deployment system (I use the deployment mode where it copies the ASG at each deployment instead of swapping the same two in/out). I did NOT enable scale-from-forecast (yet). When I run a CodePipeline release that then tries to run the blue/green deployment it fails on the "provisioning instances" (step 1) with "You must specify a PredictiveScalingConfiguration", which I'm pretty sure is what I've just done (I look at the ASG, and it has one, and is showing a forecast). I have to delete the predictive scaling completely from the ASG in order to get it to work. Any tips would be greatly appreciated.
Can I have an auto scaling group with just a warm pool ?
I have an existing environment with a number of ec2 instances that are up and running 24/7. I am seeing additional transaction volumes which are starting to strain the existing environment at times. The transaction volumes are not constant but scattered at different days and times. I was looking to see if I could create a scaling group with just warm pools. I am looking at warm pools because of the pre-configured ec2 instances. Is it possible to have an autoscaling group with just a warm pool ? Can I have these spin up when the existing environment hits some threshold ?
instance re-launch after termination
Hi, I've got a r5a.large instance, which is not in use. when I'm trying to terminate the instance, different instance is being launced automatically. I read that it might be connected to EC2 Auto-Scaling (https://repost.aws/questions/QUE3qVZUzERzeFOzwMMe44gQ/a-new-ec-2-instance-is-created-after-termination-of-the-only-instance), but nothing appears in my console when I'm trying to follow instructions (cannot delete ant auto-scaling group, because I don't have one) (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-process-shutdown.html). please, help me terminate all EC2s. Thanks, Adi