# Cannot specify volume\_size together with id or snapshot (ec2\_vol) - How to increase size while creating volume from snapshot?

**URL:** <https://forum.ansible.com/t/cannot-specify-volume-size-together-with-id-or-snapshot-ec2-vol-how-to-increase-size-while-creating-volume-from-snapshot/22021>\
**Category:** Ansible Project\
**Created:** [July 14, 2016, 8:22pm UTC](https://forum.ansible.com/t/cannot-specify-volume-size-together-with-id-or-snapshot-ec2-vol-how-to-increase-size-while-creating-volume-from-snapshot/22021 "2016-07-14T20:22:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [July 14, 2016, 8:22pm UTC](https://forum.ansible.com/t/cannot-specify-volume-size-together-with-id-or-snapshot-ec2-vol-how-to-increase-size-while-creating-volume-from-snapshot/22021/1 "2016-07-14T20:22:40Z")

</div>

I have the use case where I want to create a snapshot, make a new volume from that snapshot, but larger, and then attach the new volume to an instance.

So far, I have the snapshot creation working, but the ec2\_vol module is now telling me that I cannot specify a volume size with the snapshot id. Why not? This is something I can do in the web GUI.

`

- name: snapshot current backup volume  
ec2\_snapshot:  
aws\_access\_key: “{{aws\_key}}”  
aws\_secret\_key: “{{aws\_secret}}”  
region: “{{aws\_region}}”  
state: present  
wait: yes  
wait\_timeout: 0 #0 means Never timeout(sec)  
description: “snapshot of xvdj from backup server taken {{ansible\_date\_time.iso8601}}”  
instance\_id: “i-a34c2967”  
device\_name: “/dev/xvdj”  
snapshot\_tags:  
frequency: random  
client: jdelaporte  
Name: “backups\_{{ansible\_date\_time.iso8601}}”  
register: new\_snapshot

- name: get instance id for current nfsmaster  
ec2\_remote\_facts:  
aws\_access\_key: “{{aws\_key}}”  
aws\_secret\_key: “{{aws\_secret}}”  
region: “{{aws\_region}}”  
filters:  
ip-address: 52.34.225.188  
register: nfsmaster\_info

- name: create new volume from new backup data snapshot  
ec2\_vol:  
aws\_access\_key: “{{aws\_key}}”  
aws\_secret\_key: “{{aws\_secret}}”  
region: “{{aws\_region}}”  
state: present  
device\_name: /dev/xvdz  
volume\_size: 700  
snapshot: “{{new\_snapshot.snapshot\_id}}”  
instance: “{{item.id}}”  
volume\_type: standard  
with\_items: “{{nfsmaster\_info.instances}}”

`

`failed: [localhost] ... "msg": "Cannot specify volume_size together with id or snapshot"`
