# New ec2 instance provisioning failing

**URL:** <https://forum.ansible.com/t/new-ec2-instance-provisioning-failing/18498>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [June 15, 2015, 8:36am UTC](https://forum.ansible.com/t/new-ec2-instance-provisioning-failing/18498 "2015-06-15T08:36:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zygis\_A](https://avatars.discourse-cdn.com/v4/letter/z/9d8465/32.png) [@Zygis\_A](https://forum.ansible.com/u/Zygis_A)\
**Post date:** [June 15, 2015, 8:36am UTC](https://forum.ansible.com/t/new-ec2-instance-provisioning-failing/18498/1 "2015-06-15T08:36:41Z")

</div>

Hello, I’m using ansible to launch and provision new ec2 instances and we noticed some strange behavior while launching different types of instances. I tried provisioning multiple m3.large instances while also adding additional EBS volumes (gp2 type, 12GB and 100GB). We noticed that instances came up with all the volumes attached but after a couple of seconds instances were shutdown and then immediately terminated. State transition reason had the following error: Server.InternalError: Internal error on launch. At first I thought that it might be related to some sort of ec2 service restrictions but I then tried to create exactly the same instance using AWS GUI and it worked. I then tried the same setup with t2.micro and it also worked perfectly fine, instance came up with all the volumes with no issues. I also tried to provision m3.large with no additional volumes and this also worked as expected.

Playbook I’m using:

- name: Provision {{count}} instance(s) in {{region}}  
hosts: localhost  
gather\_facts: False  
vars\_files:
- vars/credentials.yml
- “vars/{{ region }}.yml”

tasks:

- name: Create new ec2 key pair with ansible public key  
ec2\_key:  
name: ansible  
key\_material: “{{ item }}”  
region: “{{region}}”  
aws\_access\_key: “{{ ec2\_access\_key }}”  
aws\_secret\_key: “{{ ec2\_secret\_key }}”  
with\_file: /root/.ssh/id\_rsa.pub

- name: Launch instance  
ec2:  
aws\_access\_key: “{{ ec2\_access\_key }}”  
aws\_secret\_key: “{{ ec2\_secret\_key }}”  
key\_name: ansible  
group: “{{ ec2\_group }}”  
instance\_type: m3.large  
image: “{{ ec2\_image }}”  
wait: true  
count: “{{ count }}”  
vpc\_subnet\_id: “{{ ec2\_vpc\_subnet\_id }}”  
assign\_public\_ip: yes  
count: “{{ count }}”  
region: “{{region}}”  
instance\_tags:  
Name: ec2-{{ region }}-node  
volumes:

- device\_name: /dev/xvdb  
device\_type: gp2  
volume\_size: 12  
delete\_on\_termination: true

- device\_name: /dev/xvdf  
device\_type: gp2  
volume\_size: 100  
delete\_on\_termination: true  
register: ec2

Information that might be helpful: ansible version: 1.9.1 boto version: 2.38.0 Any suggestions on how to solve this?

Thanks!
