# VMware VM creation works but on boot the network adapter is disconnected

**URL:** <https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895>\
**Category:** Ansible Project\
**Tags:** rhel, vmware\
**Created:** [March 31, 2021, 11:38am UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895 "2021-03-31T11:38:32Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![N\_Owens](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@N\_Owens](https://forum.ansible.com/u/N_Owens)\
**Post date:** [March 31, 2021, 11:38am UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/1 "2021-03-31T11:38:32Z")

</div>

I’m using Ansible Tower 3.8.2.  
Ansible core is 2.9.15

I’m using the vmware\_rest collection.

I’m able to get the linux VM created from a template. And the VM does poweron. But when it comes up the network adapter does not. It is in disconnected state.

My linux VM is RHEL 8.2

I see online that many folks have had this issue but I’m not seeing what the solution is for it.

Can anyone offer any tips that may help me solve this problem?

Thanks,

Norm

---

<div class="post-metadata">

**Author:** ![Chris\_Bachmeyer](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Chris\_Bachmeyer](https://forum.ansible.com/u/Chris_Bachmeyer)\
**Post date:** [May 27, 2022, 3:05am UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/2 "2022-05-27T03:05:19Z")

</div>

We’re on Ansible Tower 3.8.3 and Ansible core is 2.9.x.

I am trying to use the community.vmware collection and looking to deploy Windows and Linux vms to vSphere.

When deploying Windows 2019 vms, the network adapter is always disconnected.

It seems like many are having issues with the same issue but there are few if any solutions.

Any suggestions?

Thanks!

---

<div class="post-metadata">

**Author:** ![N\_Owens](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@N\_Owens](https://forum.ansible.com/u/N_Owens)\
**Post date:** [May 27, 2022, 8:45am UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/3 "2022-05-27T08:45:06Z")

</div>

Christopher,

I had a similar issue with RHEL. I found that the image/template that I was using to build my VM was missing a perl module. I’ll have to check my notes for which module. Once I installed that module in my image template, it worked.

I now need to do the same and get windows VMs spun up. Would you mind sharing your playbook? I have a test environment and I would be willing to help troubleshoot your issue.

Regards,

Norm

---

<div class="post-metadata">

**Author:** ![Chris\_Bachmeyer](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Chris\_Bachmeyer](https://forum.ansible.com/u/Chris_Bachmeyer)\
**Post date:** [May 27, 2022, 3:16pm UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/4 "2022-05-27T15:16:29Z")

</div>

Hi, Norm,

I have read about that issue in the forums regarding Perl and vmware tools on RHEL/ CentOS. As far as I know, Windows does not need Perl … ?

I read on a forum post that someone found a vDS was somehow at the root of this issue which is, of course, what I am using as the network. That  
gentleman switched over to a simple vswitch which seemed to alleviate this issues.

You can read about it here along with a few other leads: [https://github.com/ansible/ansible/issues/24506](https://github.com/ansible/ansible/issues/24506)

Sure, great! I’ve redacted sensitive info. The content within angle brackets indicate redacted or changed content.

I am trying to work with a Windows2019 template.

---

<div class="post-metadata">

**Author:** ![N\_Owens](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@N\_Owens](https://forum.ansible.com/u/N_Owens)\
**Post date:** [June 1, 2022, 7:27pm UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/5 "2022-06-01T19:27:26Z")

</div>

Chris,  
The only thing I’ve seen so far is that you want to make sure the template or image you are cloning has the latest version of vmware tools installed.

Norm

---

<div class="post-metadata">

**Author:** ![N\_Owens](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@N\_Owens](https://forum.ansible.com/u/N_Owens)\
**Post date:** [June 6, 2022, 8:50pm UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/6 "2022-06-06T20:50:22Z")

</div>

Chris,  
I got the windows VM to poweron with the network connected with this configuration. Hope this helps.

Ansible: 2.9 Tower: 3.8.2

- Compatibility: ESXi 6.7 Update 2 and later (VM version 15)

- VMware Tools: Running, version:11297 (Current)

```auto
- name: "Create VM {{ vmware_provision_vm_hostname_long }} with IP {{ vmware_provision_vm_network_ip_addr }}"
  community.vmware.vmware_guest:
    datacenter: '{{ vmware_provision_datacenter }}'
    cluster: '{{ vmware_provision_vm_cluster }}'
    datastore: '{{ vmware_provision_vm_datastore }}'
    name: '{{ vmware_provision_vm_hostname_long }}'
    template: '{{ vmware_provision_vm_template }}'
    folder: '{{ vmware_provision_vm_folder }}'
    networks: 
    - name: '{{ vmware_provision_vm_network_name }}'  
      ip: '{{ vmware_provision_vm_network_ip_addr }}'
      netmask: '{{ vmware_provision_vm_network_ip_netmask_addr }}'
      gateway: '{{ vmware_provision_vm_network_ip_gateway_addr }}'
      type: "static"
      start_connected: true
    wait_for_ip_address: true
  delegate_to: localhost

```

---

<div class="post-metadata">

**Author:** ![Chris\_Bachmeyer](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Chris\_Bachmeyer](https://forum.ansible.com/u/Chris_Bachmeyer)\
**Post date:** [June 7, 2022, 1:58pm UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/7 "2022-06-07T13:58:30Z")

</div>

Hi, Norm,

My apologies for not seeing this post earlier. No updates actually came to my inbox …

Thanks for the work, really appreciate it. I’ll give this a go this morning and see what happens!

---

<div class="post-metadata">

**Author:** ![Chris\_Bachmeyer](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Chris\_Bachmeyer](https://forum.ansible.com/u/Chris_Bachmeyer)\
**Post date:** [June 7, 2022, 7:33pm UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/8 "2022-06-07T19:33:39Z")

</div>

Still no dice. I made the changes but I seem to be getting hung-up on an ipv6 address assignment which makes no sense.  
I am not using ipv6 and don’t have anything in the code either.

This is the stdout from Ansible …

“ipaddresses”: [  
“fe80::7990:4f2e:dfba:fcf5”,  
“”,  
“169.254.252.245”  
],

“ipv4”: null,

“ipv6”: “fe80::7990:4f2e:dfba:fcf5”,

---

<div class="post-metadata">

**Author:** ![N\_Owens](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@N\_Owens](https://forum.ansible.com/u/N_Owens)\
**Post date:** [June 7, 2022, 7:41pm UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/9 "2022-06-07T19:41:14Z")

</div>

It’s prob in your template or VM that you are cloning. Check there and disable.

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [June 13, 2022, 11:43am UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/10 "2022-06-13T11:43:28Z")

</div>

Are you sure your vDS Name is accurate for the VLAN you are want to be attached?

---

<div class="post-metadata">

**Author:** ![Chris\_Bachmeyer](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Chris\_Bachmeyer](https://forum.ansible.com/u/Chris_Bachmeyer)\
**Post date:** [June 13, 2022, 4:11pm UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/11 "2022-06-13T16:11:09Z")

</div>

Hey Walter,

Yeah, for sure. I’ve double checked this a number of times.

Regarding the ipv6 info Ansible was spitting to stdout, my best guess is this is coming from the vm level. It does not appear to be interfering with any of the builds, etc.  
If necessary, I can have one of the SA’s remove IPv6, either disabling or uninstalling it, and recreating a win vmware template.

While I still do not understand the root cause of the underlying issue with automated windows builds on vmware, I was able to overcome the issue.

I removed the network adapter from the vmware template and recreated a new template to use. I’ve tested the builds mainly using dhcp but statically

assigned IP addresses should work without issue.

Alternatively, it may be possible to write a few tasks in Ansible to create a windows vm while leaving it off, remove the adapter, and then add  
a new adapter. This may work in addition to creating a new template without the adapter. I have yet to test this though.

It would be really beneficial to understand the root cause of the adapter issue on windows builds.

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [June 13, 2022, 5:06pm UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/12 "2022-06-13T17:06:30Z")

</div>

This is my entire task for creating a VM = works for Windows and Linux.

- name: create the guest vm using template  
community.vmware.vmware\_guest:  
validate\_certs: no  
hostname: “{{ vcenter[location|lower].vc }}”  
datacenter: “{{ vcenter[location|lower].dc }}”  
cluster: “{{ vcenter[location|lower].cl }}”  
name: “{{ vm\_guest\_name | lower }}”  
state: poweredoff  
template: “{{ os\_type }}”  
folder: “{{ esx\_folder }}”  
datastore: “{{ vcenter[location|lower].ds }}”  
hardware:  
hotadd\_cpu: yes  
hotadd\_memory: yes  
memory\_mb: “{{ vm\_spec[vm\_size].ram }}”  
num\_cpus: “{{ vm\_spec[vm\_size].cpu }}”  
networks:
- name: “VLAN\_{{ vlan }}”  
type: dhcp  
start\_connected: yes  
connected: yes  
wait\_for\_ip\_address: no  
delegate\_to: localhost  
register: newvm

Does the folder where you place your VM have permission to the VLAN to which you are attaching? Seems like this is an environment related issue and not an ansible issue.

Walter

---

<div class="post-metadata">

**Author:** ![Chris\_Bachmeyer](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Chris\_Bachmeyer](https://forum.ansible.com/u/Chris_Bachmeyer)\
**Post date:** [June 14, 2022, 1:45pm UTC](https://forum.ansible.com/t/vmware-vm-creation-works-but-on-boot-the-network-adapter-is-disconnected/34895/13 "2022-06-14T13:45:30Z")

</div>

Looking into this, Walter. Thanks!
