We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
CCOSTAN
Learn more about funding links in repositories.
Report abuse
1 parent fb522c1 commit d1b8ba6Copy full SHA for d1b8ba6
show_nic.sh
@@ -0,0 +1,17 @@
1
+#!/bin/sh
2
+
3
+# Get the list of VMs
4
+esxcli network vm list | awk 'NR>2' > /tmp/vmlist
5
6
+while read -r line; do
7
+ WorldID=$(echo $line | awk '{print $1}')
8
+ VMName=$(echo $line | awk ' {print $2}')
9
+ PortList=$(esxcli network vm port list -w $WorldID)
10
+ NICID=$(echo "$PortList" | grep "Team Uplink:" | awk '{print $3}')
11
+ MACID=$(echo "$PortList" | grep "MAC Address:" | awk '{print $3}')
12
+ echo "VM: $VMName NIC: $NICID MAC: $MACID"
13
+ echo "For more Details: esxcli network vm port list -w $WorldID"
14
+done < /tmp/vmlist
15
16
+# Clean up the temporary file
17
+rm /tmp/vmlist
0 commit comments