# Vmware.vmware module getting network info about vm

**URL:** <https://forum.ansible.com/t/vmware-vmware-module-getting-network-info-about-vm/45375>\
**Category:** Get Help\
**Tags:** vmware\
**Created:** [February 22, 2026, 11:01am UTC](https://forum.ansible.com/t/vmware-vmware-module-getting-network-info-about-vm/45375 "2026-02-22T11:01:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BerkantErbey](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/berkanterbey/32/6892_2.png) [@BerkantErbey](https://forum.ansible.com/u/BerkantErbey)\
**Post date:** [February 22, 2026, 11:01am UTC](https://forum.ansible.com/t/vmware-vmware-module-getting-network-info-about-vm/45375/1 "2026-02-22T11:01:38Z")

</div>

**I want to disconnect vm’s nic. But i cant do it with modules in vmware.vmware collection. Because i dont know network parameter of that vm. How can i get that parameter , which module in vmware.vmware collection?**.

```auto
vmware.vmware.vm:
  moid: xxxx
  network_adapters:
    - network: "XXXX"
      connected: false

```

---

<div class="post-metadata">

**Author:** ![BerkantErbey](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/berkanterbey/32/6892_2.png) [@BerkantErbey](https://forum.ansible.com/u/BerkantErbey)\
**Post date:** [February 22, 2026, 11:16am UTC](https://forum.ansible.com/t/vmware-vmware-module-getting-network-info-about-vm/45375/2 "2026-02-22T11:16:59Z")

</div>

Hi there, I am solved this problem just now.

There is a module “vmware.vmware.vm\_portgroup\_info”

I used this module just like above  
Little explanation:

1. **vm\_names** can be a list too.
2. In the debug section i used …**inventory\_hostname[0].** , because there can be multiple nic in that vm, i want to get only first nic.

```auto
- name: gather network info about vm
  vm_portgroup_info:
    vm_names: "{{ inventory_hostname }}"
   register: netInfo

- debug:
     msg: " {{ netInfo.vm_portgroup_info.[inventory_hostname][0].portgroup_name }}"

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 24, 2026, 11:17am UTC](https://forum.ansible.com/t/vmware-vmware-module-getting-network-info-about-vm/45375/3 "2026-03-24T11:17:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
