x instances already in AWS load balancer, makign auto scale group starts adding more instances
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , It would still create minimum number of instances the moment you create the autoscaling group. Reason being that the autoscaling policy will create its own instances, and won't consider the instances already in the process, so one will have to get rid of the old ones and let the new ones be.
|
Getting a list of instances in an EC2 auto scale group?
Date : March 29 2020, 07:55 AM
wish of those help I actually ended up writing a script in Python because I feel more comfortable in Python then Bash, #!/usr/bin/env python
"""
ec2-autoscale-instance.py
Read Autoscale DNS from AWS
Sample config file,
{
"access_key": "key",
"secret_key": "key",
"group_name": "groupName"
}
"""
from __future__ import print_function
import argparse
import boto.ec2.autoscale
try:
import simplejson as json
except ImportError:
import json
CONFIG_ACCESS_KEY = 'access_key'
CONFIG_SECRET_KEY = 'secret_key'
CONFIG_GROUP_NAME = 'group_name'
def main():
arg_parser = argparse.ArgumentParser(description=
'Read Autoscale DNS names from AWS')
arg_parser.add_argument('-c', dest='config_file',
help='JSON configuration file containing ' +
'access_key, secret_key, and group_name')
args = arg_parser.parse_args()
config = json.loads(open(args.config_file).read())
access_key = config[CONFIG_ACCESS_KEY]
secret_key = config[CONFIG_SECRET_KEY]
group_name = config[CONFIG_GROUP_NAME]
ec2_conn = boto.connect_ec2(access_key, secret_key)
as_conn = boto.connect_autoscale(access_key, secret_key)
try:
group = as_conn.get_all_groups([group_name])[0]
instances_ids = [i.instance_id for i in group.instances]
reservations = ec2_conn.get_all_reservations(instances_ids)
instances = [i for r in reservations for i in r.instances]
dns_names = [i.public_dns_name for i in instances]
print('\n'.join(dns_names))
finally:
ec2_conn.close()
as_conn.close()
if __name__ == '__main__':
main()
|
Boot strapping AWS auto scale instances
Date : March 29 2020, 07:55 AM
This might help you EC2 instances offer a feature called User Data meant to solve this problem. User Data executes a shell script to perform provisioning functions on new instances. A typical pattern is to use the User Data to download or clone a configuration management source repository, such as Chef, Puppet, or Ansible, and run it locally on the box to perform more complete provisioning. As @e-j-brennan states, it's also common to prebundle an AMI that has already been provisioned. This approach is faster since no provisioning needs to happen at boot time, but is perhaps less flexible since the instance isn't customized.
|
Why does Azure Auto-Scale scale go lower then minimum amount of instances?
Date : March 29 2020, 07:55 AM
it should still fix some issue Oops. Apparently I had set up a day / night time schedule, and at this certain point it went to the night time schedule where it was min/max 1 instance.
|
AWS: how to configure EC2 instances during auto scale
Date : March 29 2020, 07:55 AM
this one helps. There are basically two choices for configuring an Amazon EC2 instance that is created using Auto Scaling: A fully-configured AMI A User Data script that configures the instance
|