A VM may not be able to connect to devices on the network when bound to certain uplinks on an ESXi host. There is no indication of a vnic being disconnected, and the VM itself shows an active network link.
VMware ESXi 7.x
VMware vCenter Server 7.x
VMware ESXi 8.x
VMware vCenter Server 8.x
Upstream switch ports need to be configured to allow traffic on all VLANs used by endpoints on the ESXi host.
Determine which VMNIC a VM is bound to for communication outside the host:
esxtop
esxcli network nic vlan stats set -e true -n vmnicX
esxcli network nic vlan stats get -n vmnicX
Note : Since the VLAN tagged on vmnic1 is only VLAN 0, we are able to see it as shown in the screenshot. If there are multiple VLANs tagged, they will show up too in the output.
esxcli network nic vlan stats set -e false -n vmnicX
Note : The VLAN stats are designed for use as a troubleshooting tool and should not be left running full time. It is important to disable the stats after troubleshooting has completed.
To determine which VMNIC a VM is bound to for communication outside the host run the below commands:
esxcli network vm list | grep -i vm_name. --> This command will list networking information for the virtual machine
esxcli network vm port list -w 'world_id' ---> Specify the corresponding world ID number which is an output to the above command.