VMware Cloud Community
PoshTechGuyTJ
Enthusiast
Enthusiast
Jump to solution

Get-VDport missing data

I am having an odd experience with Get-VDPort. I am doing the following:

Get-VDSwitch | Get-VDPort -Uplink | where proxyhost -match "$($ESXHost.name)"

This is in a loop of many esx hosts.

This should produce all the uplinks in each vdswitch however I am missing uplinks. When i do this command on a specific vdswitch everything comes back as expected.

Anyone else experiencing this issue? or is this a known bug?

0 Kudos
1 Solution

Accepted Solutions
PoshTechGuyTJ
Enthusiast
Enthusiast
Jump to solution

So with a little time I was able to get a workaround. Not at clean but I get consistent results.

Original issue:

Get-VDSwitch | Get-VDPort -Uplink | where proxyhost -match "$($ESXHost.name)"

    results would not report correctly.

    While my example was with one vDS I was experiencing this with other hosts on other distributed switches.

How I Solved it:

Get-VDSwitch | %{ $_ | Get-VDPort -Uplink } | where proxyhost -match "$($ESXHost.name)"

This gets around the bug and gives me all the uplink ports for each vDS for the host.

View solution in original post

0 Kudos
9 Replies
LucD
Leadership
Leadership
Jump to solution

Try adding the VMHost parameter on the Get-VDSwitch cmdlet instead.

Get-VDSwitch -VMHost $ESXHost | Get-VDPort -Uplink


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
PoshTechGuyTJ
Enthusiast
Enthusiast
Jump to solution

No change in results.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Which uplinks are missing ?

Perhaps the output of the script and a screenshot of the dvSwitch would clarify.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
PoshTechGuyTJ
Enthusiast
Enthusiast
Jump to solution

Here are the results I am getting:

PS P:\Scripts> $switch = Get-VDSwitch

PS P:\Scripts> $switch

Name                        NumPorts   Mtu        Version  Vendor

----                        --------   ---        -------  ------

PilotLOB_VMTraffic          384        1500       5.5.0    VMware

Prod_VMTraffic              926        1500       5.5.0    VMware

Prod2_VMTraffic             2452       1500       5.5.0    VMware

Prod3_NLBVMTraffic          1570       1500       5.5.0    VMware, Inc.

Corp                        146        1500       5.5.0    VMware, Inc.

BackTest                    146        1500       5.5.0    VMware, Inc.

DevDatabase_VMTraffic       904        1500       5.1.0    VMware

ProdLOB_VMTraffic           768        1500       5.1.0    VMware

dvSwitch                    128        1500       5.0.0    VMware

dvSwitch2                   128        1500       5.0.0    VMware

PS P:\Scripts> $switch | where name -match "backtest"

Name                       NumPorts  Mtu        Version  Vendor

----                       --------  ---        -------  ------

BackTest                   146       1500       5.5.0    VMware, Inc.

PS P:\Scripts> $switch | where name -match "backtest" | Get-VDPort -Uplink | select Key,Name,ConnectedEntity,PortGroup,Switch,ProxyHost | sort ProxyHost | ft -AutoSize

Key Name     ConnectedEntity Portgroup                 Switch     ProxyHost

--- ----     --------------- ---------                 ------     ---------

10  Uplink 1 vmnic7          BackTest-DVUplinks-23386  BackTest   VMHost17

11  Uplink 2 vmnic18         BackTest-DVUplinks-23386  BackTest   VMHost17

9   Uplink 2 vmnic18         BackTest-DVUplinks-23386  BackTest   VMHost18

8   Uplink 1 vmnic7          BackTest-DVUplinks-23386  BackTest   VMHost18

2   Uplink 1 vmnic7          BackTest-DVUplinks-23386  BackTest   VMHost19

3   Uplink 2 vmnic18         BackTest-DVUplinks-23386  BackTest   VMHost19

16  Uplink 1 vmnic7          BackTest-DVUplinks-23386  BackTest   VMHost20

17  Uplink 2 vmnic18         BackTest-DVUplinks-23386  BackTest   VMHost20

7   Uplink 2 vmnic18         BackTest-DVUplinks-23386  BackTest   VMHost21

6   Uplink 1 vmnic7          BackTest-DVUplinks-23386  BackTest   VMHost21

