VMware Cloud Community
PaulLJackson
Contributor
Contributor

How to get Service Console IPs in 4.1?

I have a PowerShell script that will retrieve service console  IPs and Vmotion IP's.  It works correctly in 3.5 and 4.0.  In 4.1, it only retrieves the vMotion address.

In the one cluster that is using a distributed switch, it appears to be grabbing the private uplink addresses for the vMotion value.

Thanks

PJ

0 Kudos
1 Reply
RvdNieuwendijk
Leadership
Leadership

You can try if the next PowerCLI script will give you the service console IP address of an ESX 4.1 host with a distributed virtual switch. Although the script works for an ESX 3.5 host, I was not able to test it against an ESX 4.1 host because we have only ESXi 4.1. And that doesn't have a service console.

Get-View -ViewType HostSystem | ForEach-Object {
  $VMHostView = $_
  $NetworkSystem = Get-View $VMHostView.ConfigManager.NetworkSystem
  $Report = "" | Select-Object -Property VMHost,ConsoleNicIP
  $Report.VMHost = $VMHostView.Name
  $Report.ConsoleNicIP = @()
  $NetworkSystem.NetworkConfig.ConsoleVnic | `
    Select-Object -ExpandProperty Spec | `
    Select-Object -ExpandProperty IP | ForEach-Object {
      $Report.ConsoleNicIP += $_.IpAddress
    }
  $Report
}


Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos