# Error in vm\_disk definition. Too many disks defined in comparison to the VM's disk profile.

**URL:** <https://forum.ansible.com/t/error-in-vm-disk-definition-too-many-disks-defined-in-comparison-to-the-vms-disk-profile/21321>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [May 1, 2016, 10:30am UTC](https://forum.ansible.com/t/error-in-vm-disk-definition-too-many-disks-defined-in-comparison-to-the-vms-disk-profile/21321 "2016-05-01T10:30:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Werner\_Dijkerman](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@Werner\_Dijkerman](https://forum.ansible.com/u/Werner_Dijkerman)\
**Post date:** [May 1, 2016, 10:30am UTC](https://forum.ansible.com/t/error-in-vm-disk-definition-too-many-disks-defined-in-comparison-to-the-vms-disk-profile/21321/1 "2016-05-01T10:30:49Z")

</div>

Hi,

I have an issue with the ‘vmware\_guest’ module.

Ik have the following 2 tasks:

`

- name: “Create VM”  
`  
vsphere\_guest:  
vcenter\_hostname: vcenter  
username: vcenter\_user  
password: vcenter\_password  
validate\_certs: no  
guest: newvm001  
from\_template: yes  
template\_src: template-centos-7-1  
cluster: cluster  
power\_on\_after\_clone: no  
esxi:  
datacenter: datacenter  
hostname: esxi1

- name: “Reconfigure VM”  
vsphere\_guest:  
vcenter\_hostname: vcenter  
username: vcenter\_user  
password: vcenter\_password  
validate\_certs: no  
guest: newvm001  
state: reconfigured  
vm\_disk:  
disk1:  
size\_gb: 20  
type: ‘thin’  
datastore: ds\_system  
disk2:  
size\_gb: 30  
type: ‘thin’  
datastore: ds\_data  
vm\_nic:  
nic1:  
type: vmxnet3  
network: 192.168.1.x  
network\_type: standard  
nic2:  
type: vmxnet3  
network: 192.168.2.x  
network\_type: standard  
esxi:  
datacenter: datacenter  
hostname: esxi1  
vm\_hardware:  
memory\_mb: 2048  
num\_cpus: 2

Creating the guest is working correctly and the template is cloned into the vm. This is an CentOS 7 and has 1 nic and 1 disk (disk1) and Vmware is on 5.5  
When the 2nd task is running, it gives an error:

`

{“changed”: false, “failed”: true, “msg”: “Error in vm\_disk definition. Too many disks defined in comparison to the VM’s disk profile.”}

`

When I execute the 2nd task again, it will run successfully, but the disk in “thick” and not “thin” provisioned.  
What am I doing wrong? Or do I encounter an bug?

I’m running Ansible 2.0.1.0  
Thanks in advance.

Kind regards,  
Werner

---

<div class="post-metadata">

**Author:** ![Tomasz\_Klosinski](https://avatars.discourse-cdn.com/v4/letter/t/51bf81/32.png) [@Tomasz\_Klosinski](https://forum.ansible.com/u/Tomasz_Klosinski)\
**Post date:** [October 3, 2016, 12:59pm UTC](https://forum.ansible.com/t/error-in-vm-disk-definition-too-many-disks-defined-in-comparison-to-the-vms-disk-profile/21321/2 "2016-10-03T12:59:57Z")

</div>

I’m having the same problem with Ansible version:

→ % ansible --version  
ansible 2.2.0 (devel c5b5a20031) last updated 2016/08/19 15:16:00 (GMT +200)  
lib/ansible/modules/core: (detached HEAD 91a839f1e3) last updated 2016/08/19 15:16:00 (GMT +200)  
lib/ansible/modules/extras: (detached HEAD 1aeb9f8a8c) last updated 2016/08/19 15:16:00 (GMT +200)  
config file = /Users/tkl/git/flynt/ansible-playbooks/scaling\_nodefactory/ansible.cfg  
configured module search path = Default w/o overrides
