# Nic blank with Windows VM creation in specific environment

**URL:** <https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641>\
**Category:** Get Help\
**Tags:** windows, vmware\
**Created:** [October 8, 2025, 4:01pm UTC](https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641 "2025-10-08T16:01:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike321](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mike321/32/9602_2.png) [@Mike321](https://forum.ansible.com/u/Mike321)\
**Post date:** [October 8, 2025, 4:01pm UTC](https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641/1 "2025-10-08T16:01:30Z")

</div>

Hi folks,

I’m new to the Ansible community so pardon any beginner questions or lack there of :). I have a dev VMware environment 8u3, where I’m able to create a VM, set a nic, IP, join the domain etc, no issues. This same playbook in my prod environment (same version of VMware), doesn’t assign a nic to it. Once I manually do it, the playbook completes and life is good. I’ve tried a bunch of different stuff but I can’t figure out the issue. I’m getting plenty of errors, and breadcrumbs but am lost what to try next. From what I keep seeing, the template needs to have a nic connected and it does, but every time, it can’t assign the nic. Any ideas of something to try?

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/0/06c04ebac85d3f3234b34ebee013bbe17231d72b.png)

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/d/dfbac9bf916285d91d9b1acc6827c55d0eb45f78.jpeg)

```
- name: Create VM
  community.vmware.vmware_guest:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: "{{ vcenter_validate_certs }}"
    datacenter: "{{ datacenter }}"
    cluster: "{{ cluster }}"
    folder: "{{ vm_folder }}"
    name: "{{ vm_name }}"
    template: "{{ vm_template }}"
    state: poweredon
    hardware:
      memory_mb: "{{ vm_memory }}"
      num_cpus: "{{ vm_cpus }}"
    networks:
      - name: "{{ network }}"
        device_type: vmxnet3
        start_connected: true
        type: static
        ip: "{{ vm_ip }}"
        netmask: "{{ vm_netmask }}"
        gateway: "{{ vm_gateway }}"
        force: true
    wait_for_ip_address: yes
    wait_for_customization: yes
    customization:
     joindomain: "{{ domain_name | default(omit) }}"
     domainadmin: "{{ domain_admin_user | default(omit) }}"
     domainadminpassword: "{{ domain_admin_password | default(omit) }}"
     domain_ou: "{{ domain_ou | default(omit) }}"
     dns_servers: >-
       {{ [vm_dns1, vm_dns2] | select('defined') | list if domain_name is defined else omit }}
    annotation: "{{ vm_description | default('') }}"
  register: newvm

```

---

<div class="post-metadata">

