# Prefered way to launch a vm on vmware

**URL:** <https://forum.ansible.com/t/prefered-way-to-launch-a-vm-on-vmware/29314>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [December 21, 2018, 7:07am UTC](https://forum.ansible.com/t/prefered-way-to-launch-a-vm-on-vmware/29314 "2018-12-21T07:07:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_W](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@Michael\_W](https://forum.ansible.com/u/Michael_W)\
**Post date:** [December 21, 2018, 7:07am UTC](https://forum.ansible.com/t/prefered-way-to-launch-a-vm-on-vmware/29314/1 "2018-12-21T07:07:07Z")

</div>

Hello,  
I’m new to ansible and tried to launch a Linux VM on my first Ansible tests.  
This means cloning a vm from a template, booting and running some first-boot commands in order to hand over controll to Puppet inside the vm.

So i ended up with:

1. vmware\_guest to clone.
2. vmware\_tools\_wait to ensure OS is up and ready
3. vmware\_vm\_shell for to launch Puppet. This is the only way - Network access not an option by policy.

Works out of the box basicallly, but there seems to be a timing problem in step 2.  
Since the wm is rebooted in step 1 vmware\_tools\_wait fails in the first place with someting like “unable to contact vm”.

Ist my aproach correct and is there a way to get arround the timing problem other than a stupid “sleep” between ? Didnt find a retry option sadly.

Thanks for reading

---

<div class="post-metadata">

**Author:** ![Lucas\_Jackson](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@Lucas\_Jackson](https://forum.ansible.com/u/Lucas_Jackson)\
**Post date:** [December 21, 2018, 1:07pm UTC](https://forum.ansible.com/t/prefered-way-to-launch-a-vm-on-vmware/29314/2 "2018-12-21T13:07:14Z")

</div>

Hey Michael,

Might be worth looking at the wait\_for\_connection module, I use this with my vmware deployments and it seems to work pretty good.

[https://docs.ansible.com/ansible/latest/modules/wait\_for\_connection\_module.html](https://docs.ansible.com/ansible/latest/modules/wait_for_connection_module.html)

Luke

---

<div class="post-metadata">

**Author:** ![Michael\_W](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@Michael\_W](https://forum.ansible.com/u/Michael_W)\
**Post date:** [December 21, 2018, 1:26pm UTC](https://forum.ansible.com/t/prefered-way-to-launch-a-vm-on-vmware/29314/3 "2018-12-21T13:26:59Z")

</div>

Thanks Luke, but this requires networking again which i cant ensure due to topology and some wired policies.
