# Cannot reach newly created Windows VM

**URL:** <https://forum.ansible.com/t/cannot-reach-newly-created-windows-vm/30896>\
**Category:** Ansible Project\
**Tags:** windows, vmware\
**Created:** [July 29, 2019, 9:06pm UTC](https://forum.ansible.com/t/cannot-reach-newly-created-windows-vm/30896 "2019-07-29T21:06:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walter\_Kessler](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@Walter\_Kessler](https://forum.ansible.com/u/Walter_Kessler)\
**Post date:** [July 29, 2019, 9:06pm UTC](https://forum.ansible.com/t/cannot-reach-newly-created-windows-vm/30896/1 "2019-07-29T21:06:46Z")

</div>

I currently have a Workflow in Tower that does what I want, but it is doing so via a cumbersome method:

- First playbook creates a VM

- VMware Inventory sync

- Run additional playbooks (that may now be targeting already configured Windows VMs) to configure settings and install apps.  
Ideally, all I REALLY want to do is:

- Create the VM

- Run the additional playbooks to configure settings and install apps – against ONLY the newly created VM.  
I have seen examples in many places where folks use **add\_host** in playbooks that create new VMs/instances/etc so further actions can be taken.

I’m trying that as well, but cannot seem to get the Windows VM to be reachable via WinRM. Part of the ‘fun’ is that my VM is being customized and must first do the “OS Customization” reboot before Windows will have the correct IP and for the WinRM listener to be created. The code below is the playbook I’m currently running:

`

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [July 29, 2019, 9:44pm UTC](https://forum.ansible.com/t/cannot-reach-newly-created-windows-vm/30896/2 "2019-07-29T21:44:26Z")

</div>

checkout [https://docs.ansible.com/ansible-tower/latest/html/userguide/job\_templates.html#provisioning-callbacks](https://docs.ansible.com/ansible-tower/latest/html/userguide/job_templates.html#provisioning-callbacks)

---

<div class="post-metadata">

**Author:** ![Walter\_Kessler](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@Walter\_Kessler](https://forum.ansible.com/u/Walter_Kessler)\
**Post date:** [July 30, 2019, 4:06am UTC](https://forum.ansible.com/t/cannot-reach-newly-created-windows-vm/30896/3 "2019-07-30T04:06:14Z")

</div>

What’s the best method for a Windows machine to do a callback? PowerShell Run-once?

---

<div class="post-metadata">

**Author:** ![Walter\_Kessler](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@Walter\_Kessler](https://forum.ansible.com/u/Walter_Kessler)\
**Post date:** [July 30, 2019, 11:49pm UTC](https://forum.ansible.com/t/cannot-reach-newly-created-windows-vm/30896/4 "2019-07-30T23:49:15Z")

</div>

So, I discovered the powershell command to do this “invoke-webrequest” and it worked on a playbook as expected. However, the ‘inventory’ issue still remains – the machine has to BE in the inventory assigned to the job template or the callback won’t work.

I can obviously just add and inventory sync to the Workflow. However, I do NOT want that to run until I know the OS Customization pass is done and the machine (should) be done – otherwise, the inventory sync will capture the wrong IP information.

Is there a way to pause a play until a callback is made?
