# new AWS EC2 instance created using ansible does not use SSD

**URL:** <https://forum.ansible.com/t/new-aws-ec2-instance-created-using-ansible-does-not-use-ssd/19632>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [October 27, 2015, 4:10pm UTC](https://forum.ansible.com/t/new-aws-ec2-instance-created-using-ansible-does-not-use-ssd/19632 "2015-10-27T16:10:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abey\_Thomas](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Abey\_Thomas](https://forum.ansible.com/u/Abey_Thomas)\
**Post date:** [October 27, 2015, 4:10pm UTC](https://forum.ansible.com/t/new-aws-ec2-instance-created-using-ansible-does-not-use-ssd/19632/1 "2015-10-27T16:10:55Z")

</div>

Hi ,

I am trying to create EC2 instances using ansible module ec2 and the root volume gets created as “standard”. I would like that to be “gp2”

Below is the play that I am using

- name: Launch the new EC2 Instance  
ec2:  
group: ‘{{ security\_group }}’  
instance\_type: ‘{{ instance\_type}}’  
image: ‘{{ image }}’  
wait: true  
region: ‘{{ region }}’  
vpc\_subnet\_id: ‘{{ vpc\_subnet\_id }}’  
keypair: ‘{{ keypair }}’  
count: 20  
volumes:
- device\_name: /dev/sda1  
volume\_type: gp2  
volume\_size: 10  
register: ec2

I can create gp2 volumes using ec2\_vol and attach to EC2, however I would like my root volume to be gp2. I can create EC2 root volume using AWS console from the same AMI.

Is it possible to use gp2 for root volumes ?

Thanks,  
Abey

---

<div class="post-metadata">

**Author:** ![igorc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/igorc/32/5491_2.png) [@igorc](https://forum.ansible.com/u/igorc)\
**Post date:** [October 28, 2015, 8:22am UTC](https://forum.ansible.com/t/new-aws-ec2-instance-created-using-ansible-does-not-use-ssd/19632/2 "2015-10-28T08:22:51Z")

</div>

Probably it is not supported and I can't see any of examples in the docs referring to /dev/sda1 in the volumes section.

What you can do though is go to your ec2 console and set gp2 type as default when launching new instances.

---

<div class="post-metadata">

**Author:** ![viper233](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/viper233/32/2060_2.png) [@viper233](https://forum.ansible.com/u/viper233)\
**Post date:** [October 28, 2015, 4:04pm UTC](https://forum.ansible.com/t/new-aws-ec2-instance-created-using-ansible-does-not-use-ssd/19632/3 "2015-10-28T16:04:01Z")

</div>

Would this depend on the AMI being used having a root ssd volume?

I’m unsure of this and would be happily corrected.

---

<div class="post-metadata">

**Author:** ![Abey\_Thomas](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Abey\_Thomas](https://forum.ansible.com/u/Abey_Thomas)\
**Post date:** [November 4, 2015, 3:49pm UTC](https://forum.ansible.com/t/new-aws-ec2-instance-created-using-ansible-does-not-use-ssd/19632/4 "2015-11-04T15:49:14Z")

</div>

Hi all,

Thanks for reading my question. I have successfully created gp2 root volume by changing “volume\_type: gp2” to “device\_type: gp2” . (Not sure why it works. manual says that device\_type is deprecated)

The below yaml works

- name: Launch the new EC2 Instance  
ec2:  
group: ‘{{ security\_group }}’  
instance\_type: ‘{{ instance\_type}}’  
image: ‘{{ image }}’  
wait: true  
region: ‘{{ region }}’  
vpc\_subnet\_id: ‘{{ vpc\_subnet\_id }}’  
keypair: ‘{{ keypair }}’  
count: ‘{{count}}’  
volumes:
- device\_name: /dev/sda1  
device\_type: gp2  
volume\_size: 8  
register: ec2

Regards,

Abey
