Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new tab for LogicalSwitches in NSX Routing excel file #45

Open
thisispuneet opened this issue Nov 22, 2017 · 0 comments
Open

Add new tab for LogicalSwitches in NSX Routing excel file #45

thisispuneet opened this issue Nov 22, 2017 · 0 comments
Assignees
Labels
feature request P2 Medium Priority

Comments

@thisispuneet
Copy link
Contributor

Add new tab for Logical Switch (VXlan) in NSX Routing excel.

  • show command output of: get-nsxlogicalswitch only name and vdnId
  • show the list of VXlan with the total number of VMs connected to it
$vxlan = 0
$VMs = Get-VM | Select Name, @{N="PortGroups";E={Get-VirtualPortGroup -VM $_ | %{$_.Name}}}
$PGs = $VMs | %{$_.PortGroups} | Select -Unique
$myCol = @()
ForEach ($PG in $PGs)
{
  $myObj = "" | Select PGName, NumVMs
  $myObj.PGName = $PG
  $myObj.NumVMs = ($VMs | Where {$_.PortGroups -contains $PG} | Measure-Object).Count
  $myCol += $myObj
}
#$myCol | Sort NumVMs -Descending | Format-Table -AutoSize

$myCol | %{if ($_.PGName.StartsWith("vxw-dvs")){
$_
$VXlan ++}}
Write-Host "`nTotal number of VxLAN are: $vxlan"
@HammadAlam HammadAlam added the P2 Medium Priority label Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request P2 Medium Priority
Projects
None yet
Development

No branches or pull requests

3 participants