**Author:** ![Mike321](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mike321/32/9602_2.png) [@Mike321](https://forum.ansible.com/u/Mike321)\
**Post date:** [October 8, 2025, 4:15pm UTC](https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641/2 "2025-10-08T16:15:48Z")

</div>

One more thing I just learned which may help, is that when I choose a network to assign the new machine is a traditional vlan backed network it assigns the nic, nice that are nsxt backed it doesn’t assign

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [October 8, 2025, 5:04pm UTC](https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641/3 "2025-10-08T17:04:55Z")

</div>

I would guess that the module is unable to find the network you are trying to assign to the nic, and just skipping it.  
Based on your second post, I’d guess the module was not written with nsx networks in mind

---

<div class="post-metadata">

**Author:** ![Mike321](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mike321/32/9602_2.png) [@Mike321](https://forum.ansible.com/u/Mike321)\
**Post date:** [October 8, 2025, 5:26pm UTC](https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641/4 "2025-10-08T17:26:46Z")

</div>

Thanks for the reply. The name is for sure right, since when I type it in wrong, I get an error saying it can’t find the network. It seems to be related to being part of a NSX network, but Im not sure the best approach here. I was assuming someone else ran into this before and could offer advice 🙂

---

<div class="post-metadata">

**Author:** ![mariolenz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mariolenz/32/108_2.png) [@mariolenz](https://forum.ansible.com/u/mariolenz)\
**Post date:** [October 8, 2025, 5:56pm UTC](https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641/5 "2025-10-08T17:56:30Z")

</div>

> [@mikemorency](#):
>
> Based on your second post, I’d guess the module was not written with nsx networks in mind

I think you’re right there. This module is quite old, and I’m pretty sure we haven’t tested this with NSX. On the other hand it shouldn’t make a difference if a portgroup is backed by NSX or not.

But I’m not really sure. At the end of the day, this module is a mess. It wants to do too many things at once, and this makes it hard to fix stuff. Apart from everything else, there are nearly 4k lines of code! That’s far too much…

Not to put too fine a point on this: If I (the maintainer of `community.vmware`) say I don’t understand it, that’s definitionally is a problem.

---

<div class="post-metadata">

**Author:** ![Mike321](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mike321/32/9602_2.png) [@Mike321](https://forum.ansible.com/u/Mike321)\
**Post date:** [October 8, 2025, 9:51pm UTC](https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641/6 "2025-10-08T21:51:24Z")

</div>

hahah oh boy, when you see there’s 4k lines of code what are you referring to?

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [October 8, 2025, 11:18pm UTC](https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641/7 "2025-10-08T23:18:57Z")

</div>

The source code for the module you are using, [community.vmware/plugins/modules/vmware\_guest.py at main · ansible-collections/community.vmware · GitHub](https://github.com/ansible-collections/community.vmware/blob/main/plugins/modules/vmware_guest.py)

---

<div class="post-metadata">

**Author:** ![Mike321](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mike321/32/9602_2.png) [@Mike321](https://forum.ansible.com/u/Mike321)\
**Post date:** [October 8, 2025, 11:32pm UTC](https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641/8 "2025-10-08T23:32:16Z")

</div>

Gotcha! Again sorry for the newby questions, should I be leveraging a different module for some of the basic VM creation and configuration I’m looking to do? Nothing crazy as you can see from the playbook.

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [October 9, 2025, 12:13am UTC](https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641/9 "2025-10-09T00:13:51Z")

</div>

That is the main module for managing VMs, but you do have other options.

You could use that module to create the VM, then use a different module to manage the NIC and apply customizations. There’s a customization module in VMware.vmware\_rest [Vmware.Vmware\_Rest — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/collections/vmware/vmware_rest/index.html)

And there’s a community module to manage nics, [community.vmware.vmware\_guest\_network module – Manage network adapters of specified virtual machine in given vCenter infrastructure — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_network_module.html#ansible-collections-community-vmware-vmware-guest-network-module)

There’s a module in vmware\_rest to create/manage VMs too but I would not recommend it. There is a new module to manage VMs under development in vmware.vmware which will supersede the VMware.vmware\_rest one.

That new module should be able to do the nic management you want, but it’s not production ready yet and customization will likely not be included. I’m the developer so you can try it out (at your own risk) and if nsx networks still don’t work, let me know and I can try to add support

> **[vmware.vmware.\_vm\_stub module – This is a partial implementation of a module....](https://docs.ansible.com/ansible/latest/collections/vmware/vmware/_vm_stub_module.html#ansible-collections-vmware-vmware-vm-stub-module)**

---

<div class="post-metadata">

**Author:** ![Mike321](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mike321/32/9602_2.png) [@Mike321](https://forum.ansible.com/u/Mike321)\
**Post date:** [October 20, 2025, 1:13pm UTC](https://forum.ansible.com/t/nic-blank-with-windows-vm-creation-in-specific-environment/44641/10 "2025-10-20T13:13:07Z")

</div>

Sorry for the delay in response. This is extremely helpful, thanks so much for the information. For now, my work around is to manually select the nic on the machine and the workflow completes without issue. I will be revising this down the road, but with the limited number of machines we create monthly it works.

Thanks again
