Manipulating EC2 instance storage

Hello everyone!

Here goes my first post in the wonderful Ansible project :slight_smile:

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:

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

`

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

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

Cheers!

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

Thanks for sharing this ! Much appreciated :slight_smile:

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

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