Hi,
I’ve been trying to change the size of my root partition when provisioning with the ec2 module. The documentation isn’t clear on what to do here, and I’m seeing some very strange results. I tried a bunch of possible device names to see what happened. Here’s the playbook:
- name: temp
 hosts: localhost
 connection: local
 gather_facts: False
 tasks:
- name: Launch/check temp
 local_action:
 module: ec2
 id: “prod-temp-{{ item.n }}”
 key_name: prod-2015
 image: ami-9eaa1cf6 # ubuntu 14.04 64bits
 instance_type: t2.small
 group_id: sg-cd72a9a9
 instance_tags: {“Name”: “prod-temp-{{ item.n }}”}
 assign_public_ip: yes
 vpc_subnet_id: subnet-1f76e168
 volumes:
- device_name: “{{ item.dev }}”
 volume_size: 123
 region: us-east-1
 zone: us-east-1c
 with_items:
- { n: “001”, dev: “/dev/sdb” }
- { n: “002”, dev: “/dev/sdb1” }
- { n: “003”, dev: “sdb” }
- { n: “004”, dev: “/dev/sda” }
- { n: “005”, dev: “/dev/sda1” }
- { n: “006”, dev: “sda” }
- { n: “007”, dev: “/dev/xvda” }
- { n: “008”, dev: “/dev/xvda1” }
- { n: “009”, dev: “xvda” }
The results from running this:
/dev/sdb: The root filesystem ends up being 8 GB on xvda1. xvdb exists with size 128 GB.
/dev/sda1: The root filesystem ends up being 123 GB on xvda1 (which is what I wanted, but strange that “sda1” turns into “xvda1”).
/dev/xvda: The root filesystem ends up being 8 GB on xvda1. No other block devices exist (other than xvda of course, at 8 GB).
xvda: The root filesystem ends up being 8 GB on xvda1. No other block devices exist (other than xvda of course, at 8 GB).
All others give an error of the form:
msg: Instance creation failed => InvalidBlockDeviceMapping: Invalid device name /dev/xvda1
Can anyone explain what’s going on here?
Thanks,
Jody