# Manipulating EC2 instance storage

**URL:** <https://forum.ansible.com/t/manipulating-ec2-instance-storage/15480>\
**Category:** Ansible Project\
**Created:** [June 17, 2014, 10:44am UTC](https://forum.ansible.com/t/manipulating-ec2-instance-storage/15480 "2014-06-17T10:44:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaida.dan](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@vaida.dan](https://forum.ansible.com/u/vaida.dan)\
**Post date:** [June 17, 2014, 10:44am UTC](https://forum.ansible.com/t/manipulating-ec2-instance-storage/15480/1 "2014-06-17T10:44:54Z")

</div>

Hello everyone!

Here goes my first post in the wonderful Ansible project 🙂

Here’s the problem that I am facing: I am trying to launch an EC2 instance (c3.2xlarge) and, in the process, I want to resize the root partition from 8GB to something bigger. Also while in the process of launching the instance, I’d like to add those two extra disks (2x80GB SSD) that come with this instance.

I do not know if this is even achievable via Ansible.

So far, I looked at these two modules:

- [http://docs.ansible.com/ec2\_module.html](http://docs.ansible.com/ec2_module.html)
- [http://docs.ansible.com/ec2\_vol\_module.html](http://docs.ansible.com/ec2_vol_module.html)

I played with them in different ways, with no avail. Here is what I have now to successfully launch the instance. Playbook: provision.yml

`

---

<div class="post-metadata">

**Author:** ![vaida.dan](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@vaida.dan](https://forum.ansible.com/u/vaida.dan)\
**Post date:** [June 17, 2014, 8:09pm UTC](https://forum.ansible.com/t/manipulating-ec2-instance-storage/15480/2 "2014-06-17T20:09:01Z")

</div>

Hello again,

I managed to resize the root device by adjusting the volumes parameter like so:

`

volumes:

- device\_name: /dev/sda  
volume\_size: 20  
device\_type: gp2

`

Hint was found here: [New SSD-Backed Elastic Block Storage](http://aws.amazon.com/blogs/aws/new-ssd-backed-elastic-block-storage/)

Now the only question that remains is: how to add those two SSD drives as well?

Cheers!

---

<div class="post-metadata">

**Author:** ![Mike\_Buzzetti](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@Mike\_Buzzetti](https://forum.ansible.com/u/Mike_Buzzetti)\
**Post date:** [August 21, 2014, 1:01pm UTC](https://forum.ansible.com/t/manipulating-ec2-instance-storage/15480/3 "2014-08-21T13:01:49Z")

</div>

I just came across this.

I did something like this for a c3.xlarge. Setting the ephemeral number is the trick (The ssds are considered ephemeral when part of the instance store)

volumes:

- device\_name: /dev/xvdb  
volume\_size: 40  
device\_type: gp2  
ephemeral: ephemeral0
- device\_name: /dev/xvdc  
volume\_size: 40  
device\_type: gp2  
ephemeral: ephemeral1

---

<div class="post-metadata">

**Author:** ![vaida.dan](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@vaida.dan](https://forum.ansible.com/u/vaida.dan)\
**Post date:** [August 22, 2014, 7:49am UTC](https://forum.ansible.com/t/manipulating-ec2-instance-storage/15480/4 "2014-08-22T07:49:57Z")

</div>

Thanks for sharing this ! Much appreciated 🙂

The ephemeral disks are indeed SSD’s for the instance store.

---

<div class="post-metadata">

**Author:** ![BostonMoto](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@BostonMoto](https://forum.ansible.com/u/BostonMoto)\
**Post date:** [December 12, 2016, 5:19pm UTC](https://forum.ansible.com/t/manipulating-ec2-instance-storage/15480/5 "2016-12-12T17:19:35Z")

</div>

I discovered volume\_size is also optional when using ephemeral option here, it will default to the maximum size of the instance type spec.
