Not an exhaustive post, I am still exploring this stuff.
To get a list of network adapters on a host:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
PowerCLI C:\> Get-VMHostNetworkAdapter -VMHost "ESX03.rakhesh.local" Name Mac DhcpEnabled IP SubnetMask DeviceName ---- --- ----------- -- ---------- ---------- vmnic0 00:0c:29:e8:a9:11 False vmnic0 vmnic1 00:0c:29:e8:a9:1b False vmnic1 vmnic2 00:0c:29:e8:a9:25 False vmnic2 vmnic3 00:0c:29:e8:a9:2f False vmnic3 vmnic4 00:0c:29:e8:a9:39 False vmnic4 vmnic5 00:0c:29:e8:a9:43 False vmnic5 vmk0 00:0c:29:e8:a9:11 False 10.50.0.33 255.255.255.0 vmk0 vmk2 00:50:56:63:15:44 False 1.1.1.3 255.255.255.0 vmk2 vmk1 00:50:56:66:e0:ab True 10.50.0.206 255.255.255.0 vmk1 vmk3 00:50:56:65:b3:d6 True 10.50.0.211 255.255.255.0 vmk3 |
To get a list of virtual switches on a host, with the NICs assigned to these:
1 2 3 4 5 6 7 |
PowerCLI C:\> Get-VirtualSwitch -VMHost "ESX03.rakhesh.local" | ft Name,Mtu,Nic Name Mtu Nic ---- --- --- vSwitch0 1500 {vmnic1, vmnic0} vSwitch1 1500 {vmnic3, vmnic2} vSwitch2 1500 {vmnic5, vmnic4} |
To get a list of port groups on a host:
1 2 3 4 5 6 7 8 9 10 |
PowerCLI C:\> Get-VirtualPortGroup -VMHost "ESX03.rakhesh.local" | ft VirtualSwitchName,Name VirtualSwitchName Name ----------------- ---- vSwitch0 VM Network vSwitch0 Management Network vSwitch1 iSCSI Management Network vSwitch1 iSCSI Traffic 2 vSwitch1 iSCSI Traffic 1 vSwitch2 vMotion Network |
To get a list of port groups , the virtual switches they are mapped to, and the NICs that make up these switches:
1 2 3 4 5 6 7 8 9 10 11 |
PowerCLI C:\> Get-VirtualPortGroup -VMHost "ESX03.rakhesh.local" | ft VirtualSwitchName,Name,@{Name="Nic";Expression={(Get-VirtualSwitch -VMHost "ESX03.rakhesh. local" -Name $_.VirtualSwitchName).Nic}} VirtualSwitchName Name Nic ----------------- ---- --- vSwitch0 VM Network {vmnic1, vmnic0} vSwitch0 Management Network {vmnic1, vmnic0} vSwitch1 iSCSI Management Network {vmnic3, vmnic2} vSwitch1 iSCSI Traffic 2 {vmnic3, vmnic2} vSwitch1 iSCSI Traffic 1 {vmnic3, vmnic2} vSwitch2 vMotion Network {vmnic5, vmnic4} |
This essentially combines the first and third cmdlets above.
More later!