# wait\_for\_ip\_address timeout in vmware\_guest module

**URL:** <https://forum.ansible.com/t/wait-for-ip-address-timeout-in-vmware-guest-module/23390>\
**Category:** Ansible Project\
**Created:** [January 5, 2017, 5:08pm UTC](https://forum.ansible.com/t/wait-for-ip-address-timeout-in-vmware-guest-module/23390 "2017-01-05T17:08:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neil\_Watson](https://avatars.discourse-cdn.com/v4/letter/n/dbc845/32.png) [@Neil\_Watson](https://forum.ansible.com/u/Neil_Watson)\
**Post date:** [January 5, 2017, 5:08pm UTC](https://forum.ansible.com/t/wait-for-ip-address-timeout-in-vmware-guest-module/23390/1 "2017-01-05T17:08:03Z")

</div>

Greetings,

I’m seeing evidence that the vmware\_guest module does not wait long enough to get the guest’s new IP. Is there a way to increase the wait time?

TASK [provision\_vm\_and\_set\_ip : Create VM from template] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [vsphere\_dcos1\_bootstrap] =\> {“changed”: true, “failed”: false, “instance”: {“hw\_eth13”: {“addresstype”: “assigned”, “ipaddresses”: [“fe80::250:56ff:feab:83d6”], “label”: “Network adapter 1”, “macaddress”: “00:50:56:ab:83:d6”, “macaddress\_dash”: “00-50-56-ab-83-d6”, “summary”: “VM Network”}, “hw\_guest\_full\_name”: “CentOS 4/5/6/7 (64-bit)”, “hw\_guest\_id”: “centos64Guest”, “hw\_interfaces”: [“eth13”], “hw\_memtotal\_mb”: 2048, “hw\_name”: “dcos1\_bootstrap”, “hw\_power\_status”: “poweredOn”, “hw\_processor\_count”: 1, “hw\_product\_uuid”: “422bbd74-90a6-a0c2-7aee-159722b8884c”, “ipv4”: null, “ipv6”: “fe80::250:56ff:feab:83d6”, “module\_hw”: true}}  
changed: [vsphere\_dcos1\_master2] =\> {“changed”: true, “failed”: false, “instance”: {“hw\_eth13”: {“addresstype”: “assigned”, “ipaddresses”: [“fe80::250:56ff:feab:5c0b”], “label”: “Network adapter 1”, “macaddress”: “00:50:56:ab:5c:0b”, “macaddress\_dash”: “00-50-56-ab-5c-0b”, “summary”: “VM Network”}, “hw\_guest\_full\_name”: “CentOS 4/5/6/7 (64-bit)”, “hw\_guest\_id”: “centos64Guest”, “hw\_interfaces”: [“eth13”], “hw\_memtotal\_mb”: 2048, “hw\_name”: “dcos1\_master2”, “hw\_power\_status”: “poweredOn”, “hw\_processor\_count”: 1, “hw\_product\_uuid”: “422b9843-43c5-b0ae-1172-ecb333bff0bb”, “ipv4”: null, “ipv6”: “fe80::250:56ff:feab:5c0b”, “module\_hw”: true}}  
changed: [vsphere\_dcos1\_master1] =\> {“changed”: true, “failed”: false, “instance”: {“hw\_eth13”: {“addresstype”: “assigned”, “ipaddresses”: [“10.120.8.215”, “fe80::250:56ff:feab:464f”], “label”: “Network adapter 1”, “macaddress”: “00:50:56:ab:46:4f”, “macaddress\_dash”: “00-50-56-ab-46-4f”, “summary”: “VM Network”}, “hw\_guest\_full\_name”: “CentOS 4/5/6/7 (64-bit)”, “hw\_guest\_id”: “centos64Guest”, “hw\_interfaces”: [“eth13”], “hw\_memtotal\_mb”: 2048, “hw\_name”: “dcos1\_master1”, “hw\_power\_status”: “poweredOn”, “hw\_processor\_count”: 1, “hw\_product\_uuid”: “422bd28d-35d6-349f-9424-81fc957d81cc”, “ipv4”: “10.120.8.215”, “ipv6”: “fe80::250:56ff:feab:464f”, “module\_hw”: true}}  
changed: [vsphere\_dcos1\_master3] =\> {“changed”: true, “failed”: false, “instance”: {“hw\_eth13”: {“addresstype”: “assigned”, “ipaddresses”: [“10.120.8.214”, “fe80::250:56ff:feab:506e”], “label”: “Network adapter 1”, “macaddress”: “00:50:56:ab:50:6e”, “macaddress\_dash”: “00-50-56-ab-50-6e”, “summary”: “VM Network”}, “hw\_guest\_full\_name”: “CentOS 4/5/6/7 (64-bit)”, “hw\_guest\_id”: “centos64Guest”, “hw\_interfaces”: [“eth13”], “hw\_memtotal\_mb”: 2048, “hw\_name”: “dcos1\_master3”, “hw\_power\_status”: “poweredOn”, “hw\_processor\_count”: 1, “hw\_product\_uuid”: “422b853f-359e-a2b7-5e66-4f4e1536df5b”, “ipv4”: “10.120.8.214”, “ipv6”: “fe80::250:56ff:feab:506e”, “module\_hw”: true}}

TASK [provision\_vm\_and\_set\_ip : set\_fact] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [vsphere\_dcos1\_bootstrap] =\> {“ansible\_facts”: {“new\_vm”: “”}, “changed”: false}  
ok: [vsphere\_dcos1\_master1] =\> {“ansible\_facts”: {“new\_vm”: “10.120.8.215”}, “changed”: false}  
ok: [vsphere\_dcos1\_master2] =\> {“ansible\_facts”: {“new\_vm”: “”}, “changed”: false}  
ok: [vsphere\_dcos1\_master3] =\> {“ansible\_facts”: {“new\_vm”: “10.120.8.214”}, “changed”: false}

`

- name: Create VM from template  
vmware\_guest:  
validate\_certs: False  
hostname: “{{ vcenter\_hostname }}”  
username: “{{ vcenter\_user }}”  
password: “{{ vcenter\_pass }}”  
name: “{{ vm\_name }}”  
state: poweredon  
template: “{{ vmtemplate }}”  
folder: “{{ folder }}”  
disk:

- size\_gb: 20  
type: thin  
datastore: “{{ datastore }}”  
nic:

- type: vmxnet3  
network: “{{ network }}”  
datacenter: “{{ esx\_datacenter }}”  
wait\_for\_ip\_address: True  
register: newvm

- set\_fact:  
new\_vm: “{{ newvm.instance.ipv4 }}”  
`

---

<div class="post-metadata">

**Author:** ![Neil\_Watson](https://avatars.discourse-cdn.com/v4/letter/n/dbc845/32.png) [@Neil\_Watson](https://forum.ansible.com/u/Neil_Watson)\
**Post date:** [January 5, 2017, 9:38pm UTC](https://forum.ansible.com/t/wait-for-ip-address-timeout-in-vmware-guest-module/23390/2 "2017-01-05T21:38:41Z")

</div>

FYI:  
[https://github.com/ansible/ansible/pull/19947](https://github.com/ansible/ansible/pull/19947)

---

<div class="post-metadata">

**Author:** ![Neil\_Watson](https://avatars.discourse-cdn.com/v4/letter/n/dbc845/32.png) [@Neil\_Watson](https://forum.ansible.com/u/Neil_Watson)\
**Post date:** [January 6, 2017, 8:30pm UTC](https://forum.ansible.com/t/wait-for-ip-address-timeout-in-vmware-guest-module/23390/3 "2017-01-06T20:30:04Z")

</div>

A quick update on this. I set the timeout to 10min and I still get some host info with ipv4 set to null, even though the vm does have an ipv4 address. How can I work around this?
