vmdk already exists error

Hi,

I am currently trying to deploy new VM’s from an existing template, but I do receive an error on every try:

Failed to create a virtual machine : Cannot complete the operation because the file or folder [LAB-GRPDC1-cluster1-vmware-vol02] /.vmdk already exists

My current task which I am using looks like the following:

`

  • name: Create VPS

vmware_guest:

hostname: “{{ lookup(‘env’, ‘VMWARE_HOST’) }}”

username: “{{ lookup(‘env’, ‘VMWARE_USER’) }}”

password: “{{ lookup(‘env’, ‘VMWARE_PASSWORD’) }}”

validate_certs: False

name: “{{ guest_hostname }}”

template: TMPL-CENTOS7

guest_id: rhel7_64Guest

datacenter: site-1

folder: /Test

state: poweredon

cluster: cluster-1

disk:

  • size_gb: “{{ guest_disk_size }}”

type: thin

autoselect_datastore: True

networks:

  • name: dv1-3300-management

ip: “{{ guest_ip_address }}”

netmask: “{{ guest_netmask }}”

gateway: “{{ guest_gateway }}”

hardware:

memory_mb: “{{ guest_memory * 1024 }}”

num_cpus: “{{ guest_vcpu }}”

hotadd_cpu: True

hotremove_cpu: True

hotadd_memory: True

customization:

hostname: “{{ guest_hostname }}”

wait_for_customization: True

wait_for_ip_address: True

delegate_to: localhost

register: deploy_result

`

I meanwhile did play with the autoselect_datastore option, which did not change anything. Before I used to fill into datastore option my cluster which created the same error.

Does somebody hava an idea what’s going wrong?

Thanks,
Raoul

I have found an open issue on Github describing the problem. When setting the same disk size as the template has, everything works fine.

See issue: https://github.com/ansible/ansible/issues/55551