wxt9861 / esxi_stats

ESXi component for Home Assistant
MIT License
145 stars 40 forks source link

get all vm guest ip's? #79

Open flum78 opened 1 year ago

flum78 commented 1 year ago

is it possible to get all vm ip's?

i tried to read the code and i i think i found where the integration get the guest_ip.

if vm_sum.guest.ipAddress: vm_ip = vm_sum.guest.ipAddress else: vm_ip = "n/a" _LOGGER.debug("Unable to return VM IP address for %s", vm_name)

i tried to change the code in:

if vm_sum.guest.net.IPAddress: vm_ip = vm_sum.guest.net.ipAddress else: vm_ip = "n/a" _LOGGER.debug("Unable to return VM IP address for %s", vm_name)

but this breaks the integration.

hope you could help.

greetings and big thanks for the integration

flum78 commented 1 year ago

hope this helps

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Grabbing-VM-ipaddress-via-PowerCLI/td-p/2663475