I am trying to find the ESXi host to which a virtual machine is registered. From the vm I am able to find the host (VcHostSystem) in vRO. Searching the API it would appear that I need HostVirtualNicManagerNicType (vSphere 6.0 Documentation Center). The code below allows me to iterate over the virtual NICs and includes IP address information but I haven't figured out how to definitively determine which interface(s), and therefore which IP(s), are designated for ESXi management.
var EsxiHostConfigNetworkdVnic = vm.runtime.host.config.network.vnic System.log( "EsxiHostConfigNetworkdVnic.length = " + EsxiHostConfigNetworkdVnic.length ) for( var VnicIndex = 0 , VnicLength = EsxiHostConfigNetworkdVnic.length ; VnicIndex < VnicLength ; VnicIndex++ ){ System.log( "EsxiHostConfigNetworkdVnic[" + VnicIndex + "] = " + EsxiHostConfigNetworkdVnic[ VnicIndex ] ) }
Thanks in advance.
P.S. I hope I got the correct forum.