can't create AutoScaling group from launch template

0

Trying to set up an AutoScaling Group in EC2.
I created my launch template from an existing EC2 instance.
When I try to create an AutoScaling group from the template, I get an error:

Invalid details specified: You must use a valid fully-formed launch template. The snapshot 'snap-01f81649f7729cfe4' does not exist.

I've tried all sorts of workarounds but can't get past this. What am I doing wrong?

Thanks.

질문됨 5년 전5628회 조회
5개 답변
0

Hi,
I cannot reproduce that error. Here are the steps I performed when I tried to reproduce:

In us-east-1:
1. Services->EC2
2. Launch Instance
3. Select Amazon Linux 2 AMI
4. Select t2.micro
5. Click Review and Launch
6. Click Launch, Choose my Existing Key Pair, and click Launch Instances
7. Click on my newly created EC2 instance
8. Click Actions-> Create Template From Instance
9. In 'Launch template:' enter "MyTemplate"
10. Click Create Template From Instance Button
11. Click on 'Create Auto Scaling group' link
12. In Group name, enter: "MyASG"
13. In the Subnet, select an existing subnet
14. Click Next: Configure scaling policies
15. Click 'Review'
16. Click Create Auto Scaling Group button
The Auto Scaling group is successfully created and another EC2 instance is launched.

What are you doing differently than the above steps? (also, if you can check that the above path works in your environment, that might also be helpful).
-randy

답변함 5년 전
0

Thanks for the quick reply, Randy.

I'm starting with an EC2 instance that I've had in service for several months, functioning as my production web server. Following the AWS instructions in how to create a launch template, what I do is select the instance, click the "Actions" button above, and select "Create template from instance."

That part goes fine. It's when I go to create the Autoscaling group that I get stuck. For some reason it doesn't like the launch template. I suspect it may have to do with the fact that the EBS volume currently attached to the instance as the root device may have been created from a snapshot after the instance was originally created.

How do I work around this? My goal at this point is simply to "clone" my current production server instance into a launch template. Do I have to make a new AMI first? Seems like from the AWS documentation I should be able to just create a new launch template directly from the existing instance--but somehow the AutoScaling group rejects this template.

답변함 5년 전
0

Yes,
I think you found an edge case bug with how Launch Templates keep old references to EBS Volume snapshots that no longer exist. I was also to reproduce a similar scenario by attaching an EBS Volume that had been snapshot and attaching it to my EC2 instance and then deleting the snapshot before attempting to "Create template from instance". I could not create the auto scaling group due to the missing snapshot.

I also tried out what you suggested... I followed the steps below and it seemed to work fine, at least in my environment.

1. Create an AMI from existing environment
2. Click on Launch Templates
3. Click on Create launch template
4. Add Launch template Name
5. Add in the AMI ID that was created in step 1
6. Fill out the rest of the info and hit 'Create launch template'
7. The click on Actions->Create Auto Scaling group

-randy

답변함 5년 전
0

It does seem to be a bug of some sort. But it doesn't necessarily seem to be caused if the snapshot is missing. I tried this workaround and it also failed:

  1. take snapshot of existing instance and create a new volume from it
  2. launch new instance from standard Ubuntu AMI
  3. detach volume from new instance and attach new volume created in step 1
  4. create launch template from new instance

When I tried to create an AutoScaling group, I got a similar error:
Tried creating a new instance, attaching latest snapshot, but got:

Invalid details specified: You must use a valid fully-formed launch template. snapshotId cannot be modified on root device

I guess I need to create a new AMI from my existing instance, then use that as the basis for a launch template.

I'll try that next. Appreciate your help. If I can get this to work it should help make my setup a lot more resilient.

The next problem I have to tackle, though, is that I'm going to have to update my launch template every time there are changes to the server. I wish I could find a way to automate that...an EFS might work, need to educate myself on how that all works and make sure it doesn't cost an arm and a leg.

Edited by: MrMegunticook on Sep 18, 2019 4:33 AM

Edited by: MrMegunticook on Sep 18, 2019 4:34 AM

답변함 5년 전
0

All set--see my last post.

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