0   Uplink 1 vmnic7          BackTest-DVUplinks-23386  BackTest   VMHost22

1   Uplink 2 vmnic18         BackTest-DVUplinks-23386  BackTest   VMHost22

15  Uplink 2 vmnic18         BackTest-DVUplinks-23386  BackTest   VMHost23

14  Uplink 1 vmnic7          BackTest-DVUplinks-23386  BackTest   VMHost23

4   Uplink 1 vmnic7          BackTest-DVUplinks-23386  BackTest   VMHost24

5   Uplink 2 vmnic18         BackTest-DVUplinks-23386  BackTest   VMHost24

13  Uplink 2 vmnic18         BackTest-DVUplinks-23386  BackTest   VMHost25

12  Uplink 1 vmnic7          BackTest-DVUplinks-23386  BackTest   VMHost25

PS P:\Scripts> $switch | Get-VDPort -Uplink | where proxyhost -match "VMHost17"

Key   Name       ConnectedEntity      Portgroup         IsLinkUp   MacAddress           Vlan            Switch

---   ----       ---------------      ---------         --------   ----------           ----            ------

651   dvUplink1  vmnic12              Prod2_VMTraff-... True       00:00:00:00:00:00                    Prod2_...

652   dvUplink2  vmnic3               Prod2_VMTraff-... True       00:00:00:00:00:00                    Prod2_...

4     dvUplink1  vmnic11              Prod3_NLBVMTr-... True       00:00:00:00:00:00                    Prod3_...

5     dvUplink2  vmnic5               Prod3_NLBVMTr-... True       00:00:00:00:00:00                    Prod3_...

10    Uplink 1   vmnic6               Prod-DVUplinks... True       00:00:00:00:00:00                    Corp

11    Uplink 2   vmnic19              Prod-DVUplinks... True       00:00:00:00:00:00                    Corp

As you can see from the results I should get results for the Backtest but I am not.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I see what you mean now, but I'm afraid I can't reproduce.

Which PowerCLI version is this ?

And can you include an expanded screenshot of the vdSwitch BackTest ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
PoshTechGuyTJ
Enthusiast
Enthusiast
Jump to solution

PS P:\Scripts> Get-PowerCLIVersion

PowerCLI Version

----------------

   VMware vSphere PowerCLI 6.0 Release 3 build 3205540

---------------

Component Versions

---------------

   VMWare AutoDeploy PowerCLI Component 6.0 build 2358282

   VMWare ImageBuilder PowerCLI Component 6.0 build 2358282

   VMware vSphere PowerCLI Component 6.0 build 3205541

   VMware Cloud Infrastructure Suite PowerCLI Component 6.0 build 3205541

   VMware VDS PowerCLI Component 6.0 build 3205541

   VMware vCloud Director PowerCLI Component 6.0 build 3191743

   VMware HA PowerCLI Component 6.0 build 2591578

   VMware License PowerCLI Component 6.0 build 3188616

   VMware vCloud Air PowerCLI Component 6.0 build 3191743

   VMware PowerCLI Component for Storage Management 6.0 build 3191741

   VMware vROps PowerCLI Component 6.0 build 3191742

   VMware vSphere Update Manager PowerCLI 6.1 build 3191523

And can you include an expanded screenshot of the vdSwitch BackTest ?

are you asking for all the switch's properties or all the properties for get-vdport output?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I have no knowledge of issues with that version and a vdSwitch.

No, the Configuration tab of the dvSwitch, with the Uplinks expanded.

So you see the connected ESXi nodes.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
PoshTechGuyTJ
Enthusiast
Enthusiast
Jump to solution

Here is the Config tab. Let me know if there is more info you need.

BackTest.png

0 Kudos
PoshTechGuyTJ
Enthusiast
Enthusiast
Jump to solution

So with a little time I was able to get a workaround. Not at clean but I get consistent results.

Original issue:

Get-VDSwitch | Get-VDPort -Uplink | where proxyhost -match "$($ESXHost.name)"

    results would not report correctly.

    While my example was with one vDS I was experiencing this with other hosts on other distributed switches.

How I Solved it:

Get-VDSwitch | %{ $_ | Get-VDPort -Uplink } | where proxyhost -match "$($ESXHost.name)"

This gets around the bug and gives me all the uplink ports for each vDS for the host.

0 Kudos