Note that there are some explanatory texts on larger screens.

plurals
  1. POAuto Scaling Group launch config changes
    primarykey
    data
    text
    <p>I wonder if there is a simple way or best practices on how to ensure all instances within an AutoScaling group have been launched with the current launch-configuration of that AutoScaling group.</p> <p>To give an example, imagine an auto-scaling group called <code>www-asg</code> with 4 desired instances running webservers behind an ELB. I want to change the AMI or the userdata used to start instances of this auto-scaling group. So I create a new launch configuration <code>www-cfg-v2</code> and update <code>www-asg</code> to use that.</p> <pre><code># create new launch config as-create-launch-config www-cfg-v2 \ --image-id 'ami-xxxxxxxx' --instance-type m1.small \ --group web,asg-www --user-data "..." # update my asg to use new config as-update-auto-scaling-group www-asg --launch-configuration www-cfg-v2 </code></pre> <p>By now all 4 running instances still use the old launch configuration. I wonder if there is a simple way of replacing all running instances with new instances to enforce the new configuration, <strong>but</strong> always ensure that the minimum of instances is kept running.</p> <p>My current way of achieving this is as follows..</p> <ol> <li>save list of current running instances for given autoscaling group</li> <li>temporarily increase the number of desired instances +1</li> <li>wait for the new instance to be available</li> <li><p>terminate one instance from the list via</p> <pre><code>as-terminate-instance-in-auto-scaling-group i-XXXX \ --no-decrement-desired-capacity --force </code></pre></li> <li><p>wait for the replacement instance to be available</p></li> <li>if more than 1 instance is left repeat with 4.</li> <li><p>terminate last instance from the list via</p> <pre><code>as-terminate-instance-in-auto-scaling-group i-XXXX \ --decrement-desired-capacity --force </code></pre></li> <li><p>done, all instances should now run with same launch config</p></li> </ol> <p>I have mostly automated this procedure but I feel there must be some better way of achieving the same goal. Anyone knows a better more efficient way? </p> <p>mathias</p> <p>Also posted this question in the official <a href="https://forums.aws.amazon.com/thread.jspa?threadID=135513">AWS EC2 Forum</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload