VMware Cloud Community
Dim1tr1
Contributor
Contributor

Get List of VM IP addresses without using "Guest.IPAddress"

UPDATE: After upgrading to WMF 5.1 and PowerCLI 10 I can't reproduce the problem. The $_Guest.IPAddress now has all IP's identical to vSphere Client.

Hello,

I have already script which get all IP addresses of VM through "Guest.IPAddress"

Get-VM |

Select Name,VMHost, @{N="IP Address";E={@($_.guest.IPAddress -join '|')}} |

But there is a drawback in such solution, this call do not deliver _ALL_ IPAddresses which are used by VM but only IP's which are bound to the interface in VM.

For example if someone is running multiple Dropbox containers inside VM then this IPs are only visible in VMWare GUI but not through "Guest.IPAddress"

For Server below "Guest.IPAddress" deliver only IP "1", instead of IP "2"

pastedImage_1.png

The Question is: "How can I get all this IP's which are used inside VM inclusive IP's which are used inside running docker containers." ?

Thanks

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership

Sorry, not following here.
Are you saying that the View all in the Web CLient shows more IP addresses than those available in the array under $_.Guest.IPAddress?
Can you show what $_.Guest.IPAddress returns for the same VM from which you took the Web Client screenshot?


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

Reply
0 Kudos
Dim1tr1
Contributor
Contributor

Thank you for reply.

Are you saying that the View all in the Web CLient shows more IP addresses than those available in the array under $_.Guest.IPAddress?

That's exactly what I saw in Powershell. This was in PowerCLI 5.5 last week.

Today PowerCLI should be upgraded to the latest one and I will provide you response.

Reply
0 Kudos
Dim1tr1
Contributor
Contributor

After upgrading to WMF 5.1 and PowerCLI 10 I can't reproduce the problem. The $_Guest.IPAddress now has all IP's identical to vSphere Client.

I'll close this question.

Reply
0 Kudos