new AWS EC2 instance created using ansible does not use SSD

135 views
Skip to first unread message

Abey Thomas

unread,
Oct 27, 2015, 12:10:55 PM10/27/15
to Ansible Project
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

Igor Cicimov

unread,
Oct 28, 2015, 4:22:52 AM10/28/15
to Ansible Project
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.

Stephen Granger

unread,
Oct 28, 2015, 12:04:07 PM10/28/15
to ansible...@googlegroups.com
Would this depend on the AMI being used having a root ssd volume? 

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

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d4f92299-c3a6-4102-b9b5-45f58146d83b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Steve

Abey Thomas

unread,
Nov 4, 2015, 10:49:52 AM11/4/15
to ansible...@googlegroups.com
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

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/e0QVgvbuuWs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages