I am trying to provision a VM using vmware_guest from template(which has a nic set to use DHCP vlan). Now When I provision VM with customization, it throws below error, however it provisions VM but fails to power on. And also I noticed that hostname in customization does not pick up.
my ansible version is 2.3
vcenter : 6.0
$ ansible-playbook vm_provision.yml -vv
Using /home/athangal/playbooks/ansible.cfg as config file
PLAYBOOK: vm_provision.yml ***********************************************************************************************************************
1 plays in vm_provision.yml
PLAY [localhost] *********************************************************************************************************************************
META: ran handlers
TASK [rhel_vm : Create VM] ***********************************************************************************************************************
task path: /home/athangal/playbooks/roles/rhel_vm/tasks/main.yml:2
fatal: [localhost]: FAILED! => {“changed”: true, “failed”: true, “msg”: “fault.NicSettingMismatch.summary”}
- name: Create VM
 vmware_guest:
 hostname: ‘{{vcenter_hostname}}’
 username: ‘{{vcenter_user}}’
 password: ‘{{vcenter_password}}’
 datacenter: MCR
 cluster: ‘RHEL-DRS 2’
 folder: “/RHEL 7”
 name: ‘{{vm_name}}’
 state: poweredon
 annotation: ‘{{notes}}’
 template: ‘{{vm_template_src}}’
 disk:
- size_gb: 150
 type: thin
 datastore: ‘RHEL-DRS-2-VMFS10’
 networks:
- name: “{{ vm_network }}”
 device_type: vmxnet3
 customization:
 hostname: marx5093
 register: Create_VM_Status